1
0
Fork 0
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:
winlin 2014-05-22 17:13:57 +08:00
parent 32fc6a05c8
commit 6bc0ecece7
4 changed files with 186 additions and 149 deletions

View 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;
}
}

View 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;
}
}

View file

@ -146,7 +146,7 @@ vhost dvr.srs.com {
dvr { dvr {
# whether enabled dvr features # whether enabled dvr features
# default: off # default: off
enabled on; enabled on;
# the dvr output path. # the dvr output path.
# the app dir is auto created under the dvr_path. # the app dir is auto created under the dvr_path.
# for example, for rtmp stream: # for example, for rtmp stream:
@ -158,7 +158,7 @@ vhost dvr.srs.com {
# @remark, the time use system timestamp in ms, user can use http callback to rename it. # @remark, the time use system timestamp in ms, user can use http callback to rename it.
# in a word, the dvr_path is for vhost. # in a word, the dvr_path is for vhost.
# default: ./objs/nginx/html # default: ./objs/nginx/html
dvr_path ./objs/nginx/html; dvr_path ./objs/nginx/html;
# the dvr plan. canbe: # the dvr plan. canbe:
# session reap flv when session end(unpublish). # session reap flv when session end(unpublish).
# segment reap flv when flv duration exceed the specified dvr_duration. # segment reap flv when flv duration exceed the specified dvr_duration.
@ -228,61 +228,41 @@ vhost http.srs.com {
} }
} }
# vhost for atc. # the vhost with hls specified.
vhost atc.srs.com { vhost with-hls.srs.com {
# vhost for atc for hls/hds/rtmp backup. hls {
# generally, atc default to off, server delivery rtmp stream to client(flash) timestamp from 0. # whether the hls is enabled.
# when atc is on, server delivery rtmp stream by absolute time. # if off, donot write hls(ts and m3u8) when publish.
# atc is used, for instance, encoder will copy stream to master and slave server, # default: off
# 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;
}
# 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; enabled on;
# the key for server to valid, # the hls output path.
# if invalid key, server disconnect and abort the bandwidth check. # the app dir is auto created under the hls_path.
key "35c9b402c12a7246868752e2878f7e0e"; # for example, for rtmp stream:
# the interval in seconds for bandwidth check, # rtmp://127.0.0.1/live/livestream
# server donot allow new test request. # http://127.0.0.1/live/livestream.m3u8
# default: 30 # where hls_path is /hls, srs will create the following files:
interval 30; # /hls/live the app dir for all streams.
# the max available check bandwidth in kbps. # /hls/live/livestream.m3u8 the HLS m3u8 file.
# to avoid attack of bandwidth check. # /hls/live/livestream-1.ts the HLS media/ts file.
# default: 1000 # in a word, the hls_path is for vhost.
limit_kbps 4000; # 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.
# set the chunk size of vhost. vhost no-hls.srs.com {
vhost chunksize.srs.com { hls {
# the default chunk size is 128, max is 65536, # whether the hls is enabled.
# some client does not support chunk size change, # if off, donot write hls(ts and m3u8) when publish.
# vhost chunk size will override the global value. # default: off
# default: global chunk size. enabled off;
chunk_size 128; }
} }
# the http hook callback vhost, srs will invoke the hooks for specified events. # 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 # the mirror filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction
vhost mirror.transcode.srs.com { vhost mirror.transcode.srs.com {
transcode { transcode {
@ -812,28 +853,61 @@ vhost stream.transcode.srs.com {
} }
} }
# the vhost which forward publish streams. # vhost for bandwidth check
vhost same.vhost.forward.srs.com { # generally, the bandcheck vhost must be: bandcheck.srs.com,
# forward all publish stream to the specified server. # or need to modify the vhost of client.
# this used to split/forward the current stream for cluster active-standby, vhost bandcheck.srs.com {
# active-active for cdn to build high available fault tolerance system. enabled on;
# format: {ip}:{port} {ip_N}:{port_N} chunk_size 65000;
# or specify the vhost by params, @see: change.vhost.forward.srs.com # bandwidth check config.
# if vhost not specified, use the request vhost instead. bandcheck {
forward 127.0.0.1:1936 127.0.0.1:1937; # 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. # set the chunk size of vhost.
vhost change.vhost.forward.srs.com { vhost chunksize.srs.com {
forward 127.0.0.1:1936 127.0.0.1:1937 { # the default chunk size is 128, max is 65536,
# specify the vhost to override the vhost in client request. # some client does not support chunk size change,
vhost forward2.srs.com; # vhost chunk size will override the global value.
# specify the refer(pageUrl) to override the refer in client request. # default: global chunk size.
refer http://srs/index.html; chunk_size 128;
} }
forward 127.0.0.1:1938 {
vhost forward3.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
#
# 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. # the vhost disabled.
@ -844,80 +918,6 @@ vhost removed.srs.com {
enabled off; 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, # config for the pithy print,
# which always print constant message specified by interval, # which always print constant message specified by interval,
# whatever the clients in concurrency. # whatever the clients in concurrency.

View 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__ {
}