aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | avformat/utils: Use internal->avctx for bitrate in ↵Michael Niedermayer2016-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | estimate_timings_from_bit_rate() if needed The internal avctx bitrate is copied into codecpar after estimate_timings() Fixes Ticket5646 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: change bit_rate to 64 bit in estimate_timings_from_bit_rate()Michael Niedermayer2016-06-221-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: in debug mode, print number of streams found before ↵Aman Gupta2016-06-141-2/+2
| | | | | | | | | | | | avformat_find_stream_info() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/utils: fix timestamp trace log in estimate_timings() functionStefano Sabatini2016-06-141-4/+4
| | | | | | | | | | Use the correct timebase, also replace "stream" with "format" in the context of the format.
* | avformat/utils: Export coded dimensions unconditionallyMichael Niedermayer2016-06-131-2/+2
| | | | | | | | | | | | | | This fixes a API regression Probably fixes Ticket5451 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Do not overwrite, but use sample_fmt from contextMichael Niedermayer2016-06-091-0/+3
| | | | | | | | | | | | Fixes Ticket 3759 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Open decoder even if there are no packets if parameters are ↵Michael Niedermayer2016-06-091-2/+11
| | | | | | | | | | | | missing Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Initialize st in loopMichael Niedermayer2016-06-091-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: Copy properties from internal contextMichael Niedermayer2016-06-021-0/+3
| | | | | | | | | | | | | | Fixes Ticket5467 "Lossless j2k information no longer shown" Based on suggestion by Hendrik Leppkes Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: avoid overflow in compute_chapters_end() with huge durationsMichael Niedermayer2016-05-291-1/+1
| | | | | | | | | | | | | | Fixes: usan_granule_overflow Found-by: Thomas Guilbert <tguilbert@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: avoid overflow in update_stream_timings() with huge durationsMichael Niedermayer2016-05-291-1/+1
| | | | | | | | | | | | | | Fixes: usan_granule_overflow Found-by: Thomas Guilbert <tguilbert@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Fix use of uninitialized variableMichael Niedermayer2016-05-261-2/+1
| | | | | | | | | | | | Fixes CID1361961 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()Chris Cunningham2016-05-171-1/+1
| | | | | | | | | | | | Fixes: undefined shift. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Do not compute the bitrate from duration == 0Michael Niedermayer2016-05-161-1/+1
| | | | | | | | | | | | Fixes division by 0 in fate-acodec-ra144 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()Michael Niedermayer2016-05-111-0/+3
| | | | | | | | | | | | | | | | Fixes undefined shift Fixes: usan_shift Found-by: Thomas Guilbert <tguilbert@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: Do not detect video codecs when audio is expectedMichael Niedermayer2016-05-041-0/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf: use new decode APIwm42016-04-211-15/+15
| | | | | | | | | | | | | | From Libav commit 8bc4accc37ab047d2fd85d672c577b39dfc918e1, with additional code for decoding subtitles (not present in Libav). Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avformat/utils: Remove use of caps_internal as it is not public APIMichael Niedermayer2016-04-211-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: add AVFormatContext to ff_get_extradata()Paul B Mahol2016-04-141-2/+2
| | | | | | | | | | | | Needed for av_log() inside that function. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Revert "Merge commit '1ceb07eb313c2d51383408025e57a2fe50ccd164'"Derek Buitenhuis2016-04-131-3/+3
| | | | | | | | | | | | | | | | | | Broke a lot of stuff and didn't fix anything. This reverts commit 3c461eecd48ba2cf7616d98e6f99954de3ad4b06, reversing changes made to 884dd175f061c03d7ba4896685e81bf8adc3ea94. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '1ceb07eb313c2d51383408025e57a2fe50ccd164'Derek Buitenhuis2016-04-131-3/+3
|\| | | | | | | | | | | | | * commit '1ceb07eb313c2d51383408025e57a2fe50ccd164': avformat_find_stream_info: move duration guessing after updating codec parameters Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * 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