listen              1935;
max_connections     1000;
srs_log_tank        console;
daemon              off;

http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}

rtc_server {
    enabled         on;
    listen          8000;
}

vhost __defaultVhost__ {

    dvr {
        enabled         on;
        #all表示录制所有视频流，也可以按频道录制
        #规则为<app>/<stream>，例：live/stream1 live/stream2
        #规则为<app>/<stream>，例：live/stream1 live/stream2
        dvr_apply       all;
        #dvr计划
        dvr_plan        segment;
        #录制的路径，详细配置规则见附录三
        dvr_path        ./objs/nginx/html/record/[2006][01][02]/[app][stream]/[timestamp].flv;
        #segment方式录制时间设置，单位: s
        dvr_duration    900;
        #开启按关键帧且flv 
        dvr_wait_keyframe       on;
        #时间戳抖动算法。full使用完全的时间戳矫正；
        #zero只是保证从0开始；off不矫正时间戳。
        time_jitter             full;
    }


    rtc {
        enabled     on;
        # 开启rtc录制
        rtmp_to_rtc on;
        rtc_to_rtmp on;
    }

    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    
    hls {
        enabled     on;
        hls_path    ./objs/nginx/html;
        hls_fragment    10;
        hls_window      60;
    }
}
