This prevents sub-muxers from trying to seek back to the beginning of the
whole stream, only to find themselves overwriting some video data in the
current (often last) segment.
We only do this when not writing individual header/trailers.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This permits some interesting segmenting techniques with formats like Matroska,
where you can concatenate the header and segments [N, nb_segments) and get
a working file that starts at segment N's start time.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
A failure in segment_end() or segment_start() would lead to freeing
a dangling pointer and in general further calls to seg_write_packet()
or to seg_write_trailer() would have the same faulty behaviour.
CC: libav-stable@libav.org
Reported-By: luodalongde@gmail.com
Allows expansion of the filename template with strftime() with the option
-strftime 1 (disabled by default). This allows segments to be named by time of
creation, adding some flexibility.
Fixes Ticket 4104 (add strftime to segment muxer)
Signed-off-by: Pedro E. M. Brito <pedroembrito@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This fixes the abnormally high ts overhead in the files produced by the
HLS and segments muxers. See https://trac.ffmpeg.org/ticket/2857 . For
example makes it much more likely that it can produces streams that fit
under the 64kb App store limit.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This avoids having to assign oformat, allows returning the
correct error code and allocates priv_data
Based on patch by: Mika Raento <mika.raento@elisa.fi>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Avoid negative durations in case there is a single packet in the current
segment, since in that case the end time is still set to the previous
segment end time.
Make the segment muxer keep segment_list_size segments instead of
segment_list_size + 1 segments. This patch also changes the
documentation for segment_list_size to reduce possible confusion over
how many segments are kept.
this allows the segment list to
be limited to containing only one segment which used to be impossible
because a segment_list_size of 0 kept all the segments and a
segment_list_size of 1 kept 2 segments.
Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
When using the wrap option the EXT-X-MEDIA-SEQUENCE header of the playlist file was reset instead of being incremented.
It is now incremented by one for every media URI removed from the playlist file as the standard states.
Signed-off-by: Willy Aubry <waubry@viotech.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
In particular, avoid to leave around the seg->avf pointer to freed
structure, and fix crash with:
ffmpeg -f lavfi -i testsrc -c:v h264 -map 0 -f segment foo-%d.ts
This option allows to add a prefix to the segment list entry filenames.
Also set by default the list entry filenames to the corresponding
segment basename, consistent with the HLS muxer.
Based on an idea by Steven Liu <lingjiujianke@gmail.com>.