From 7ddabd2cc20d7a8ba4db997eaa4997749634f1ee Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 10 Oct 2022 07:40:22 +0800 Subject: [PATCH] Config: Remove space of directive. --- trunk/conf/full.conf | 792 +++++++++++++++++++++---------------------- 1 file changed, 396 insertions(+), 396 deletions(-) diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index 17aa26a44..9bd888559 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -24,55 +24,55 @@ pid ./objs/srs.pid; # Note: Do not support reloading, for SRS5+ # Overwrite by env SRS_FF_LOG_DIR # default: ./objs -ff_log_dir ./objs; +ff_log_dir ./objs; # the log level for FFMPEG. # info warning error fatal panic quiet # trace debug verbose # Note: Do not support reloading, for SRS5+ # Overwrite by env SRS_FF_LOG_LEVEL # default: info -ff_log_level info; +ff_log_level info; # the log tank, console or file. # if console, print log to console. # if file, write log to file. requires srs_log_file if log to file. # Note: Do not support reloading, for SRS5+ # Overwrite by env SRS_SRS_LOG_TANK # default: file. -srs_log_tank console; +srs_log_tank console; # the log level, for all log tanks. # can be: verbose, info, trace, warn, error # Note: Do not support reloading, for SRS5+ # Overwrite by env SRS_SRS_LOG_LEVEL # default: trace -srs_log_level trace; +srs_log_level trace; # when srs_log_tank is file, specifies the log file. # Note: Do not support reloading, for SRS5+ # Overwrite by env SRS_SRS_LOG_FILE # default: ./objs/srs.log -srs_log_file ./objs/srs.log; +srs_log_file ./objs/srs.log; # the max connections. # if exceed the max connections, server will drop the new connection. # Overwrite by env SRS_MAX_CONNECTIONS # default: 1000 -max_connections 1000; +max_connections 1000; # whether start as daemon # @remark: do not support reload. # Overwrite by env SRS_DAEMON # default: on -daemon off; +daemon off; # whether use utc_time to generate the time struct, # if off, use localtime() to generate it, # if on, use gmtime() instead, which use UTC time. # Note: Do not support reloading, for SRS5+ # Overwrite by env SRS_UTC_TIME # default: off -utc_time off; +utc_time off; # config for the pithy print in ms, # which always print constant message specified by interval, # whatever the clients in concurrency. # Overwrite by env SRS_PITHY_PRINT_MS # default: 10000 -pithy_print_ms 10000; +pithy_print_ms 10000; # the work dir for server, to chdir(work_dir) when not empty or "./" # user can config this directory to change the dir. @@ -140,14 +140,14 @@ auto_reload_for_docker on; # for example, 192.168.1.100:1935 10.10.10.100:1935 # where the ip is optional, default to 0.0.0.0, that is 1935 equals to 0.0.0.0:1935 # Overwrite by env SRS_LISTEN -listen 1935; +listen 1935; # the default chunk size is 128, max is 65536, # some client does not support chunk size change, # however, most clients support it and it can improve # performance about 10%. # Overwrite by env SRS_CHUNK_SIZE # default: 60000 -chunk_size 60000; +chunk_size 60000; ############################################################################################# # HTTP sections @@ -162,34 +162,34 @@ http_api { # whether http api is enabled. # Overwrite by env SRS_HTTP_API_ENABLED # default: off - enabled on; + enabled on; # The http api listen entry is <[ip:]port>, For example, 192.168.1.100:8080, where the ip is optional, default to # 0.0.0.0, that is 8080 equals to 0.0.0.0:8080. # Note that you're able to use a dedicated port for HTTP API, such as 1985, to be different with HTTP server. In # this situation, you you must also set another HTTPS API port. # Overwrite by env SRS_HTTP_API_LISTEN # Default: 1985 - listen 8080; + listen 8080; # whether enable crossdomain request. # Overwrite by env SRS_HTTP_API_CROSSDOMAIN # default: on - crossdomain on; + crossdomain on; # the HTTP RAW API is more powerful api to change srs state and reload. raw_api { # whether enable the HTTP RAW API. # Overwrite by env SRS_HTTP_API_RAW_API_ENABLED # default: off - enabled off; + enabled off; # whether enable rpc reload. # default: off - allow_reload off; + allow_reload off; # whether enable rpc query. # Overwrite by env SRS_HTTP_API_RAW_API_ALLOW_RELOAD # Always off by https://github.com/ossrs/srs/issues/2653 - #allow_query off; + #allow_query off; # whether enable rpc update. # Always off by https://github.com/ossrs/srs/issues/2653 - #allow_update off; + #allow_update off; } # For https_api or HTTPS API. https { @@ -229,23 +229,23 @@ http_server { # whether http streaming service is enabled. # Overwrite by env SRS_HTTP_SERVER_ENABLED # default: off - enabled on; + enabled on; # the http streaming listen entry is <[ip:]port> # for example, 192.168.1.100:8080 # where the ip is optional, default to 0.0.0.0, that is 8080 equals to 0.0.0.0:8080 # @remark, if use lower port, for instance 80, user must start srs by root. # Overwrite by env SRS_HTTP_SERVER_LISTEN # default: 8080 - listen 8080; + listen 8080; # the default dir for http root. # Overwrite by env SRS_HTTP_SERVER_DIR # default: ./objs/nginx/html - dir ./objs/nginx/html; + dir ./objs/nginx/html; # whether enable crossdomain request. # for both http static and stream server and apply on all vhosts. # Overwrite by env SRS_HTTP_SERVER_CROSSDOMAIN # default: on - crossdomain on; + crossdomain on; # For https_server or HTTPS Streaming. https { # Whether enable HTTPS Streaming. @@ -343,7 +343,7 @@ srt_server { vhost srt.vhost.srs.com { srt { # Overwrite by env SRS_VHOST_SRT_ENABLED for all vhosts. - enabled on; + enabled on; # Overwrite by env SRS_VHOST_SRT_TO_RTMP for all vhosts. srt_to_rtmp on; } @@ -704,7 +704,7 @@ tencentcloud_cls { # Whether CLS is enabled. # Overwrite by env SRS_TENCENTCLOUD_CLS_ENABLED # default: off - enabled off; + enabled off; # The logging label to category the cluster servers. # Overwrite by env SRS_TENCENTCLOUD_CLS_LABEL label cn-beijing; @@ -807,12 +807,12 @@ heartbeat { # whether heartbeat is enabled. # Overwrite by env SRS_HEARTBEAT_ENABLED # default: off - enabled off; + enabled off; # the interval seconds for heartbeat, # recommend 0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3,...,6,9,12,.... # Overwrite by env SRS_HEARTBEAT_INTERVAL # default: 9.9 - interval 9.3; + interval 9.3; # when startup, srs will heartbeat to this api. # @remark: must be a restful http api url, where SRS will POST with following data: # { @@ -821,7 +821,7 @@ heartbeat { # } # Overwrite by env SRS_HEARTBEAT_URL # default: http://127.0.0.1:8085/api/v1/servers - url http://127.0.0.1:8085/api/v1/servers; + url http://127.0.0.1:8085/api/v1/servers; # the id of device. # Overwrite by env SRS_HEARTBEAT_DEVICE_ID device_id "my-srs-device"; @@ -833,7 +833,7 @@ heartbeat { # @remark: optional config. # Overwrite by env SRS_HEARTBEAT_SUMMARIES # default: off - summaries off; + summaries off; } # system statistics section. @@ -845,14 +845,14 @@ heartbeat { stats { # Whether enable the stat of system resources. # Default: on - enabled on; + enabled on; # the index of device ip. # we may retrieve more than one network device. # default: 0 - network 0; + network 0; # the device name to stat the disk iops. # ignore the device of /proc/diskstats if not configured. - disk sda sdb xvda xvdb; + disk sda sdb xvda xvdb; } ############################################################################################# @@ -869,7 +869,7 @@ vhost scope.vhost.srs.com { # whether the vhost is enabled. # if off, all request access denied. # default: on - enabled off; + enabled off; # whether enable min delay mode for vhost. # for min latency mode: @@ -878,19 +878,19 @@ vhost scope.vhost.srs.com { # @see https://github.com/ossrs/srs/issues/257 # default: off (for RTMP/HTTP-FLV) # default: on (for WebRTC) - min_latency off; + min_latency off; # whether enable the TCP_NODELAY # if on, set the nodelay of fd by setsockopt # Overwrite by env SRS_VHOST_TCP_NODELAY for all vhosts. # default: off - tcp_nodelay off; + tcp_nodelay off; # the default chunk size is 128, max is 65536, # some client does not support chunk size change, # vhost chunk size will override the global value. # default: global chunk size. - chunk_size 128; + chunk_size 128; # The input ack size, 0 to not set. # Generally, it's set by the message from peer, @@ -898,24 +898,24 @@ vhost scope.vhost.srs.com { # We can chnage the default ack size in server-side, to send acknowledge message, # or the encoder maybe blocked after publishing for some time. # Default: 0 - in_ack_size 0; + in_ack_size 0; # The output ack size, 0 to not set. # This is used to notify the peer(player) to send acknowledge to server. # Default: 2500000 - out_ack_size 2500000; + out_ack_size 2500000; } # set the chunk size of vhost. vhost chunksize.srs.com { # @see scope.vhost.srs.com - chunk_size 128; + chunk_size 128; } # the vhost disabled. vhost removed.srs.com { # @see scope.vhost.srs.com - enabled off; + enabled off; } # vhost for stream cluster for RTMP/FLV @@ -926,13 +926,13 @@ vhost cluster.srs.com { # local: It's an origin server, serve streams itself. # remote: It's an edge server, fetch or push stream to origin server. # default: local - mode remote; + mode remote; # For edge(mode remote), user must specifies the origin server # format as: [:port] # @remark user can specifies multiple origin for error backup, by space, # for example, 192.168.1.100:1935 192.168.1.101:1935 192.168.1.102:1935 - origin 127.0.0.1:1935 localhost:1935; + origin 127.0.0.1:1935 localhost:1935; # For edge(mode remote), whether open the token traverse mode, # if token traverse on, all connections of edge will forward to origin to check(auth), @@ -940,13 +940,13 @@ vhost cluster.srs.com { # the better way is use http callback to do the token auth by the edge, # but if user prefer origin check(auth), the token_traverse if better solution. # default: off - token_traverse off; + token_traverse off; # For edge(mode remote), the vhost to transform for edge, # to fetch from the specified vhost at origin, # if not specified, use the current vhost of edge in origin, the variable [vhost]. # default: [vhost] - vhost same.edge.srs.com; + vhost same.edge.srs.com; # For edge(mode remote), when upnode(forward to, edge push to, edge pull from) is srs, # it's strongly recommend to open the debug_srs_upnode, @@ -954,19 +954,19 @@ vhost cluster.srs.com { # for example, the id, source id, pid. # please see https://ossrs.net/lts/zh-cn/docs/v4/doc/log # default: on - debug_srs_upnode on; + debug_srs_upnode on; # For origin(mode local) cluster, turn on the cluster. # @remark Origin cluster only supports RTMP, use Edge to transmux RTMP to FLV. # default: off # TODO: FIXME: Support reload. - origin_cluster off; + origin_cluster off; # For origin (mode local) cluster, the co-worker's HTTP APIs. # This origin will connect to co-workers and communicate with them. # please see https://ossrs.io/lts/en-us/docs/v4/doc/origin-cluster # TODO: FIXME: Support reload. - coworkers 127.0.0.1:9091 127.0.0.1:9092; + coworkers 127.0.0.1:9091 127.0.0.1:9092; # The protocol to connect to origin. # rtmp, Connect origin by RTMP @@ -986,9 +986,9 @@ vhost cluster.srs.com { vhost same.edge.srs.com { # @see cluster.srs.com cluster { - mode remote; - origin 127.0.0.1:1935 localhost:1935; - token_traverse off; + mode remote; + origin 127.0.0.1:1935 localhost:1935; + token_traverse off; } } @@ -996,9 +996,9 @@ vhost same.edge.srs.com { vhost transform.edge.srs.com { # @see cluster.srs.com cluster { - mode remote; - origin 127.0.0.1:1935; - vhost same.edge.srs.com; + mode remote; + origin 127.0.0.1:1935; + vhost same.edge.srs.com; } } @@ -1006,7 +1006,7 @@ vhost transform.edge.srs.com { vhost debug.srs.com { # @see cluster.srs.com cluster { - debug_srs_upnode on; + debug_srs_upnode on; } } @@ -1070,13 +1070,13 @@ vhost play.srs.com { # set to on if requires client fast startup. # Overwrite by env SRS_VHOST_PLAY_GOP_CACHE for all vhosts. # default: on - gop_cache off; + gop_cache off; # the max live queue length in seconds. # if the messages in the queue exceed the max length, # drop the old whole gop. # Overwrite by env SRS_VHOST_PLAY_QUEUE_LENGTH for all vhosts. # default: 30 - queue_length 10; + queue_length 10; # about the stream monotonically increasing: # 1. video timestamp is monotonically increasing, @@ -1092,7 +1092,7 @@ vhost play.srs.com { # @remark disabled when atc is on. # Overwrite by env SRS_VHOST_PLAY_TIME_JITTER for all vhosts. # default: full - time_jitter full; + time_jitter full; # vhost for atc for hls/hds/rtmp backup. # generally, atc default to off, server delivery rtmp stream to client(flash) timestamp from 0. # when atc is on, server delivery rtmp stream by absolute time. @@ -1107,14 +1107,14 @@ vhost play.srs.com { # @remark when atc is on, auto off the time_jitter # Overwrite by env SRS_VHOST_PLAY_ATC for all vhosts. # default: off - atc off; + atc off; # whether use the interleaved/mixed algorithm to correct the timestamp. # if on, always ensure the timestamp of audio+video is interleaved/mixed monotonically increase. # if off, use time_jitter to correct the timestamp if required. # @remark to use mix_correct, atc should on(or time_jitter should off). # Overwrite by env SRS_VHOST_PLAY_MIX_CORRECT for all vhosts. # default: off - mix_correct off; + mix_correct off; # whether enable the auto atc, # if enabled, detect the bravo_atc="true" in onMetaData packet, @@ -1122,7 +1122,7 @@ vhost play.srs.com { # always ignore the onMetaData if atc_auto is off. # Overwrite by env SRS_VHOST_PLAY_ATC_AUTO for all vhosts. # default: off - atc_auto off; + atc_auto off; # set the MW(merged-write) latency in ms. # SRS always set mw on, so we just set the latency value. @@ -1132,14 +1132,14 @@ vhost play.srs.com { # default: 350 (For RTMP/HTTP-FLV) # Overwrite by env SRS_VHOST_PLAY_MW_LATENCY for all vhosts. # default: 0 (For WebRTC) - mw_latency 350; + mw_latency 350; # Set the MW(merged-write) min messages. # default: 0 (For Real-Time, min_latency on) # default: 1 (For WebRTC, min_latency off) # default: 8 (For RTMP/HTTP-FLV, min_latency off). # Overwrite by env SRS_VHOST_PLAY_MW_MSGS for all vhosts. - mw_msgs 8; + mw_msgs 8; # the minimal packets send interval in ms, # used to control the ndiff of stream by srs_rtmp_dump, @@ -1150,13 +1150,13 @@ vhost play.srs.com { # @remark user can get the right packets interval in ms by srs_rtmp_dump. # Overwrite by env SRS_VHOST_PLAY_SEND_MIN_INTERVAL for all vhosts. # default: 0 - send_min_interval 10.0; + send_min_interval 10.0; # whether reduce the sequence header, # for some client which cannot got duplicated sequence header, # while the sequence header is not changed yet. # Overwrite by env SRS_VHOST_PLAY_REDUCE_SEQUENCE_HEADER for all vhosts. # default: off - reduce_sequence_header on; + reduce_sequence_header on; } } @@ -1168,16 +1168,16 @@ vhost jitter.srs.com { } # to use mix_correct. play { - time_jitter off; - mix_correct on; + time_jitter off; + mix_correct on; } play { - atc on; - mix_correct on; + atc on; + mix_correct on; } # to use atc play { - atc on; + atc on; } } @@ -1185,8 +1185,8 @@ vhost jitter.srs.com { vhost atc.srs.com { # @see play.srs.com play { - atc on; - atc_auto on; + atc on; + atc_auto on; } } @@ -1194,39 +1194,39 @@ vhost atc.srs.com { # the MW(merged-write) settings for player. vhost mrw.srs.com { # @see scope.vhost.srs.com - min_latency off; + min_latency off; # @see play.srs.com play { - mw_latency 350; - mw_msgs 8; + mw_latency 350; + mw_msgs 8; } # @see publish.srs.com publish { - mr on; - mr_latency 350; + mr on; + mr_latency 350; } } # the vhost for min delay, do not cache any stream. vhost min.delay.com { # @see scope.vhost.srs.com - min_latency on; + min_latency on; # @see scope.vhost.srs.com - tcp_nodelay on; + tcp_nodelay on; # @see play.srs.com play { - mw_latency 100; - mw_msgs 4; - gop_cache off; - queue_length 10; + mw_latency 100; + mw_msgs 4; + gop_cache off; + queue_length 10; } # @see publish.srs.com publish { - mr off; + mr off; } } @@ -1234,31 +1234,31 @@ vhost min.delay.com { vhost no.parse.sps.com { # @see publish.srs.com publish { - parse_sps on; + parse_sps on; } } # the vhost to control the stream delivery feature vhost stream.control.com { # @see scope.vhost.srs.com - min_latency on; + min_latency on; # @see scope.vhost.srs.com - tcp_nodelay on; + tcp_nodelay on; # @see play.srs.com play { - mw_latency 100; - mw_msgs 4; - queue_length 10; - send_min_interval 10.0; - reduce_sequence_header on; + mw_latency 100; + mw_msgs 4; + queue_length 10; + send_min_interval 10.0; + reduce_sequence_header on; } # @see publish.srs.com publish { - mr off; - firstpkt_timeout 20000; - normal_timeout 7000; + mr off; + firstpkt_timeout 20000; + normal_timeout 7000; } } @@ -1270,7 +1270,7 @@ vhost publish.srs.com { # when enabled the mr, SRS will read as large as possible. # Overwrite by env SRS_VHOST_PUBLISH_MR for all vhosts. # default: off - mr off; + mr off; # the latency in ms for MR(merged-read), # the performance+ when latency+, and memory+, # memory(buffer) = latency * kbps / 8 @@ -1281,23 +1281,23 @@ vhost publish.srs.com { # the recommended value is [300, 2000] # Overwrite by env SRS_VHOST_PUBLISH_MR_LATENCY for all vhosts. # default: 350 - mr_latency 350; + mr_latency 350; # the 1st packet timeout in ms for encoder. # Overwrite by env SRS_VHOST_PUBLISH_FIRSTPKT_TIMEOUT for all vhosts. # default: 20000 - firstpkt_timeout 20000; + firstpkt_timeout 20000; # the normal packet timeout in ms for encoder. # Overwrite by env SRS_VHOST_PUBLISH_NORMAL_TIMEOUT for all vhosts. # default: 5000 - normal_timeout 7000; + normal_timeout 7000; # whether parse the sps when publish stream. # we can got the resolution of video for stat api. # but we may failed to cause publish failed. # @remark If disabled, HLS might never update the sps/pps, it depends on this. # Overwrite by env SRS_VHOST_PUBLISH_PARSE_SPS for all vhosts. # default: on - parse_sps on; + parse_sps on; # When parsing SPS/PPS, whether try ANNEXB first. If not, try IBMF first, then ANNEXB. # Overwrite by env SRS_VHOST_PUBLISH_TRY_ANNEXB_FIRST for all vhosts. # default: on @@ -1311,22 +1311,22 @@ vhost refer.anti_suck.com { refer { # whether enable the refer hotlink-denial. # default: off. - enabled on; + enabled on; # the common refer for play and publish. # if the page url of client not in the refer, access denied. # if not specified this field, allow all. # default: not specified. - all github.com github.io; + all github.com github.io; # refer for publish clients specified. # the common refer is not overridden by this. # if not specified this field, allow all. # default: not specified. - publish github.com github.io; + publish github.com github.io; # refer for play clients specified. # the common refer is not overridden by this. # if not specified this field, allow all. # default: not specified. - play github.com github.io; + play github.com github.io; } } @@ -1337,7 +1337,7 @@ vhost security.srs.com { security { # whether enable the security for vhost. # default: off - enabled on; + enabled on; # the security list, each item format as: # allow|deny publish|play all| # for example: @@ -1358,8 +1358,8 @@ vhost security.srs.com { # 2. default to deny all when security enabled. # 3. allow if matches allow strategy. # 4. deny if matches deny strategy. - allow play all; - allow publish all; + allow play all; + allow publish all; } } @@ -1370,7 +1370,7 @@ vhost http.static.srs.com { # whether enabled the http static service for vhost. # Overwrite by env SRS_VHOST_HTTP_STATIC_ENABLED for all vhosts. # default: off - enabled on; + enabled on; # the url to mount to, # typical mount to [vhost]/ # the variables: @@ -1391,12 +1391,12 @@ vhost http.static.srs.com { # @remark the port of http is specified by http_server section. # Overwrite by env SRS_VHOST_HTTP_STATIC_MOUNT for all vhosts. # default: [vhost]/ - mount [vhost]/hls; + mount [vhost]/hls; # main dir of vhost, # to delivery HTTP stream of this vhost. # default: ./objs/nginx/html # Overwrite by env SRS_VHOST_HTTP_STATIC_DIR for all vhosts. - dir ./objs/nginx/html/hls; + dir ./objs/nginx/html/hls; } } @@ -1407,14 +1407,14 @@ vhost http.remux.srs.com { # whether enable the http live streaming service for vhost. # Overwrite by env SRS_VHOST_HTTP_REMUX_ENABLED for all vhosts. # default: off - enabled on; + enabled on; # the fast cache for audio stream(mp3/aac), # to cache more audio and send to client in a time to make android(weixin) happy. # @remark the flv/ts stream ignore it # @remark 0 to disable fast cache for http audio stream. # Overwrite by env SRS_VHOST_HTTP_REMUX_FAST_CACHE for all vhosts. # default: 0 - fast_cache 30; + fast_cache 30; # the stream mount for rtmp to remux to live streaming. # typical mount to [vhost]/[app]/[stream].flv # the variables: @@ -1442,7 +1442,7 @@ vhost http.remux.srs.com { # @remark the port of http is specified by http_server section. # Overwrite by env SRS_VHOST_HTTP_REMUX_MOUNT for all vhosts. # default: [vhost]/[app]/[stream].flv - mount [vhost]/[app]/[stream].flv; + mount [vhost]/[app]/[stream].flv; } } @@ -1451,7 +1451,7 @@ vhost hooks.callback.srs.com { http_hooks { # whether the http hooks enable. # default off. - enabled on; + enabled on; # when client(encoder) publish to vhost/app/stream, call the hook, # the request in the POST data string is a object encode by json: # { @@ -1468,7 +1468,7 @@ vhost hooks.callback.srs.com { # on_publish http://xxx/api0 http://xxx/api1 http://xxx/apiN # @remark For SRS4, the HTTPS url is supported, for example: # on_publish https://xxx/api0 https://xxx/api1 https://xxx/apiN - on_publish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams; + on_publish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams; # when client(encoder) stop publish to vhost/app/stream, call the hook, # the request in the POST data string is a object encode by json: # { @@ -1485,7 +1485,7 @@ vhost hooks.callback.srs.com { # on_unpublish http://xxx/api0 http://xxx/api1 http://xxx/apiN # @remark For SRS4, the HTTPS url is supported, for example: # on_unpublish https://xxx/api0 https://xxx/api1 https://xxx/apiN - on_unpublish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams; + on_unpublish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams; # when client start to play vhost/app/stream, call the hook, # the request in the POST data string is a object encode by json: # { @@ -1503,7 +1503,7 @@ vhost hooks.callback.srs.com { # on_play http://xxx/api0 http://xxx/api1 http://xxx/apiN # @remark For SRS4, the HTTPS url is supported, for example: # on_play https://xxx/api0 https://xxx/api1 https://xxx/apiN - on_play http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; + on_play http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; # when client stop to play vhost/app/stream, call the hook, # the request in the POST data string is a object encode by json: # { @@ -1520,7 +1520,7 @@ vhost hooks.callback.srs.com { # on_stop http://xxx/api0 http://xxx/api1 http://xxx/apiN # @remark For SRS4, the HTTPS url is supported, for example: # on_stop https://xxx/api0 https://xxx/api1 https://xxx/apiN - on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; + on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; # when srs reap a dvr file, call the hook, # the request in the POST data string is a object encode by json: # { @@ -1535,7 +1535,7 @@ vhost hooks.callback.srs.com { # if valid, the hook must return HTTP code 200(Status OK) and response # an int value specifies the error code(0 corresponding to success): # 0 - on_dvr http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs; + on_dvr http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs; # when srs reap a ts file of hls, call the hook, # the request in the POST data string is a object encode by json: # { @@ -1555,7 +1555,7 @@ vhost hooks.callback.srs.com { # if valid, the hook must return HTTP code 200(Status OK) and response # an int value specifies the error code(0 corresponding to success): # 0 - on_hls http://127.0.0.1:8085/api/v1/hls http://localhost:8085/api/v1/hls; + on_hls http://127.0.0.1:8085/api/v1/hls http://localhost:8085/api/v1/hls; # when srs reap a ts file of hls, call this hook, # used to push file to cdn network, by get the ts file from cdn network. # so we use HTTP GET and use the variable following: @@ -1566,7 +1566,7 @@ vhost hooks.callback.srs.com { # [ts_url], replace with the ts url. # ignore any return data of server. # @remark random select a url to report, not report all. - on_hls_notify http://127.0.0.1:8085/api/v1/hls/[server_id]/[app]/[stream]/[ts_url][param]; + on_hls_notify http://127.0.0.1:8085/api/v1/hls/[server_id]/[app]/[stream]/[ts_url][param]; } } @@ -1576,7 +1576,7 @@ vhost exec.srs.com { exec { # whether enable the exec. # default: off. - enabled off; + enabled off; # when publish stream, exec the process with variables: # [vhost] the input stream vhost. # [port] the input stream port. @@ -1599,7 +1599,7 @@ vhost exec.srs.com { # [timestamp],replace this const to current UNIX timestamp in ms. # @remark we use golang time format "2006-01-02 15:04:05.999" as "[2006]-[01]-[02]_[15].[04].[05]_[999]" # @remark empty to ignore this exec. - publish ./objs/ffmpeg/bin/ffmpeg -f flv -i [url] -c copy -y ./[stream].flv; + publish ./objs/ffmpeg/bin/ffmpeg -f flv -i [url] -c copy -y ./[stream].flv; } } @@ -1610,23 +1610,23 @@ vhost dash.srs.com { # Transmux RTMP to DASH if on. # Overwrite by env SRS_VHOST_DASH_ENABLED for all vhosts. # Default: off - enabled on; + enabled on; # The duration of segment in seconds. # Overwrite by env SRS_VHOST_DASH_DASH_FRAGMENT for all vhosts. # Default: 30 - dash_fragment 30; + dash_fragment 30; # The period to update the MPD in seconds. # Overwrite by env SRS_VHOST_DASH_DASH_UPDATE_PERIOD for all vhosts. # Default: 150 - dash_update_period 150; + dash_update_period 150; # The depth of timeshift buffer in seconds. # Overwrite by env SRS_VHOST_DASH_DASH_TIMESHIFT for all vhosts. # Default: 300 - dash_timeshift 300; + dash_timeshift 300; # The base/home dir/path for dash. # All init and segment files will write under this dir. # Overwrite by env SRS_VHOST_DASH_DASH_PATH for all vhosts. - dash_path ./objs/nginx/html; + dash_path ./objs/nginx/html; # The DASH MPD file path. # We supports some variables to generate the filename. # [vhost], the vhost of stream. @@ -1634,7 +1634,7 @@ vhost dash.srs.com { # [stream], the stream name of stream. # Overwrite by env SRS_VHOST_DASH_DASH_MPD_FILE for all vhosts. # Default: [app]/[stream].mpd - dash_mpd_file [app]/[stream].mpd; + dash_mpd_file [app]/[stream].mpd; } } @@ -1645,7 +1645,7 @@ vhost hls.srs.com { # if off, do not write hls(ts and m3u8) when publish. # Overwrite by env SRS_VHOST_HLS_ENABLED for all vhosts. # default: off - enabled on; + enabled on; # Whether enable hls_ctx for HLS streaming, for which we create a "fake" connection for HTTP API and callback. # For each HLS streaming session, we use a child m3u8 with a session identified by query "hls_ctx", it simply @@ -1670,25 +1670,25 @@ vhost hls.srs.com { # the hls fragment in seconds, the duration of a piece of ts. # default: 10 - hls_fragment 10; + hls_fragment 10; # the hls m3u8 target duration ratio, # EXT-X-TARGETDURATION = hls_td_ratio * hls_fragment // init # EXT-X-TARGETDURATION = max(ts_duration, EXT-X-TARGETDURATION) // for each ts # @see https://github.com/ossrs/srs/issues/304#issuecomment-74000081 # Overwrite by env SRS_VHOST_HLS_HLS_TD_RATIO for all vhosts. # default: 1.5 - hls_td_ratio 1.5; + hls_td_ratio 1.5; # the audio overflow ratio. # for pure audio, the duration to reap the segment. # for example, the hls_fragment is 10s, hls_aof_ratio is 2.0, # the segment will reap to 20s for pure audio. # Overwrite by env SRS_VHOST_HLS_HLS_AOF_RATIO for all vhosts. # default: 2.0 - hls_aof_ratio 2.0; + hls_aof_ratio 2.0; # the hls window in seconds, the number of ts in m3u8. # Overwrite by env SRS_VHOST_HLS_HLS_WINDOW for all vhosts. # default: 60 - hls_window 60; + hls_window 60; # the error strategy. can be: # ignore, disable the hls. # disconnect, require encoder republish. @@ -1696,7 +1696,7 @@ vhost hls.srs.com { # @see https://github.com/ossrs/srs/issues/264 # Overwrite by env SRS_VHOST_HLS_HLS_ON_ERROR for all vhosts. # default: continue - hls_on_error continue; + hls_on_error continue; # the hls output path. # the m3u8 file is configured by hls_path/hls_m3u8_file, the default is: # ./objs/nginx/html/[app]/[stream].m3u8 @@ -1705,7 +1705,7 @@ vhost hls.srs.com { # @remark the hls_path is compatible with srs v1 config. # Overwrite by env SRS_VHOST_HLS_HLS_PATH for all vhosts. # default: ./objs/nginx/html - hls_path ./objs/nginx/html; + hls_path ./objs/nginx/html; # the hls m3u8 file name. # we supports some variables to generate the filename. # [vhost], the vhost of stream. @@ -1713,7 +1713,7 @@ vhost hls.srs.com { # [stream], the stream name of stream. # Overwrite by env SRS_VHOST_HLS_HLS_M3U8_FILE for all vhosts. # default: [app]/[stream].m3u8 - hls_m3u8_file [app]/[stream].m3u8; + hls_m3u8_file [app]/[stream].m3u8; # the hls ts file name. # we supports some variables to generate the filename. # [vhost], the vhost of stream. @@ -1733,14 +1733,14 @@ vhost hls.srs.com { # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/delivery-hls#hls-config # Overwrite by env SRS_VHOST_HLS_HLS_TS_FILE for all vhosts. # default: [app]/[stream]-[seq].ts - hls_ts_file [app]/[stream]-[seq].ts; + hls_ts_file [app]/[stream]-[seq].ts; # whether use floor for the hls_ts_file path generation. # if on, use floor(timestamp/hls_fragment) as the variable [timestamp], # and use enhanced algorithm to calc deviation for segment. # @remark when floor on, recommend the hls_segment>=2*gop. # Overwrite by env SRS_VHOST_HLS_HLS_TS_FLOOR for all vhosts. # default: off - hls_ts_floor off; + hls_ts_floor off; # the hls entry prefix, which is base url of ts url. # for example, the prefix is: # http://your-server/ @@ -1758,7 +1758,7 @@ vhost hls.srs.com { # aac, mp3, an # Overwrite by env SRS_VHOST_HLS_HLS_ACODEC for all vhosts. # default: aac - hls_acodec aac; + hls_acodec aac; # the default video codec of hls. # when codec changed, write the PAT/PMT table, but maybe ok util next ts. # so user can set the default codec for pure audio(without video) to vn. @@ -1766,35 +1766,35 @@ vhost hls.srs.com { # h264, vn # Overwrite by env SRS_VHOST_HLS_HLS_VCODEC for all vhosts. # default: h264 - hls_vcodec h264; + hls_vcodec h264; # whether cleanup the old expired ts files. # Overwrite by env SRS_VHOST_HLS_HLS_CLEANUP for all vhosts. # default: on - hls_cleanup on; + hls_cleanup on; # If there is no incoming packets, dispose HLS in this timeout in seconds, # which removes all HLS files including m3u8 and ts files. # @remark 0 to disable dispose for publisher. # @remark apply for publisher timeout only, while "etc/init.d/srs stop" always dispose hls. # Overwrite by env SRS_VHOST_HLS_HLS_DISPOSE for all vhosts. # default: 0 - hls_dispose 0; + hls_dispose 0; # the max size to notify hls, # to read max bytes from ts of specified cdn network, # @remark only used when on_hls_notify is config. # Overwrite by env SRS_VHOST_HLS_HLS_NB_NOTIFY for all vhosts. # default: 64 - hls_nb_notify 64; + hls_nb_notify 64; # whether wait keyframe to reap segment, # if off, reap segment when duration exceed the fragment, # if on, reap segment when duration exceed and got keyframe. # Overwrite by env SRS_VHOST_HLS_HLS_WAIT_KEYFRAME for all vhosts. # default: on - hls_wait_keyframe on; + hls_wait_keyframe on; # whether using AES encryption. # Overwrite by env SRS_VHOST_HLS_HLS_KEYS for all vhosts. # default: off - hls_keys on; + hls_keys on; # the number of clear ts which one key can encrypt. # Overwrite by env SRS_VHOST_HLS_HLS_FRAGMENTS_PER_KEY for all vhosts. # default: 5 @@ -1806,16 +1806,16 @@ vhost hls.srs.com { # [stream], the stream name of stream. # [seq], the sequence number of key corresponding to the ts. # Overwrite by env SRS_VHOST_HLS_HLS_KEY_FILE for all vhosts. - hls_key_file [app]/[stream]-[seq].key; + hls_key_file [app]/[stream]-[seq].key; # the key output path. # the key file is configed by hls_path/hls_key_file, the default is: # ./objs/nginx/html/[app]/[stream]-[seq].key # Overwrite by env SRS_VHOST_HLS_HLS_KEY_FILE_PATH for all vhosts. - hls_key_file_path ./objs/nginx/html; + hls_key_file_path ./objs/nginx/html; # the key root URL, use this can support https. # @remark It's optional. # Overwrite by env SRS_VHOST_HLS_HLS_KEY_URL for all vhosts. - hls_key_url https://localhost:8080; + hls_key_url https://localhost:8080; # Special control controls. ########################################### @@ -1849,7 +1849,7 @@ vhost no-hls.srs.com { # whether the hls is enabled. # if off, do not write hls(ts and m3u8) when publish. # default: off - enabled off; + enabled off; } } @@ -1859,19 +1859,19 @@ vhost hds.srs.com { # whether hds enabled # Overwrite by env SRS_VHOST_HDS_ENABLED for all vhosts. # default: off - enabled on; + enabled on; # the hds fragment in seconds. # Overwrite by env SRS_VHOST_HDS_FRAGMENT for all vhosts. # default: 10 - hds_fragment 10; + hds_fragment 10; # the hds window in seconds, erase the segment when exceed the window. # Overwrite by env SRS_VHOST_HDS_HDS_WINDOW for all vhosts. # default: 60 - hds_window 60; + hds_window 60; # the path to store the hds files. # Overwrite by env SRS_VHOST_HDS_HDS_PATH for all vhosts. # default: ./objs/nginx/html - hds_path ./objs/nginx/html; + hds_path ./objs/nginx/html; } } @@ -1884,7 +1884,7 @@ vhost dvr.srs.com { # whether enabled dvr features # Overwrite by env SRS_VHOST_DVR_ENABLED for all vhosts. # default: off - enabled on; + enabled on; # the filter for dvr to apply to. # all, dvr all streams of all apps. # /, apply to specified stream of app. @@ -1892,14 +1892,14 @@ vhost dvr.srs.com { # live/stream1 live/stream2 # @remark Reload is disabled, @see https://github.com/ossrs/srs/issues/2181 # default: all - dvr_apply all; + dvr_apply all; # the dvr plan. canbe: # session reap flv/mp4 when session end(unpublish). # segment reap flv/mp4 when flv duration exceed the specified dvr_duration. # @remark The plan append is removed in SRS3+, for it's no use. # Overwrite by env SRS_VHOST_DVR_DVR_PLAN for all vhosts. # default: session - dvr_plan session; + dvr_plan session; # the dvr output path, *.flv or *.mp4. # we supports some variables to generate the filename. # [vhost], the vhost of stream. @@ -1940,13 +1940,13 @@ vhost dvr.srs.com { # segment,session apply it. # Overwrite by env SRS_VHOST_DVR_DVR_PATH for all vhosts. # default: ./objs/nginx/html/[app]/[stream].[timestamp].flv - dvr_path ./objs/nginx/html/[app]/[stream].[timestamp].flv; + dvr_path ./objs/nginx/html/[app]/[stream].[timestamp].flv; # the duration for dvr file, reap if exceed, in seconds. # segment apply it. # session,append ignore. # Overwrite by env SRS_VHOST_DVR_DVR_DURATION for all vhosts. # default: 30 - dvr_duration 30; + dvr_duration 30; # whether wait keyframe to reap segment, # if off, reap segment when duration exceed the dvr_duration, # if on, reap segment when duration exceed and got keyframe. @@ -1954,7 +1954,7 @@ vhost dvr.srs.com { # session,append ignore. # Overwrite by env SRS_VHOST_DVR_DVR_WAIT_KEYFRAME for all vhosts. # default: on - dvr_wait_keyframe on; + dvr_wait_keyframe on; # about the stream monotonically increasing: # 1. video timestamp is monotonically increasing, # 2. audio timestamp is monotonically increasing, @@ -1968,7 +1968,7 @@ vhost dvr.srs.com { # apply for all dvr plan. # Overwrite by env SRS_VHOST_DVR_TIME_JITTER for all vhosts. # default: full - time_jitter full; + time_jitter full; # on_dvr, never config in here, should config in http_hooks. # for the dvr http callback, @see http_hooks.on_dvr of vhost hooks.callback.srs.com @@ -1986,7 +1986,7 @@ vhost ingest.srs.com { ingest livestream { # whether enabled ingest features # default: off - enabled on; + enabled on; # input file/stream/device # @remark only support one input. input { @@ -1996,19 +1996,19 @@ vhost ingest.srs.com { # stream: ingest stream specified by url. # device: not support yet. # default: file - type file; + type file; # the url of file/stream. - url ./doc/source.200kbps.768x320.flv; + url ./doc/source.200kbps.768x320.flv; } # the ffmpeg - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; # the transcode engine, @see all.transcode.srs.com # @remark, the output is specified following. engine { # @see enabled of transcode engine. # if disabled or vcodec/acodec not specified, use copy. # default: off. - enabled off; + enabled off; # output stream. variables: # [vhost] current vhost which start the ingest. # [port] system RTMP stream port. @@ -2022,7 +2022,7 @@ vhost ingest.srs.com { # [999], replace this const to current millisecond. # [timestamp],replace this const to current UNIX timestamp in ms. # @remark we use golang time format "2006-01-02 15:04:05.999" as "[2006]-[01]-[02]_[15].[04].[05]_[999]" - output rtmp://127.0.0.1:[port]/live/livestream?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/live/livestream?vhost=[vhost]; } } } @@ -2030,47 +2030,47 @@ vhost ingest.srs.com { # the vhost for ingest with transcode engine. vhost transcode.ingest.srs.com { ingest livestream { - enabled on; + enabled on; input { - type file; - url ./doc/source.200kbps.768x320.flv; + type file; + url ./doc/source.200kbps.768x320.flv; } - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine { - enabled off; + enabled off; perfile { re; rtsp_transport tcp; } - iformat flv; + iformat flv; vfilter { - i ./doc/ffmpeg-logo.png; + i ./doc/ffmpeg-logo.png; filter_complex 'overlay=10:10'; } - vcodec libx264; - vbitrate 1500; - vfps 25; - vwidth 768; - vheight 320; - vthreads 12; - vprofile main; - vpreset medium; + vcodec libx264; + vbitrate 1500; + vfps 25; + vwidth 768; + vheight 320; + vthreads 12; + vprofile main; + vpreset medium; vparams { - t 100; - coder 1; - b_strategy 2; - bf 3; - refs 10; + t 100; + coder 1; + b_strategy 2; + bf 3; + refs 10; } - acodec libfdk_aac; - abitrate 70; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 70; + asample_rate 44100; + achannels 2; aparams { - profile:a aac_low; + profile:a aac_low; } - oformat flv; - output rtmp://127.0.0.1:[port]/[app]/[stream]?vhost=[vhost]; + oformat flv; + output rtmp://127.0.0.1:[port]/[app]/[stream]?vhost=[vhost]; } } } @@ -2083,9 +2083,9 @@ vhost example.transcode.srs.com { # whether the transcode enabled. # if off, donot transcode. # default: off. - enabled on; + enabled on; # the ffmpeg - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; # the transcode engine for matched stream. # all matched stream will transcoded to the following stream. # the transcode set name(ie. hd) is optional and not used. @@ -2102,7 +2102,7 @@ vhost example.transcode.srs.com { engine example { # whether the engine is enabled # default: off. - enabled on; + enabled on; # pre-file options, before "-i" perfile { re; @@ -2113,12 +2113,12 @@ vhost example.transcode.srs.com { # flv, for flv or RTMP stream. # other format, for example, mp4/aac whatever. # default: flv - iformat flv; + iformat flv; # ffmpeg filters, between "-i" and "-vcodec" # follows the main input. vfilter { # the logo input file. - i ./doc/ffmpeg-logo.png; + i ./doc/ffmpeg-logo.png; # the ffmpeg complex filter. # for filters, @see: http://ffmpeg.org/ffmpeg-filters.html filter_complex 'overlay=10:10'; @@ -2129,73 +2129,73 @@ vhost example.transcode.srs.com { # png: use png to snapshot thumbnail. # copy: donot encoder the video stream, copy it. # vn: disable video output. - vcodec libx264; + vcodec libx264; # video bitrate, in kbps, "ffmepg -b:v" # @remark 0 to use source video bitrate. # default: 0 - vbitrate 1500; + vbitrate 1500; # video framerate, "ffmepg -r" # @remark 0 to use source video fps. # default: 0 - vfps 25; + vfps 25; # video width, must be even numbers, "ffmepg -s" # @remark 0 to use source video width. # default: 0 - vwidth 768; + vwidth 768; # video height, must be even numbers, "ffmepg -s" # @remark 0 to use source video height. # default: 0 - vheight 320; + vheight 320; # the max threads for ffmpeg to used, "ffmepg -thread" # default: 1 - vthreads 12; + vthreads 12; # x264 profile, "ffmepg -profile:v" # @see x264 -help, can be: # high,main,baseline - vprofile main; + vprofile main; # x264 preset, "ffmpeg -preset" # @see x264 -help, can be: # ultrafast,superfast,veryfast,faster,fast # medium,slow,slower,veryslow,placebo - vpreset medium; + vpreset medium; # other x264 or ffmpeg video params, between "-preset" and "-acodec" vparams { # ffmpeg options, @see: http://ffmpeg.org/ffmpeg.html - t 100; + t 100; # 264 params, @see: http://ffmpeg.org/ffmpeg-codecs.html#libx264 - coder 1; - b_strategy 2; - bf 3; - refs 10; + coder 1; + b_strategy 2; + bf 3; + refs 10; } # audio encoder name, "ffmpeg -acodec" # can be: # libfdk_aac: use aac(libfdk_aac) audio encoder. # copy: donot encoder the audio stream, copy it. # an: disable audio output. - acodec libfdk_aac; + acodec libfdk_aac; # audio bitrate, in kbps, "ffmpeg -b:a" # [16, 72] for libfdk_aac. # @remark 0 to use source audio bitrate. # default: 0 - abitrate 70; + abitrate 70; # audio sample rate, "ffmpeg -ar" # for flv/rtmp, it must be: # 44100,22050,11025,5512 # @remark 0 to use source audio sample rate. # default: 0 - asample_rate 44100; + asample_rate 44100; # audio channel, "ffmpeg -ac" # 1 for mono, 2 for stereo. # @remark 0 to use source audio channels. # default: 0 - achannels 2; + achannels 2; # other ffmpeg audio params, between "-ac" and "-f"/"-y" aparams { # audio params, @see: http://ffmpeg.org/ffmpeg-codecs.html#Audio-Encoders # @remark SRS supported aac profile for HLS is: aac_low, aac_he, aac_he_v2 - profile:a aac_low; - bsf:a aac_adtstoasc; + profile:a aac_low; + bsf:a aac_adtstoasc; } # output format, "ffmpeg -f" can be: # off, do not specifies the format, ffmpeg will guess it. @@ -2203,7 +2203,7 @@ vhost example.transcode.srs.com { # image2, for vcodec png to snapshot thumbnail. # other format, for example, mp4/aac whatever. # default: flv - oformat flv; + oformat flv; # output stream, "ffmpeg -y", variables: # [vhost] the input stream vhost. # [port] the input stream port. @@ -2220,37 +2220,37 @@ vhost example.transcode.srs.com { # [999], replace this const to current millisecond. # [timestamp],replace this const to current UNIX timestamp in ms. # @remark we use golang time format "2006-01-02 15:04:05.999" as "[2006]-[01]-[02]_[15].[04].[05]_[999]" - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } # the mirror filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction vhost mirror.transcode.srs.com { transcode { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine mirror { - enabled on; + enabled on; vfilter { vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2'; } - vcodec libx264; - vbitrate 300; - vfps 20; - vwidth 768; - vheight 320; - vthreads 2; - vprofile baseline; - vpreset superfast; + vcodec libx264; + vbitrate 300; + vfps 20; + vwidth 768; + vheight 320; + vthreads 2; + vprofile baseline; + vpreset superfast; vparams { } - acodec libfdk_aac; - abitrate 45; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 45; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } @@ -2260,61 +2260,61 @@ vhost mirror.transcode.srs.com { # the crop filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#crop vhost crop.transcode.srs.com { transcode { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine crop { - enabled on; + enabled on; vfilter { vf 'crop=in_w-20:in_h-160:10:80'; } - vcodec libx264; - vbitrate 300; - vfps 20; - vwidth 768; - vheight 320; - vthreads 2; - vprofile baseline; - vpreset superfast; + vcodec libx264; + vbitrate 300; + vfps 20; + vwidth 768; + vheight 320; + vthreads 2; + vprofile baseline; + vpreset superfast; vparams { } - acodec libfdk_aac; - abitrate 45; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 45; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } # the logo filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#overlay vhost logo.transcode.srs.com { transcode { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine logo { - enabled on; + enabled on; vfilter { - i ./doc/ffmpeg-logo.png; + i ./doc/ffmpeg-logo.png; filter_complex 'overlay=10:10'; } - vcodec libx264; - vbitrate 300; - vfps 20; - vwidth 768; - vheight 320; - vthreads 2; - vprofile baseline; - vpreset superfast; + vcodec libx264; + vbitrate 300; + vfps 20; + vwidth 768; + vheight 320; + vthreads 2; + vprofile baseline; + vpreset superfast; vparams { } - acodec libfdk_aac; - abitrate 45; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 45; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } @@ -2323,18 +2323,18 @@ vhost logo.transcode.srs.com { # we can transcode the audio to aac and copy video to the new stream with HLS. vhost audio.transcode.srs.com { transcode { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine acodec { - enabled on; - vcodec copy; - acodec libfdk_aac; - abitrate 45; - asample_rate 44100; - achannels 2; + enabled on; + vcodec copy; + acodec libfdk_aac; + abitrate 45; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } @@ -2342,18 +2342,18 @@ vhost audio.transcode.srs.com { # for example, publish pure audio stream. vhost vn.transcode.srs.com { transcode { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine vn { - enabled on; - vcodec vn; - acodec libfdk_aac; - abitrate 45; - asample_rate 44100; - achannels 2; + enabled on; + vcodec vn; + acodec libfdk_aac; + abitrate 45; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } @@ -2361,13 +2361,13 @@ vhost vn.transcode.srs.com { # copy the video and audio to a new stream. vhost copy.transcode.srs.com { transcode { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine copy { - enabled on; - vcodec copy; - acodec copy; - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + enabled on; + vcodec copy; + acodec copy; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } @@ -2375,131 +2375,131 @@ vhost copy.transcode.srs.com { # the comments, read example.transcode.srs.com vhost all.transcode.srs.com { transcode { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine ffsuper { - enabled on; - iformat flv; + enabled on; + iformat flv; vfilter { - i ./doc/ffmpeg-logo.png; + i ./doc/ffmpeg-logo.png; filter_complex 'overlay=10:10'; } - vcodec libx264; - vbitrate 1500; - vfps 25; - vwidth 768; - vheight 320; - vthreads 12; - vprofile main; - vpreset medium; + vcodec libx264; + vbitrate 1500; + vfps 25; + vwidth 768; + vheight 320; + vthreads 12; + vprofile main; + vpreset medium; vparams { - t 100; - coder 1; - b_strategy 2; - bf 3; - refs 10; + t 100; + coder 1; + b_strategy 2; + bf 3; + refs 10; } - acodec libfdk_aac; - abitrate 70; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 70; + asample_rate 44100; + achannels 2; aparams { - profile:a aac_low; + profile:a aac_low; } - oformat flv; - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + oformat flv; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } engine ffhd { - enabled on; - vcodec libx264; - vbitrate 1200; - vfps 25; - vwidth 1382; - vheight 576; - vthreads 6; - vprofile main; - vpreset medium; + enabled on; + vcodec libx264; + vbitrate 1200; + vfps 25; + vwidth 1382; + vheight 576; + vthreads 6; + vprofile main; + vpreset medium; vparams { } - acodec libfdk_aac; - abitrate 70; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 70; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } engine ffsd { - enabled on; - vcodec libx264; - vbitrate 800; - vfps 25; - vwidth 1152; - vheight 480; - vthreads 4; - vprofile main; - vpreset fast; + enabled on; + vcodec libx264; + vbitrate 800; + vfps 25; + vwidth 1152; + vheight 480; + vthreads 4; + vprofile main; + vpreset fast; vparams { } - acodec libfdk_aac; - abitrate 60; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 60; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } engine fffast { - enabled on; - vcodec libx264; - vbitrate 300; - vfps 20; - vwidth 768; - vheight 320; - vthreads 2; - vprofile baseline; - vpreset superfast; + enabled on; + vcodec libx264; + vbitrate 300; + vfps 20; + vwidth 768; + vheight 320; + vthreads 2; + vprofile baseline; + vpreset superfast; vparams { } - acodec libfdk_aac; - abitrate 45; - asample_rate 44100; - achannels 2; + acodec libfdk_aac; + abitrate 45; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } engine vcopy { - enabled on; - vcodec copy; - acodec libfdk_aac; - abitrate 45; - asample_rate 44100; - achannels 2; + enabled on; + vcodec copy; + acodec libfdk_aac; + abitrate 45; + asample_rate 44100; + achannels 2; aparams { } - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } engine acopy { - enabled on; - vcodec libx264; - vbitrate 300; - vfps 20; - vwidth 768; - vheight 320; - vthreads 2; - vprofile baseline; - vpreset superfast; + enabled on; + vcodec libx264; + vbitrate 300; + vfps 20; + vwidth 768; + vheight 320; + vthreads 2; + vprofile baseline; + vpreset superfast; vparams { } - acodec copy; - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + acodec copy; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } engine copy { - enabled on; - vcodec copy; - acodec copy; - output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; + enabled on; + vcodec copy; + acodec copy; + output rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]; } } } @@ -2508,10 +2508,10 @@ vhost app.transcode.srs.com { # the streaming transcode configs. # if app specified, transcode all streams of app. transcode live { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine { - enabled off; + enabled off; } } } @@ -2520,10 +2520,10 @@ vhost stream.transcode.srs.com { # the streaming transcode configs. # if stream specified, transcode the matched stream. transcode live/livestream { - enabled on; - ffmpeg ./objs/ffmpeg/bin/ffmpeg; + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; engine { - enabled off; + enabled off; } } } @@ -2542,26 +2542,26 @@ include include.vhost.conf; # The origin cluster section ############################################################################################# http_api { - enabled on; - listen 9090; + enabled on; + listen 9090; } vhost a.origin.cluster.srs.com { cluster { - mode local; - origin_cluster on; - coworkers 127.0.0.1:9091; + mode local; + origin_cluster on; + coworkers 127.0.0.1:9091; } } http_api { - enabled on; - listen 9091; + enabled on; + listen 9091; } vhost b.origin.cluster.srs.com { cluster { - mode local; - origin_cluster on; - coworkers 127.0.0.1:9090; + mode local; + origin_cluster on; + coworkers 127.0.0.1:9090; } }