summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
Commit message (Collapse)AuthorAge
* lavf: update muxing doxyAnton Khirnov2016-05-23
| | | | Describe the new AVCodecParameters API.
* movenc: Use packets in interleaving queues for the duration at the end of ↵Martin Storsjö2016-05-18
| | | | | | | | | | | | | | fragments As long as caller only writes packets using av_interleaved_write_frame with no manual flushing, this should allow us to always have accurate durations at the end of fragments, since there should be at least one queued packet in each stream (except for the stream where the current packet is being written, but if the muxer itself does the cutting of fragments, it also has info about the next packet for that stream). Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* libavformat: Update the comment about AVOutputFormat flagsMartin Storsjö2016-04-21
| | | | | | Add a flag which applies here, which had been missed. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc: introduce a new decoding/encoding API with decoupled input/outputwm42016-03-23
| | | | | | | | | | | | | | | | Until now, the decoding API was restricted to outputting 0 or 1 frames per input packet. It also enforces a somewhat rigid dataflow in general. This new API seeks to relax these restrictions by decoupling input and output. Instead of doing a single call on each decode step, which may consume the packet and may produce output, the new API requires the user to send input first, and then ask for output. For now, there are no codecs supporting this API. The API can work with codecs using the old API, and most code added here is to make them interoperate. The reverse is not possible, although for audio it might. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* 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: add a protocol whitelist/blacklist for file opened internallyAnton Khirnov2016-02-22
| | | | | | | | Should make the default behaviour safer for careless callers that open random untrusted files. Bug-Id: CVE-2016-1897 Bug-Id: CVE-2016-1898
* lavf: use the io_open callbacks for files opened from open_input() as wellAnton Khirnov2016-02-22
| | | | There is no real reason to treat them differently.
* cosmetics: Drop empty comment linesDiego Biurrun2016-02-18
|
* 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.
* avformat: expose av_stream_new_side_data helperJohn Stebbins2015-11-18
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: document that passing valid timestamps to muxers is now mandatoryAnton Khirnov2015-11-18
| | | | Also, extend the documentation about setting timestamps.
* lavf: deprecate compute_pkt_fields2Anton Khirnov2015-11-09
| | | | | | | | | 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.
* avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* avformat: Do not use AVFMT_RAWPICTURELuca Barbato2015-10-13
| | | | | There are no formats supporting it anymore and it is deprecated. Update the documentation accordingly.
* lavf: Document the codec context initializationVittorio Giovara2015-02-17
| | | | | | During remuxing avcodec_copy_context() is discouraged as certain fields (such as codec_tag) could reflect invalid values between input and output contextes.
* lavf: move internal fields from public to internal contextwm42015-02-10
| | | | | | | This is not an API change; the fields were explicitly declared private before. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* libavformat: Remove a misleading/incorrect commentMartin Storsjö2015-01-04
| | | | | | | | This comment can be traced back to the initial commit from 2001, and it seemed to be misleading/incorect already back then. (It was used for normal, non-raw file formats already then.) Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Add an option for avoiding negative timestampsMichael Niedermayer2014-11-07
| | | | | | | | | | | This is the same logic as is invoked on AVFMT_TS_NEGATIVE, but which can be enabled manually, or can be enabled in muxers which only need it in certain conditions. Also allow using the same mechanism to force streams to start at 0. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat: use const char* instead of uint8_t* for AVProbeData.mime_typeAndreas Cadhalpun2014-10-08
| | | | | | | This makes the field consistent with AVInputFormat.mime_type and the argument type of av_match_name. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavf: add AVFormatContext.max_ts_probeAnton Khirnov2014-08-25
| | | | | It allows to configure how long will avformat_find_stream_info() wait to get the first timestamp.
* lavf: add AVFormatContext/AVStream fields for signaling to the user when ↵Andrew Stone2014-08-13
| | | | | | | | | | | events happen. The only flags, for now, indicate if metadata was updated and are set after each call to av_read_frame(). This comes with the caveat that, on stream start, it might not be set properly as packets might be buffered in AVFormatContext.packet_buffer before being given to the user in av_read_frame(). Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Remove obsolete FF_API_REFERENCE_DTS cruft.Anton Khirnov2014-08-09
|
* Remove obsolete FF_API_PROBE_MIME cruft.Anton Khirnov2014-08-09
|
* avformat: Use the mime type information in input probeLuca Barbato2014-07-29
| | | | | It should provide a quicker guess for elementary streams provided by http.
* avformat: Mark AVOutputFormat argument in avformat_query_codec as constDiego Biurrun2014-07-26
|
* avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next as constDiego Biurrun2014-07-26
|
* avformat: update muxing doxyAnton Khirnov2014-07-09
| | | | The callers should now set the stream timebase, not the codec one.
* avformat_new_stream: make the AVCodec parameter constRoman Savchenko2014-07-08
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: document av_dump_format()Vittorio Giovara2014-07-02
|
* lavf: switch to AVStream.time_base as the hint for the muxer timebaseAnton Khirnov2014-06-18
| | | | | | | | | | | | Previously, AVStream.codec.time_base was used for that purpose, which was quite confusing for the callers. This change also opens the path for removing AVStream.codec. The change in the lavf-mkv test is due to the native timebase (1/1000) being used instead of the default one (1/90000), so the packets are now sent to the crc muxer in the same order in which they are demuxed (previously some of them got reordered because of inexact timestamp conversion).
* avformat: Provide a standard compliance flagLuca Barbato2014-05-28
| | | | | | Provide f_strict for avconv usage. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lavf: add av_stream_get_side_dataJanne Grunau2014-05-20
|
* lavf: deprecate now unused AVStream.ptsAnton Khirnov2014-05-19
|
* lavf: extend avg_frame_rate documentation.Anton Khirnov2014-05-18
|
* lavf: add AVFMT_FLAG_BITEXACT.Anton Khirnov2014-05-15
| | | | | | | | Use it instead of checking CODEC_FLAG_BITEXACT in the first stream's codec context. Using codec options inside lavf is fragile and can easily break when the muxing codec context is not the encoding context.
* lavf: properly document the distinction between flags and ctx_flagsAnton Khirnov2014-05-14
|
* lavf: add an AVStream field for exporting stream-global side dataAnton Khirnov2014-03-24
|
* doxygen: Replace @parblock syntax with manual linebreaksDiego Biurrun2014-02-17
| | | | @parblock is only supported in very recent Doxygen versions.
* doxygen: Add a number of missing function parameter descriptionsDiego Biurrun2014-02-17
|
* lavf: always unref the packet passed to av_interleaved_write_frame() on errorAnton Khirnov2014-02-10
|
* lavf: extend / improve the AVFormatContext doxyAnton Khirnov2014-02-10
|
* lavf: add some basic documentation of the muxing processAnton Khirnov2014-02-10
|
* lavf: rewrite the av_write_frame() doxyAnton Khirnov2014-02-10
| | | | | Remove some vague / incorrect statements and make the text more specific and less confusing.
* lavf: rewrite the av_interleaved_write_frame() doxyAnton Khirnov2014-02-10
| | | | | Remove some vague / incorrect statements and make the text more specific and less confusing.
* lavf: improve handling of sparse streams when muxingLuca Barbato2014-02-04
| | | | | | | | | | | | | | | | | | Currently ff_interleave_packet_per_dts() waits until it gets a frame for each stream before outputting packets in interleaved order. Sparse streams (i.e. streams with much fewer packets than the other streams, like subtitles or audio with DTX) tend to add up latency and in specific cases end up allocating a large amount of memory. Emit the top packet from the packet_buffer if it has a time delta larger than a specified threshold. Original report of the issue and initial proposed solution by mus.svz@gmail.com. Bug-id: 31 Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: ignore attachment streams for interleaving purposesAnton Khirnov2014-02-04
| | | | Those streams should never get any packets by definition.
* lavc: add a dummy field to AVStream to preserve ABI compatibility for avconvAnton Khirnov2013-10-29
| | | | | | | | avconv abuses the API by accessing AVStream.parser (which is private). Removing AVStream.reference_dts in 2ba68dd044ca8fc591139c05563840f546a9c0c0 breaks ABI compatibility for an old avconv using a newer lavf. Fix this by adding a dummy field until the next bump.
* lavf: remove unreliable timestamp guessing heuristicAnton Khirnov2013-10-28
|
* lavf: Add a flag to enable/disable per-packet flushingLuca Barbato2013-09-16
| | | | | | | | | This is enabled by default and can be disabled with "-fflags -flush_packets". Inspired by a patch from Nicolas George <nicolas.george@normalesup.org>. Signed-off-by: Martin Storsjö <martin@martin.st>