summaryrefslogtreecommitdiff
path: root/libavformat/segment.c
Commit message (Collapse)AuthorAge
* avformat/segment: fix muxing tmcd tracks in MOVGyan Doshi2019-06-20
| | | | | | avformat/movenc still relies on AVCodecContext time_base to mux tmcd tracks and segment muxer did not copy that field to inner streams leading to SIGFPE in the child muxer instance.
* avformat/segment: fix increment_tcGyan Doshi2019-06-18
| | | | | | inner stream avg_frame_rate wasn't populated, so tc formation failed. Also, extended increment_tc to cover individual stream timecode.
* avformat/segment: populate empty outer stream extradata from packetGyan Doshi2019-05-28
| | | | | | | | | | | | | | At present, if the outer stream extradata is empty but first packet has extradata as a side data element, then only the first segment's muxer instance may be able to extract this side data and use it. For all other segments, extradata in packet side data could be missing and generated segments may be invalid or unplayable in some apps e.g. for an ADTS AAC stream segmented to MP4, the adtstoasc BSF will add extradata to the first packet. The MOV muxer for the first segment will add this to codecpar for the inner stream and write Decoder Specific Information within the esds box. For other segments, their esds' will not have this decSpecificInfo and they can't be opened in Quicktime player or by services like nginx-vod-module.
* lavf: Constify AVOutputFormat pointer.Carl Eugen Hoyos2019-03-20
|
* avformat/segment: fix segment_time_delta option min/max valueMarton Balint2018-10-07
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: fix stream_segment muxer build dependenciesJames Almer2018-02-07
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* Fix several typosLou Logan2017-09-21
| | | | | | | "apix_fmts" found by Marc Péchaud. "speedloss" found by Mikhail V. Signed-off-by: Lou Logan <lou@lrcd.com>
* Use the new AVIOContext destructor.Anton Khirnov2017-09-01
| | | | | (cherry picked from commit 6f554521afdf7ab4edbfaa9536660a1dca946b19) Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove obsolete commented-out DEBUG defineTobias Rapp2017-07-07
| | | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* 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>