Adds a `-hls_flags +temp_file` which will write segment data to
filename.tmp, and then rename to filename when the segment is complete.
This patch is similar in spirit to one used in Plex's ffmpeg fork, and
allows a transcoding webserver to ensure incomplete segment files are
never served up accidentally.
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
{"hls_subtitle_path","set path of hls subtitles",OFFSET(subtitle_filename),AV_OPT_TYPE_STRING,{.str=NULL},0,0,E},
{"hls_flags","set flags affecting HLS playlist and media file generation",OFFSET(flags),AV_OPT_TYPE_FLAGS,{.i64=0},0,UINT_MAX,E,"flags"},
{"single_file","generate a single media file indexed with byte ranges",0,AV_OPT_TYPE_CONST,{.i64=HLS_SINGLE_FILE},0,UINT_MAX,E,"flags"},
{"temp_file","write segment to temporary file and rename when complete",0,AV_OPT_TYPE_CONST,{.i64=HLS_TEMP_FILE},0,UINT_MAX,E,"flags"},
{"delete_segments","delete segment files that are no longer part of the playlist",0,AV_OPT_TYPE_CONST,{.i64=HLS_DELETE_SEGMENTS},0,UINT_MAX,E,"flags"},
{"round_durations","round durations in m3u8 to whole numbers",0,AV_OPT_TYPE_CONST,{.i64=HLS_ROUND_DURATIONS},0,UINT_MAX,E,"flags"},
{"discont_start","start the playlist with a discontinuity tag",0,AV_OPT_TYPE_CONST,{.i64=HLS_DISCONT_START},0,UINT_MAX,E,"flags"},