aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * avformat_find_stream_info: move duration guessing after updating codec ↵Anton Khirnov2016-03-041-2/+2
| | | | | | | | | | | | | | | | parameters This bitrate might not be known otherwise. Bug-Id: 926
* | avformat/utils: use av_codec_g/set_lowres()Michael Niedermayer2016-04-121-3/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-188/+427
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-231-91/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: use the io_open callbacks for files opened from open_input() as wellAnton Khirnov2016-02-221-2/+2
| | | | | | | | There is no real reason to treat them differently.
* | lavc/utils: Introduce ff_bprint_to_codecpar_extradata for avformatHendrik Leppkes2016-04-031-0/+23
| | | | | | | | | | | | | | | | It will be used by text subtitle demuxers to construct format instructions straight into extradata. They all currently a similar function that accepts an AVCodecContext instead. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | fix some a/an typosLou Logan2016-03-281-1/+1
| | | | | | | | Signed-off-by: Lou Logan <lou@lrcd.com>
* | avformat/utils: scan a bit farther for a keyframe in mpeg/mpegts (7 sec ↵Michael Niedermayer2016-03-211-0/+2
| | | | | | | | | | | | | | | | instead of 5, we already scan 90sec in some cases by default) Fixes Ticket5305 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: increase detected start_time with skip_samplesMarton Balint2016-03-201-2/+8
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/utils: Do not wait for more than 1 frame on attachmentsMichael Niedermayer2016-03-191-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/utils: Fix DTS for short H264 streams.Sasi Inguva2016-03-121-0/+13
| | | | | | | | | | | | | | Fill DTS if all packets have been read in avformat_find_stream_info, and still has_decode_delay_been_guessed returns false. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: factor update_dts_from_pts() outSasi Inguva2016-03-121-21/+43
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf: allow BSFs to drop packets.Ronald S. Bultje2016-03-111-0/+5
| | | | | | | | | | If pkt->size == 0 && pkt->side_data_elems == 0 after bsf->filter() returns, the packet is considered dropped.
* | avformat/utils: fix dts from pts code in compute_pkt_fields() during ↵Michael Niedermayer2016-03-081-2/+3
| | | | | | | | | | | | ascending delay Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: Add a protocol blacklisting APIDerek Buitenhuis2016-03-041-4/+15
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | lavf/utils: Normalize AVPacket.data to native endian in ff_get_packet_palette()Mats Peterson2016-03-041-7/+16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: add a function to standardize creation timeMarton Balint2016-03-031-0/+22
| | | | | | | | | | | | | | | | | | | | This can be used for formats which write all format metadata as string to files, therefore non-standard creation times such as 'now' will be parsed. The standardized creation time is UTC ISO 8601 with microsecond precision. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | lavf/utils: Add ff_get_packet_palette()Mats Peterson2016-03-021-0/+16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Be slightly more tolerant with fps vs. stream timebaseMichael Niedermayer2016-02-291-1/+2
| | | | | | | | | | | | Fixes regression with ticket2451 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | probe TrueHD in MPEGTSRodger Combs2016-02-271-0/+1
| |
* | avformat/dvbtxt: add raw demuxer for dvb teletext probingMarton Balint2016-02-191-0/+1
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/utils: remove ff_iso8601_to_unix_timeMarton Balint2016-02-141-12/+0
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/utils: add ff_parse_creation_time_metadataMarton Balint2016-02-141-0/+17
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-101-3/+12
|\| | | | | | | | | | | | | | | | | 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-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | avformat: add protocol_whitelistMichael Niedermayer2016-02-021-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Note to maintainers: update tools Note to maintainers: set a default whitelist for your protocol If that makes no sense then consider to set "none" and thus require the user to specify a white-list for sub-protocols to be opened Note, testing and checking for missing changes is needed Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Print the whitelists if entities are not found on themMichael Niedermayer2016-01-241-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: Add integer fps from 31 to 60 to get_std_framerate()Michael Niedermayer2016-01-091-3/+7
| | | | | | | | | | | | Fixes Ticket 5106 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: fix AVPacket lifetime in seek_frame_genericHendrik Leppkes2016-01-021-2/+5
| | | | | | | | Fixes ticket #5117
* | lavf: add internal API to append a bsf to a stream's listRodger Combs2015-12-281-0/+22
| |
* | lavf: add API to apply a list of bsfs to a packetRodger Combs2015-12-281-0/+49
| |
* | avformat: Add av_program_add_stream_index()Michael Niedermayer2015-12-111-1/+1
| | | | | | | | | | | | This will be used by the subsequent commit(s) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Fix "libavformat/utils.c:927:35: runtime error: signed ↵Michael Niedermayer2015-12-041-2/+2
| | | | | | | | | | | | | | | | | | integer overflow: -2450238577049583619 - 9223090561878065151 cannot be represented in type long long" Fixes Mozilla bug 1229205 Found-by: Tyson Smith Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf: add FFERROR_REDO to let demuxers return no packet.Nicolas George2015-12-031-0/+5
| |
* | avformat/utils: Move end_time1 AV_NOPTS_VALUE Check after rescaleMichael Niedermayer2015-12-031-5/+5
| | | | | | | | | | | | | | | | Fixes integer overflow Fixes: 266ee543812e934f7b4a72923a2701d4/signal_sigabrt_7ffff6ae7cc9_7322_85218d61759d461bdf7387180e8000c9.ogg Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Check AVFormatContext->duration in compute_chapters_end() ↵Michael Niedermayer2015-12-031-1/+4
| | | | | | | | | | | | | | | | | | | | before use Fixes integer overflow Fixes: 266ee543812e934f7b4a72923a2701d4/signal_sigabrt_7ffff6ae7cc9_7322_85218d61759d461bdf7387180e8000c9.ogg Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/utils: avoid decoding a frame to get the codec parametersMatthieu Bouron2015-11-261-0/+12
| | | | | | | | | | | | | | Avoid decoding a frame to get the codec parameters while the codec supports FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM. This is particulary useful to avoid decoding twice images (once in avformat_find_stream_info and once when the actual decode is made).
* | Merge commit '7f4ec4364bc4a73036660c1c6a3c4801db524e9e'Derek Buitenhuis2015-11-221-1/+1
|\| | | | | | | | | | | | | | | | | | | * commit '7f4ec4364bc4a73036660c1c6a3c4801db524e9e': avformat: expose av_stream_new_side_data helper Conflicts: libavformat/internal.h Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * avformat: expose av_stream_new_side_data helperJohn Stebbins2015-11-181-1/+1
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avformat/utils: Fix indentationTimothy Gu2015-11-201-1/+1
| |
* | avformat/utils: Do not init parser if probing is unfinishedMichael Niedermayer2015-11-151-1/+1
| | | | | | | | | | | | | | | | Fixes assertion failure Fixes: 136f8b8d47af7892306625e597dee655/signal_sigabrt_7ffff6ae7cc9_8941_ab11bea57c84796418f481f873dc31ba.dvr_ms Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: estimate_timings_from_pts - increase retry counter, fixes ↵Rainer Hochecker2015-11-151-1/+1
| | | | | | | | | | | | | | | | | | invalid duration for ts files with hevc codec Fixes a mpegts file with hevc that fails estimating duration. Increasing number of retries fixes the issue. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8'Hendrik Leppkes2015-11-111-0/+10
|\| | | | | | | | | | | | | * commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8': lavf: deprecate compute_pkt_fields2 Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: deprecate compute_pkt_fields2Anton Khirnov2015-11-091-0/+10
| | | | | | | | | | | | | | | | | | All encoders set pts and dts properly now (and have been doing that for a while), so there is no good reason to do any timestamp guessing in the muxer. The newly added AVStreamInternal will be later used for storing all the private fields currently living in AVStream.
* | avformat/utils: re-factor freeing AVStreamsHendrik Leppkes2015-11-111-7/+19
| | | | | | | | This matches the Libav signature and simplifies merging future changes.
* | Merge commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d'Hendrik Leppkes2015-11-101-5/+6
|\| | | | | | | | | | | | | * commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d': lavf: factor out freeing an AVStream Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: factor out freeing an AVStreamAnton Khirnov2015-11-081-25/+33
| | | | | | | | It will be needed in other functions.
* | Merge commit 'a0c71a575109f123978e345fa7eb4ac03cd4d3c3'Hendrik Leppkes2015-11-101-5/+7
|\| | | | | | | | | | | | | * commit 'a0c71a575109f123978e345fa7eb4ac03cd4d3c3': lavf: initialize cur_dts to AV_NOPTS_VALUE for muxing Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: initialize cur_dts to AV_NOPTS_VALUE for muxingAnton Khirnov2015-11-081-5/+7
| | | | | | | | The reasoning for setting it to zero only applies to demuxing.
* | avformat: unref packet after storing it in internal packet queueHendrik Leppkes2015-11-021-0/+1
| | | | | | | | Fixes a memory leak when using genpts