summaryrefslogtreecommitdiff
path: root/libavformat/segment.c
Commit message (Collapse)AuthorAge
* avformat/segment: remove last_cut check when detecting a new segmentMarton Balint2017-02-04
| | | | | | | | | Not starting a new segment if the elapsed microsecs since the start of the day equals the the elapsed microsecs since the start of the day at the time of the last cut seems plain wrong to me, Deti do you remember the original reason behind this check? Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/segment: fix crash when failing to open segment listRodger Combs2017-01-23
| | | | | | | | | | | | | | | This happens because segment_end() returns an error, so seg_write_packet never proceeds to segment_start(), and seg->avf->pb is never re-set, so we crash with a null pb when av_write_trailer flushes the packet queue. This doesn't seem to be clearly recoverable, so I'm just failing more gracefully. Repro: ffmpeg -i input.ts -f segment -c copy -segment_list /noaxx.m3u8 test-%05d.ts (assuming you don't have write access to /)
* lavf/segment: fix autobsfRodger Combs2016-11-02
|
* lavf/segment: fix writing separate header with auto BSFRodger Combs2016-10-24
|
* lavf/segment: add deinit functionRodger Combs2016-10-24
|
* lavf/segment: decide whether to rename based on list URIRodger Combs2016-10-21
| | | | | This fixes the case of writing segments to local files, but the list over a network protocol.
* avformat/segment: give a warning message for remove initial_offset optionSteven Liu2016-09-09
| | | | | | | ffmpeg have a generic solution working with all muxer named output_ts_offset, output_ts_offset will instead of initial_offset Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segment: remove the check_bitstream from segmentSteven Liu2016-07-14
| | | | | | | | because the BSF logic was re-factored into a shareable function and both av_write_frame and av_interleaved_write_frame use it it Signed-off-by: LiuQi <liuqi@gosun.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: update auto-bsf to new BSF APIRodger Combs2016-06-25
|
* avformat/segment: Pass flags to child contextMichael Niedermayer2016-04-11
| | | | | | This is needed as the bitexact flag is not in the codecpar context, and thus not copied Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | lavf/segment: add option to write empty filler segments as neededRodger Combs2016-04-02
| |
* | lavf/segment: slight refactor to seg_write_packetRodger Combs2016-04-02
| | | | | | | | | | This reduces some code duplication, and ensures that cur_entry.last_duration is always set.
* | lavf/segment: style nitRodger Combs2016-04-02
| |
* | lavf/segment: support automatic bitstream filteringRodger Combs2016-04-02
| | | | | | | | | | Most useful for MPEG-TS. Works by having the underlying muxer configure the bitstream filters, then moving them to our own AVStreams.
* | avformat/segment: set format options for all segmentsMarton Balint2016-03-26
| | | | | | | | | | | | | | Fixes ticket #5318. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/segment: Fix "occured" typoMichael Niedermayer2016-03-17
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/segment: change type of increment_tc to BOOLStefano Sabatini2016-03-15
| |
* | lavf/segment: add increment_tc optionMartin Vignali2016-03-15
| | | | | | | | | | | | | | | | | | For example you can split a file, keeping a continuous timecode between each segment: ffmpeg -i src.mov -timecode 10:00:00:00 -vcodec copy -f segment \ -segment_time 2 -reset_timestamps 1 -increment_tc 1 target_%03d.mov Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
* | avformat/segment: Fix header_filename handlingMichael Niedermayer2016-02-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-10
|\| | | | | | | | | | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* | Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-02
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/segment: add new option segment_clocktime_wrap_durationMarton Balint2016-01-28
| | | | | | | | | | | | | | | | | | | | This option can force the segmenter to only start a new segment if a packet reaches the muxer within the specified duration after the segmenting clock time, which makes it more resilient to backward local time jumps, such as leap seconds or transition to standard time from daylight savings time. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | lavf/segment: add support for specifying clock time offsetMarton Balint2016-01-28
| | | | | | | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/segment: Fix memory leak of cur_entry.filenameLvqier2015-12-12
| | | | | | | | | | Solution suggested-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | avformat/segment: atomically update list if possibleMichael Niedermayer2015-08-28
| | | | | | | | | | | | Fixes Ticket4802 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/segment: Do not free the filename twiceMichael Niedermayer2015-08-26
| | | | | | | | | | | | Bug introduced in 83a508cda5115c61b456aeb227bf770d61010961 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/segment: Fix memleak.Carl Eugen Hoyos2015-08-25
| | | | | | | | | | Reviewed-by: Stefano Sabatini Reviewed-by: Ganesh Ajjanagadde
* | Replace av_dlog with ff_dlog.Ronald S. Bultje2015-08-18
| | | | | | | | | | ff_dlog checks compilability, and is non-public. av_dlog is deprecated and no longer exists if FF_API_DLOG=0.
* | Merge commit '8a78ae2d2101622fd244b99178d8bc61175c878e'Michael Niedermayer2015-06-12
|\| | | | | | | | | | | | | * commit '8a78ae2d2101622fd244b99178d8bc61175c878e': segment: Check open_null_ctx() return value Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * segment: Check open_null_ctx() return valueVittorio Giovara2015-06-12
| | | | | | | | Reported-By: infer
* | lavf/segment: add an option to allow breaking on non-keyframesRodger Combs2015-06-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/segment: Change enum to int, which is accessed via AVOption as intMichael Niedermayer2015-04-07
| | | | | | | | | | | | This fixes depending on implementation defined behavior Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/segment: style nitsRodger Combs2015-03-31
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/segment: Mark output contexts as non-seekable when applicableRodger Combs2015-03-29
| | | | | | | | | | | | | | | | | | | | 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>
* | libavformat/segment: add an option to write the header to a separate fileRodger Combs2015-03-29
| | | | | | | | | | | | | | | | 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>
* | libavformat/segment: don't leave the list pb open when not in useRodger Combs2015-03-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e': avformat: Don't anonymously typedef structs Conflicts: libavformat/adtsenc.c libavformat/aiffenc.c libavformat/avidec.c libavformat/gif.c libavformat/iff.c libavformat/img2dec.c libavformat/jvdec.c libavformat/matroskadec.c libavformat/udp.c libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
| * segment: Check av_get_frame_filename() return valueVittorio Giovara2015-01-23
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1265713
* | avformat/segment: Clear contexts after deallocationMichael Niedermayer2015-01-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b3f04657368a32a9903406395f865e230b1de348'Michael Niedermayer2015-01-07
|\| | | | | | | | | | | | | | | | | | | * commit 'b3f04657368a32a9903406395f865e230b1de348': segment: Fix the failure paths Conflicts: libavformat/segment.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * segment: Fix the failure pathsLuca Barbato2015-01-07
| | | | | | | | | | | | | | | | | | 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
* | libavformat/segment.c: Add strftime expansion for segment filename templatesPedro E. M. Brito2014-12-28
| | | | | | | | | | | | | | | | | | | | | | 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>
* | avformat/segment: Use av_freep() avoid leaving stale pointers in memoryMichael Niedermayer2014-12-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/segment: export inner muxer timebaseMichael Niedermayer2014-11-16
| | | | | | | | | | | | | | Fixes "Non-monotonous DTS in output stream 0:0" Fixes Ticket4020 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/segment: use time_internal.h, simplify codeMichael Niedermayer2014-11-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>