mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add dvr, http heartbeat conf sample
This commit is contained in:
parent
32fc6a05c8
commit
6bc0ecece7
4 changed files with 186 additions and 149 deletions
13
trunk/conf/dvr.segment.conf
Normal file
13
trunk/conf/dvr.segment.conf
Normal file
|
@ -0,0 +1,13 @@
|
|||
# the config for srs to dvr in segment mode
|
||||
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/DVR
|
||||
# @see full.conf for detail config.
|
||||
|
||||
listen 1935;
|
||||
vhost __defaultVhost__ {
|
||||
dvr {
|
||||
enabled on;
|
||||
dvr_path ./objs/nginx/html;
|
||||
dvr_plan segment;
|
||||
dvr_duration 30;
|
||||
}
|
||||
}
|
12
trunk/conf/dvr.session.conf
Normal file
12
trunk/conf/dvr.session.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
# the config for srs to dvr in session mode
|
||||
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/DVR
|
||||
# @see full.conf for detail config.
|
||||
|
||||
listen 1935;
|
||||
vhost __defaultVhost__ {
|
||||
dvr {
|
||||
enabled on;
|
||||
dvr_path ./objs/nginx/html;
|
||||
dvr_plan session;
|
||||
}
|
||||
}
|
|
@ -228,61 +228,41 @@ vhost http.srs.com {
|
|||
}
|
||||
}
|
||||
|
||||
# vhost for atc.
|
||||
vhost atc.srs.com {
|
||||
# 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.
|
||||
# atc is used, for instance, encoder will copy stream to master and slave server,
|
||||
# server use atc to delivery stream to edge/client, where stream time from master/slave server
|
||||
# is always the same, client/tools can slice RTMP stream to HLS according to the same time,
|
||||
# if the time not the same, the HLS stream cannot slice to support system backup.
|
||||
#
|
||||
# @see http://www.adobe.com/cn/devnet/adobe-media-server/articles/varnish-sample-for-failover.html
|
||||
# @see http://www.baidu.com/#wd=hds%20hls%20atc
|
||||
#
|
||||
# the vhost with hls specified.
|
||||
vhost with-hls.srs.com {
|
||||
hls {
|
||||
# whether the hls is enabled.
|
||||
# if off, donot write hls(ts and m3u8) when publish.
|
||||
# default: off
|
||||
atc on;
|
||||
# whether enable the auto atc,
|
||||
# if enabled, detect the bravo_atc="true" in onMetaData packet,
|
||||
# set atc to on if matched.
|
||||
# always ignore the onMetaData if atc_auto is off.
|
||||
# default: on
|
||||
atc_auto on;
|
||||
}
|
||||
|
||||
# vhost for bandwidth check
|
||||
# generally, the bandcheck vhost must be: bandcheck.srs.com,
|
||||
# or need to modify the vhost of client.
|
||||
vhost bandcheck.srs.com {
|
||||
enabled on;
|
||||
chunk_size 65000;
|
||||
# bandwidth check config.
|
||||
bandcheck {
|
||||
# whether support bandwidth check,
|
||||
# default: off.
|
||||
enabled on;
|
||||
# the key for server to valid,
|
||||
# if invalid key, server disconnect and abort the bandwidth check.
|
||||
key "35c9b402c12a7246868752e2878f7e0e";
|
||||
# the interval in seconds for bandwidth check,
|
||||
# server donot allow new test request.
|
||||
# default: 30
|
||||
interval 30;
|
||||
# the max available check bandwidth in kbps.
|
||||
# to avoid attack of bandwidth check.
|
||||
# default: 1000
|
||||
limit_kbps 4000;
|
||||
# the hls output path.
|
||||
# the app dir is auto created under the hls_path.
|
||||
# for example, for rtmp stream:
|
||||
# rtmp://127.0.0.1/live/livestream
|
||||
# http://127.0.0.1/live/livestream.m3u8
|
||||
# where hls_path is /hls, srs will create the following files:
|
||||
# /hls/live the app dir for all streams.
|
||||
# /hls/live/livestream.m3u8 the HLS m3u8 file.
|
||||
# /hls/live/livestream-1.ts the HLS media/ts file.
|
||||
# in a word, the hls_path is for vhost.
|
||||
# default: ./objs/nginx/html
|
||||
hls_path ./objs/nginx/html;
|
||||
# the hls fragment in seconds, the duration of a piece of ts.
|
||||
# default: 10
|
||||
hls_fragment 10;
|
||||
# the hls window in seconds, the number of ts in m3u8.
|
||||
# default: 60
|
||||
hls_window 60;
|
||||
}
|
||||
}
|
||||
|
||||
# set the chunk size of vhost.
|
||||
vhost chunksize.srs.com {
|
||||
# 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;
|
||||
# the vhost with hls disabled.
|
||||
vhost no-hls.srs.com {
|
||||
hls {
|
||||
# whether the hls is enabled.
|
||||
# if off, donot write hls(ts and m3u8) when publish.
|
||||
# default: off
|
||||
enabled off;
|
||||
}
|
||||
}
|
||||
|
||||
# the http hook callback vhost, srs will invoke the hooks for specified events.
|
||||
|
@ -410,6 +390,67 @@ vhost hooks.callback.srs.com {
|
|||
}
|
||||
}
|
||||
|
||||
# the vhost for min delay, donot cache any stream.
|
||||
vhost min.delay.com {
|
||||
# whether cache the last gop.
|
||||
# if on, cache the last gop and dispatch to client,
|
||||
# to enabled fast startup for client, client play immediately.
|
||||
# if off, send the latest media data to client,
|
||||
# client need to wait for the next Iframe to decode and show the video.
|
||||
# set to off if requires min delay;
|
||||
# set to on if requires client fast startup.
|
||||
# default: on
|
||||
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.
|
||||
# default: 30
|
||||
queue_length 10;
|
||||
}
|
||||
|
||||
# the vhost for antisuck.
|
||||
vhost refer.anti_suck.com {
|
||||
# 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.
|
||||
refer github.com github.io;
|
||||
# refer for publish clients specified.
|
||||
# the common refer is not overrided by this.
|
||||
# if not specified this field, allow all.
|
||||
# default: not specified.
|
||||
refer_publish github.com github.io;
|
||||
# refer for play clients specified.
|
||||
# the common refer is not overrided by this.
|
||||
# if not specified this field, allow all.
|
||||
# default: not specified.
|
||||
refer_play github.com github.io;
|
||||
}
|
||||
|
||||
# the vhost which forward publish streams.
|
||||
vhost same.vhost.forward.srs.com {
|
||||
# forward all publish stream to the specified server.
|
||||
# this used to split/forward the current stream for cluster active-standby,
|
||||
# active-active for cdn to build high available fault tolerance system.
|
||||
# format: {ip}:{port} {ip_N}:{port_N}
|
||||
# or specify the vhost by params, @see: change.vhost.forward.srs.com
|
||||
# if vhost not specified, use the request vhost instead.
|
||||
forward 127.0.0.1:1936 127.0.0.1:1937;
|
||||
}
|
||||
# TODO: FIXME: support extra params.
|
||||
# [plan] the vhost which forward publish streams to other vhosts.
|
||||
vhost change.vhost.forward.srs.com {
|
||||
forward 127.0.0.1:1936 127.0.0.1:1937 {
|
||||
# specify the vhost to override the vhost in client request.
|
||||
vhost forward2.srs.com;
|
||||
# specify the refer(pageUrl) to override the refer in client request.
|
||||
refer http://srs/index.html;
|
||||
}
|
||||
forward 127.0.0.1:1938 {
|
||||
vhost forward3.srs.com;
|
||||
}
|
||||
}
|
||||
|
||||
# the mirror filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction
|
||||
vhost mirror.transcode.srs.com {
|
||||
transcode {
|
||||
|
@ -812,28 +853,61 @@ vhost stream.transcode.srs.com {
|
|||
}
|
||||
}
|
||||
|
||||
# the vhost which forward publish streams.
|
||||
vhost same.vhost.forward.srs.com {
|
||||
# forward all publish stream to the specified server.
|
||||
# this used to split/forward the current stream for cluster active-standby,
|
||||
# active-active for cdn to build high available fault tolerance system.
|
||||
# format: {ip}:{port} {ip_N}:{port_N}
|
||||
# or specify the vhost by params, @see: change.vhost.forward.srs.com
|
||||
# if vhost not specified, use the request vhost instead.
|
||||
forward 127.0.0.1:1936 127.0.0.1:1937;
|
||||
# vhost for bandwidth check
|
||||
# generally, the bandcheck vhost must be: bandcheck.srs.com,
|
||||
# or need to modify the vhost of client.
|
||||
vhost bandcheck.srs.com {
|
||||
enabled on;
|
||||
chunk_size 65000;
|
||||
# bandwidth check config.
|
||||
bandcheck {
|
||||
# whether support bandwidth check,
|
||||
# default: off.
|
||||
enabled on;
|
||||
# the key for server to valid,
|
||||
# if invalid key, server disconnect and abort the bandwidth check.
|
||||
key "35c9b402c12a7246868752e2878f7e0e";
|
||||
# the interval in seconds for bandwidth check,
|
||||
# server donot allow new test request.
|
||||
# default: 30
|
||||
interval 30;
|
||||
# the max available check bandwidth in kbps.
|
||||
# to avoid attack of bandwidth check.
|
||||
# default: 1000
|
||||
limit_kbps 4000;
|
||||
}
|
||||
# TODO: FIXME: support extra params.
|
||||
# [plan] the vhost which forward publish streams to other vhosts.
|
||||
vhost change.vhost.forward.srs.com {
|
||||
forward 127.0.0.1:1936 127.0.0.1:1937 {
|
||||
# specify the vhost to override the vhost in client request.
|
||||
vhost forward2.srs.com;
|
||||
# specify the refer(pageUrl) to override the refer in client request.
|
||||
refer http://srs/index.html;
|
||||
}
|
||||
forward 127.0.0.1:1938 {
|
||||
vhost forward3.srs.com;
|
||||
|
||||
# set the chunk size of vhost.
|
||||
vhost chunksize.srs.com {
|
||||
# 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;
|
||||
}
|
||||
|
||||
# vhost for atc.
|
||||
vhost atc.srs.com {
|
||||
# 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.
|
||||
# atc is used, for instance, encoder will copy stream to master and slave server,
|
||||
# server use atc to delivery stream to edge/client, where stream time from master/slave server
|
||||
# is always the same, client/tools can slice RTMP stream to HLS according to the same time,
|
||||
# if the time not the same, the HLS stream cannot slice to support system backup.
|
||||
#
|
||||
# @see http://www.adobe.com/cn/devnet/adobe-media-server/articles/varnish-sample-for-failover.html
|
||||
# @see http://www.baidu.com/#wd=hds%20hls%20atc
|
||||
#
|
||||
# default: off
|
||||
atc on;
|
||||
# whether enable the auto atc,
|
||||
# if enabled, detect the bravo_atc="true" in onMetaData packet,
|
||||
# set atc to on if matched.
|
||||
# always ignore the onMetaData if atc_auto is off.
|
||||
# default: on
|
||||
atc_auto on;
|
||||
}
|
||||
|
||||
# the vhost disabled.
|
||||
|
@ -844,80 +918,6 @@ vhost removed.srs.com {
|
|||
enabled off;
|
||||
}
|
||||
|
||||
# the vhost with hls specified.
|
||||
vhost with-hls.srs.com {
|
||||
hls {
|
||||
# whether the hls is enabled.
|
||||
# if off, donot write hls(ts and m3u8) when publish.
|
||||
# default: off
|
||||
enabled on;
|
||||
# the hls output path.
|
||||
# the app dir is auto created under the hls_path.
|
||||
# for example, for rtmp stream:
|
||||
# rtmp://127.0.0.1/live/livestream
|
||||
# http://127.0.0.1/live/livestream.m3u8
|
||||
# where hls_path is /hls, srs will create the following files:
|
||||
# /hls/live the app dir for all streams.
|
||||
# /hls/live/livestream.m3u8 the HLS m3u8 file.
|
||||
# /hls/live/livestream-1.ts the HLS media/ts file.
|
||||
# in a word, the hls_path is for vhost.
|
||||
# default: ./objs/nginx/html
|
||||
hls_path ./objs/nginx/html;
|
||||
# the hls fragment in seconds, the duration of a piece of ts.
|
||||
# default: 10
|
||||
hls_fragment 10;
|
||||
# the hls window in seconds, the number of ts in m3u8.
|
||||
# default: 60
|
||||
hls_window 60;
|
||||
}
|
||||
}
|
||||
# the vhost with hls disabled.
|
||||
vhost no-hls.srs.com {
|
||||
hls {
|
||||
# whether the hls is enabled.
|
||||
# if off, donot write hls(ts and m3u8) when publish.
|
||||
# default: off
|
||||
enabled off;
|
||||
}
|
||||
}
|
||||
|
||||
# the vhost for min delay, donot cache any stream.
|
||||
vhost min.delay.com {
|
||||
# whether cache the last gop.
|
||||
# if on, cache the last gop and dispatch to client,
|
||||
# to enabled fast startup for client, client play immediately.
|
||||
# if off, send the latest media data to client,
|
||||
# client need to wait for the next Iframe to decode and show the video.
|
||||
# set to off if requires min delay;
|
||||
# set to on if requires client fast startup.
|
||||
# default: on
|
||||
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.
|
||||
# default: 30
|
||||
queue_length 10;
|
||||
}
|
||||
|
||||
# the vhost for antisuck.
|
||||
vhost refer.anti_suck.com {
|
||||
# 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.
|
||||
refer github.com github.io;
|
||||
# refer for publish clients specified.
|
||||
# the common refer is not overrided by this.
|
||||
# if not specified this field, allow all.
|
||||
# default: not specified.
|
||||
refer_publish github.com github.io;
|
||||
# refer for play clients specified.
|
||||
# the common refer is not overrided by this.
|
||||
# if not specified this field, allow all.
|
||||
# default: not specified.
|
||||
refer_play github.com github.io;
|
||||
}
|
||||
|
||||
# config for the pithy print,
|
||||
# which always print constant message specified by interval,
|
||||
# whatever the clients in concurrency.
|
||||
|
|
12
trunk/conf/http.heartbeat.conf
Normal file
12
trunk/conf/http.heartbeat.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
# the config for srs http heartbeat, report its info to api-server
|
||||
# @see full.conf for detail config.
|
||||
|
||||
listen 1935;
|
||||
heartbeat {
|
||||
enabled on;
|
||||
interval 9.3;
|
||||
url http://127.0.0.1:8085/api/v1/servers;
|
||||
device_id "my-srs-device";
|
||||
}
|
||||
vhost __defaultVhost__ {
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue