1st:
This patch makes it possible to put actual segment file size (measured
in bytes) and/or duration (calculated in microseconds) into segment
filenames. This feature is useful when post-processing live streaming
access log files. New behaviour works only when -use_localtime option
is set and second_level_segment_size or/and
second_level_segment_duration new hls_flags are specified. %%s is the
placeholder for size and %%t for duration in hls_segment_filename
option. Fix sized trailing zeropadding also works eg. %%09s or %%023t.
A command to test new features:
./ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f
lavfi -i sine=f=440:b=4:r=44100 -c:v mpeg2video -g 25 -acodec aac
-cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size
5 -hls_flags
second_level_segment_index+second_level_segment_size+second_level_segment_duration
-use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename
"segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8
2nd:
doc/muxers: beside second_level_segment_duration and second_level_segment_size,
added some more details and example to hls_segment_filename,
use_localtime, use_localtime_mkdir, hls_flags. hls_flags option list
reformatted to table
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
{"second_level_segment_index","include segment index in segment filenames when use_localtime",0,AV_OPT_TYPE_CONST,{.i64=HLS_SECOND_LEVEL_SEGMENT_INDEX},0,UINT_MAX,E,"flags"},
{"second_level_segment_index","include segment index in segment filenames when use_localtime",0,AV_OPT_TYPE_CONST,{.i64=HLS_SECOND_LEVEL_SEGMENT_INDEX},0,UINT_MAX,E,"flags"},
{"second_level_segment_duration","include segment duration in segment filenames when use_localtime",0,AV_OPT_TYPE_CONST,{.i64=HLS_SECOND_LEVEL_SEGMENT_DURATION},0,UINT_MAX,E,"flags"},
{"second_level_segment_size","include segment size in segment filenames when use_localtime",0,AV_OPT_TYPE_CONST,{.i64=HLS_SECOND_LEVEL_SEGMENT_SIZE},0,UINT_MAX,E,"flags"},
{"use_localtime","set filename expansion with strftime at segment creation",OFFSET(use_localtime),AV_OPT_TYPE_BOOL,{.i64=0},0,1,E},
{"use_localtime","set filename expansion with strftime at segment creation",OFFSET(use_localtime),AV_OPT_TYPE_BOOL,{.i64=0},0,1,E},
{"use_localtime_mkdir","create last directory component in strftime-generated filename",OFFSET(use_localtime_mkdir),AV_OPT_TYPE_BOOL,{.i64=0},0,1,E},
{"use_localtime_mkdir","create last directory component in strftime-generated filename",OFFSET(use_localtime_mkdir),AV_OPT_TYPE_BOOL,{.i64=0},0,1,E},
{"hls_playlist_type","set the HLS playlist type",OFFSET(pl_type),AV_OPT_TYPE_INT,{.i64=PLAYLIST_TYPE_NONE},0,PLAYLIST_TYPE_NB-1,E,"pl_type"},
{"hls_playlist_type","set the HLS playlist type",OFFSET(pl_type),AV_OPT_TYPE_INT,{.i64=PLAYLIST_TYPE_NONE},0,PLAYLIST_TYPE_NB-1,E,"pl_type"},