aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avformat.h
Commit message (Collapse)AuthorAgeFilesLines
* all: fix typos found by codespellTimo Rothenpieler30 hours1-4/+4
|
* doc: use av_dict_iterate in documentation exampleMarvin Scholz2025-06-111-2/+2
|
* avformat/format: make experimental flag works for muxerZhao Zhili2025-06-071-2/+1
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/avformat: Remove outdated io_close2 documentationAndreas Rheinhardt2025-05-211-4/+0
| | | | | | | The io_close callback has been removed in d6799ee0e41dee35ebf9c664173aed8e3ab24141. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: remove deprecated FF_API_GET_DUR_ESTIMATE_METHODJames Almer2025-03-281-11/+0
| | | | | | Deprecated since 2024-03-06. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_AVSTREAM_SIDE_DATAJames Almer2025-03-281-103/+0
| | | | | | Deprecated since 2023-10-06. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_ALLOW_FLUSHJames Almer2025-03-281-3/+0
| | | | | | Deprecated since 2023-10-02. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_LAVF_SHORTESTJames Almer2025-03-281-3/+0
| | | | | | Deprecated since 2023-09-18. Signed-off-by: James Almer <jamrial@gmail.com>
* Make mime-type award a bonus probe scorePeter Zebühr2025-02-261-1/+1
| | | | | | | | | | | | | | | | This changes the default behaviour of ffmpeg where content-type headers on an input gives an absolut probe score (of 75) to instead give a bonus score (of 30). This gives the probe a better chance to arrive at the correct format by (hopefully) giving a large enough bonus to push edge cases in the right direction (MPEG-PS vs MP3, I am looking at you) while also not adversly punishing clearer cases (raw ADTS marked as "audio/mpeg" for example). This patch was regression tested against 20 million recent podcast submissions (after content-type propagation was added to original-storage), and 50k Juno vodcasts submissions (dito). No adverse effects observed (but the bonus may still need tweaking if other edge cases are detected in production).
* avformat/avformat.h: elaborate documentation for avformat_open_input() on ↵Marth642025-01-081-2/+3
| | | | | | error condition Signed-off-by: Marth64 <marth64@proxyid.net>
* lavf: deprecate av_format_inject_global_side_data()Anton Khirnov2024-10-161-0/+8
| | | | | | | | This function would otherwise fail to build on the next major bump, as inject_global_side_data is marked for removal. It should also never be needed, as there is now a mechanism for supplying global side data to decoders directly.
* avformat/avformat: add side data to AVStreamGroupTileGridJames Almer2024-09-301-0/+13
| | | | | | | Will be used to export certain information present in HEIF samples, like rotation metadata, ICC profiles, and potentially others. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: add an LCEVC stream groupJames Almer2024-09-191-0/+27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavf: deprecate avformat_transfer_internal_stream_timing_info()Anton Khirnov2024-07-091-11/+7
| | | | | | | | | And av_stream_get_codec_timebase(). They were both added for ffmpeg CLI, which no longer calls either of them. Furthermore the notion of "internal stream timing info" that needs to be transferred with a special magic API function is fundamentally flawed and should be removed.
* avformat: Add a new stream disposition for multilayer videoDerek Buitenhuis2024-07-071-0/+5
| | | | | | | This lets us detect when a container has flagged a stream as multilayer. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/demux: add duration_probesize AVOptionNicolas Gaullier2024-04-021-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | Yet another probesize used to get the durations when estimate_timings_from_pts is required. It is aimed at users interested in better durations probing for itself, or because using avformat_find_stream_info indirectly and requiring exact values: for concatdec for example, especially if streamcopying above it. The current code is a performance trade-off that can fail to get video stream durations in a scenario with high bitrates and buffering for files ending cleanly (as opposed to live captures): the physical gap between the last video packet and the last audio packet is very high in such a case. Default behaviour is unchanged: 250k up to 250k << 6 (step by step). Setting this new option has two effects: - override the maximum probesize (currently 250k << 6) - reduce the number of steps to 1 instead of 6, this is to avoid detecting the audio "too early" and failing to reach a video packet. Even if a single audio stream duration is found but not the other audio/video stream durations, there will be a retry, so at the end the full user-overriden probesize will be used as expected by the user. Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
* avformat/avformat: Reorder AVFormatContext fieldsJames Almer2024-03-071-111/+111
| | | | | | Move related fields closer together. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: remove AVFormatContext.ts_idJames Almer2024-03-071-6/+0
| | | | | | It's been replaced by a demuxer exported private option. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-071-98/+0
| | | | | | | | | | | | | | | | | | | | | This commit does for AVInputFormat what commit 59c9dc82f450638a3068deeb1db5c56f6d155752 did for AVOutputFormat: It adds a new type FFInputFormat, moves all the internals of AVInputFormat to it and adds a now reduced AVInputFormat as first member. This does not affect/improve extensibility of both public or private fields for demuxers (it is still a mess due to lavd). This is possible since 50f34172e0cca2cabc5836308ec66dbf93f5f2a3 (which removed the last usage of an internal field of AVInputFormat in fftools). (Hint: tools/probetest.c accesses the internals of FFInputFormat as well, but given that it is a testing tool this is not considered a problem.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: remove deprecated FF_API_AVFORMAT_IO_CLOSEJames Almer2024-03-071-10/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_GET_END_PTSJames Almer2024-03-071-10/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/options: Deprecate av_fmt_ctx_get_duration_estimation_method()Andreas Rheinhardt2024-03-061-0/+4
| | | | | | Forgotten in b7785d10b00c88029d8af7dbddac09ab0d6f2b7f. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: add a function to return the name of stream groupsJames Almer2024-03-051-0/+5
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: add support for tile HEIF still imagesJames Almer2024-02-261-3/+3
| | | | | | | | | | | | Export each tile as its own stream, and the grid information as a Stream Group of type TILE_GRID. This also enables exporting other stream items like thumbnails, which may be present in non tiled HEIF images too. For those, the primary stream will be tagged with the default disposition. Based on a patch by Swaraj Hota Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: add a Tile Grid stream group typeJames Almer2024-02-261-0/+161
| | | | | | This will be used to support tiled image formats like HEIF. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Remove reference to removed setterAndreas Rheinhardt2024-02-141-1/+1
| | | | | | Removed in 704017d91ec8fbade0de072d222018c1a6013b70. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: add a disposition field to AVStreamGroupJames Almer2024-02-131-0/+10
| | | | | | | | | | The existing (and upcoming) available group types are meant to combine several streams for presentation, with the result being treated as if it was a stream itself. For example, a file could export two stream groups of the same type with one of them as the "default". Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: introduce AVStreamGroupJames Almer2023-12-181-0/+153
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: use the side data from AVStream.codecparJames Almer2023-10-061-1/+26
| | | | | | | | | | | | Deprecate AVStream.side_data and its helpers in favor of the AVStream's codecpar.coded_side_data. This will considerably simplify the propagation of global side data to decoders and from encoders. Instead of having to do it inside packets, it will be available during init(). Global and frame specific side data will therefore be distinct. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Deprecate AVFMT_ALLOW_FLUSHAndreas Rheinhardt2023-10-031-2/+4
| | | | | | | | | | | | | | | It is of no value to the user, because every muxer can always be flushed with a NULL packet. As its documentation shows ("If not set, the muxer will not receive a NULL packet in the write_packet function") it is actually an internal flag that has been publically exposed because there was no internal flags field for output formats for a long time. But now there is and so use it by replacing the public flag with a private one. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Anton Khirnov <anton@khirnov.net> Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: deprecate AVFMT_FLAG_SHORTESTAnton Khirnov2023-09-181-0/+2
| | | | | | | | | | | It was added in cb114ed4640 with the comment "This will allow fixing several bugs with the -shortest option". Since * there is no explanation of what these bugs are * libavformat is not the place to work around ffmpeg CLI bugs * there is no indication that this feature is actually in use deprecate it without replacement.
* avformat/avformat: Avoid including codec.h, frame.hAndreas Rheinhardt2023-09-071-13/+16
| | | | | | | | | | | | | | | | AVCodec is only ever used as an incomplete type (i.e. via a pointer to an AVCodec) in avformat.h and it is not really part of the core of avformat.h or libavformat; almost none of our internal users make use of it (and none make use of hwcontext.h, which is implicitly included). So switch to use struct AVCodec, but continue to include codec.h for external users for compatibility. Also, do the same for AVFrame and frame.h, which is implicitly included by codec.h (via lavu/hwcontext.h). Also, remove an unnecessary inclusion of <time.h>. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: deprecate AVFormatContext io_close callbackMarton Balint2023-02-161-0/+5
| | | | | | io_close2 should be used instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: remove FF_API_AVSTREAM_CLASSJames Almer2023-02-091-2/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove FF_API_LAVF_PRIV_OPTJames Almer2023-02-091-3/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Move AVOutputFormat internals out of public headerAndreas Rheinhardt2023-02-091-109/+0
| | | | | | | | | | | | | | This commit does for AVOutputFormat what commit 20f972701806be20a77f808db332d9489343bb78 did for AVCodec: It adds a new type FFOutputFormat, moves all the internals of AVOutputFormat to it and adds a now reduced AVOutputFormat as first member. This does not affect/improve extensibility of both public or private fields for muxers (it is still a mess due to lavd). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/avformat: Move codecpar up in AVStreamAndreas Rheinhardt2023-02-091-11/+11
| | | | | | | | | It is the most commonly used field and moving it to the start e.g. allows to encode the offset in a pointer+offset addressing mode on one byte on x86. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/avformat: Remove AVOutputFormat.data_codecAndreas Rheinhardt2023-02-091-1/+0
| | | | | | | No AVOutputFormat has this set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/avformat: Improve doxy styleMarvin Scholz2022-10-171-77/+103
| | | | Mostly re-indenting and adding some missing references.
* avformat/avformat: Fix mismatching argument namesMarvin Scholz2022-10-171-2/+2
|
* lavf: deprecate av_stream_get_end_pts()Anton Khirnov2022-08-221-0/+3
| | | | | | | | | | | According to its documentation it returns "pts of the last muxed packet + its duration", but the value it actually returns right now is (possibly guessed) dts after muxer-internal bitstream filtering (if any). This function was added for ffmpeg.c, but it is not used there anymore. Since the value it returns is ill-defined and so inappropriate for any serious use, deprecate it.
* Keep including the full version.h when headers are included externallyMartin Storsjö2022-03-191-0/+6
| | | | | | | | | This avoids unnecessary churn and build breakage for users, by making sure the whole version.h is included like it has been so far, while keeping the benefit of not needing to rebuild most files in the ffmpeg tree on minor/micro bumps. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Split version.hMartin Storsjö2022-03-161-1/+1
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Add non diegetic stream disposition flagVittorio Giovara2022-03-151-0/+7
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mux: Peek into the muxing queue for avoid_negative_tsAndreas Rheinhardt2022-01-211-1/+1
| | | | | | | | | | | Peeking into the muxing queue can improve the estimate of the lowest timestamp needed for avoid_negative_ts in case the lowest timestamp is in a packet other than the first packet to be muxed. This fixes tickets #4536 and #5784 as well as the output from the matroska-avoid-negative-ts FATE-test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Add AVFMT_AVOID_NEG_TS_DISABLEDAndreas Rheinhardt2022-01-211-0/+1
| | | | | | And also don't use explicit constants in the movenc test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: add a flag for experimental (de)muxersAnton Khirnov2022-01-031-0/+7
|
* avformat: introduce AVFormatContext io_close2 which returns an intMarton Balint2021-12-121-0/+13
| | | | | | | | | | | | | | | | | Otherwise there is no way to detect an error returned by avio_close() because ff_format_io_close cannot get the return value. Checking the return value of the close function is important in order to check if all data was successfully written and the underlying close() operation was successful. It can also be useful even for read mode because it can return any pending AVIOContext error, so the user don't have to manually check AVIOContext->error. In order to still support if the user overrides io_close, the generic code only uses io_close2 if io_close is either NULL or the default io_close callback. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/avformat: Add AVStream parameter to check_bitstream() sigAndreas Rheinhardt2021-11-271-1/+6
| | | | | | | | | | For most check_bitstream() functions this just avoids having to dereference s->streams[pkt->stream_index] themselves; but for meta-muxers it will allow to forward the packet to stream with a different stream_index (belonging to a different AVFormatContext) without using a spare packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: add public functions converting dispositions to/from stringsAnton Khirnov2021-11-161-0/+14
|