From 606eac7b07133b0904c2b8b4eb1dc70e1bd0c9a6 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Tue, 7 Feb 2017 11:58:43 +0800 Subject: avformat/hlsenc: add hls_flag option to write segments to temporary file until complete 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 Reviewed-by: Bodecs Bela Signed-off-by: Aman Gupta Signed-off-by: Steven Liu --- doc/muxers.texi | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/muxers.texi') diff --git a/doc/muxers.texi b/doc/muxers.texi index d07ae9ba19..cb875a4636 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -656,6 +656,11 @@ Makes it possible to use segment duration (calculated in microseconds) as %%t i expression besides date/time values when use_localtime is on. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width. +@item temp_file +Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver +serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments +before they have been added to the m3u8 playlist. + @example ffmpeg -i sample.mpeg \ -f hls -hls_time 3 -hls_list_size 5 \ -- cgit v1.2.3