mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #179: dvr support custom filepath by variables. 2.0.87
This commit is contained in:
parent
f89941254a
commit
f881bc43b5
10 changed files with 215 additions and 27 deletions
16
trunk/conf/dvr.path.conf
Normal file
16
trunk/conf/dvr.path.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
# the config for srs to dvr in custom path.
|
||||
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/v2_CN_DVR#custom-path
|
||||
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/v2_EN_DVR#custom-path
|
||||
# @see full.conf for detail config.
|
||||
|
||||
listen 1935;
|
||||
max_connections 1000;
|
||||
vhost __defaultVhost__ {
|
||||
dvr {
|
||||
enabled on;
|
||||
dvr_path ./objs/nginx/html/[app]/[stream]/[2006]/[01]/[02]/[15].[04].[05].[999].flv;
|
||||
dvr_plan segment;
|
||||
dvr_duration 30;
|
||||
dvr_wait_keyframe on;
|
||||
}
|
||||
}
|
41
trunk/conf/full.conf
Normal file → Executable file
41
trunk/conf/full.conf
Normal file → Executable file
|
@ -236,15 +236,38 @@ vhost dvr.srs.com {
|
|||
# default: off
|
||||
enabled on;
|
||||
# the dvr output path.
|
||||
# the app dir is auto created under the dvr_path.
|
||||
# for example, for rtmp stream:
|
||||
# rtmp://127.0.0.1/live/livestream
|
||||
# http://127.0.0.1/live/livestream.m3u8
|
||||
# where dvr_path is /dvr, srs will create the following files:
|
||||
# /dvr/live the app dir for all streams.
|
||||
# /dvr/live/livestream.{time}.flv the dvr flv file.
|
||||
# @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.
|
||||
# we supports some variables to generate the filename.
|
||||
# [vhost], the vhost of stream.
|
||||
# [app], the app of stream.
|
||||
# [stream], the stream name of stream.
|
||||
# [2006], replace this const to current year.
|
||||
# [01], replace this const to current month.
|
||||
# [02], replace this const to current date.
|
||||
# [15], replace this const to current hour.
|
||||
# [04], repleace this const to current minute.
|
||||
# [05], repleace this const to current second.
|
||||
# [999], repleace 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"
|
||||
# for example, for url rtmp://ossrs.net/live/livestream and time 2015-01-03 10:57:30.776
|
||||
# 1. No variables, the rule of SRS1.0(auto add [stream].[timestamp].flv as filename):
|
||||
# dvr_path ./objs/nginx/html;
|
||||
# =>
|
||||
# dvr_path ./objs/nginx/html/live/livestream.1420254068776.flv;
|
||||
# 2. Use stream and date as dir name, time as filename:
|
||||
# dvr_path /data/[vhost]/[app]/[stream]/[2006]/[01]/[02]/[15].[04].[05].[999].flv;
|
||||
# =>
|
||||
# dvr_path /data/ossrs.net/live/livestream/2015/01/03/10.57.30.776.flv;
|
||||
# 3. Use stream and year/month as dir name, date and time as filename:
|
||||
# dvr_path /data/[vhost]/[app]/[stream]/[2006]/[01]/[02]-[15].[04].[05].[999].flv;
|
||||
# =>
|
||||
# dvr_path /data/ossrs.net/live/livestream/2015/01/03-10.57.30.776.flv;
|
||||
# 4. Use vhost/app and year/month as dir name, stream/date/time as filename:
|
||||
# dvr_path /data/[vhost]/[app]/[2006]/[01]/[stream]-[02]-[15].[04].[05].[999].flv;
|
||||
# =>
|
||||
# dvr_path /data/ossrs.net/live/2015/01/livestream-03-10.57.30.776.flv;
|
||||
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/v2_CN_DVR#custom-path
|
||||
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/v2_EN_DVR#custom-path
|
||||
# default: ./objs/nginx/html
|
||||
dvr_path ./objs/nginx/html;
|
||||
# the dvr plan. canbe:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue