summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* lavf: fall back to a more meaningful log instance nameAnton Khirnov2023-04-041-1/+1
| | | | | | | | | | | | | | | An uninitialized AVFormatContext instance with neither iformat nor oformat set will currently log as 'NULL', which is confusing and unhelpful. Print 'AVFormatContext' instead, which provides more information. This happens e.g. if choosing an output format fails in avformat_alloc_output_context2(). E.g. with the following commandline: ffmpeg -i <input> -f foobar -y /dev/null before: [NULL @ 0x5580377834c0] Requested output format 'foobar' is not a suitable output format after: [AVFormatContext @ 0x55fa15bb34c0] Requested output format 'foobar' is not a suitable output format
* avformat/movenc: correct loci parameter handlingGyan Doshi2023-04-031-3/+3
| | | | | | | | | | 3GPP TS 26.244 Table 8.10 specifies that longitude is written before latitude. The MOV demuxer already expects the correct order. So, write them in that order. However, the user supplied string may also be used in MOV mode which requires ISO 6709 format which specifies latitude first. The demuxer also exports the loci value in that format. So parser adjusted as well.
* avformat/assenc: avoid incorrect copy of null terminatorMarton Balint2023-04-021-1/+2
| | | | | | | | | | | | | | | When writing a subtitle SSA/ASS subtitle file, the AVCodecParameters::extradata buffer is written directly to the output. In the case where the buffer is filled from a matroska source file produced by some older versions of Handbrake, this buffer ends with a null terminating character, which is then erroneously copied into the middle of the output file. The change here avoids this problem by treating it as a string rather than a raw buffer. This way it is agnostic as to whether the source buffer was null terminated or not. Fixes ticket #10203. Reported-by: Tim Angus <tim at ngus.net> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tcp: correct strdup checkGyan Doshi2023-04-021-1/+1
| | | | Fixes CID 1524608.
* libavformat: Improve ff_configure_buffers_for_index for excessive deltasMartin Storsjö2023-04-021-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the ff_configure_buffers_for_index function had upper sanity limits of 16 MB (1<<24) for buffer_size and 8 MB (1<<23) for short_seek_threshold. However, if the index contained entries with a much larger delta, setting pos_delta to a value larger than the sanity limit, we would end up not increasing the buffer size at all. Instead, ignore the individual deltas that are excessive, but increase the buffer size based on the deltas that are below the sanity limit. Only count deltas that are below 1<<23, 8 MB; pos_delta gets doubled before setting the buffer size - this matches the previous maximum buffer size of 1<<24, 16 MB. This can happen e.g. with a mov file with some tracks containing some samples that belong in the start of the file, at the end of the mdat, while the rest of the file is mostly reasonably interleaved; previously those samples caused the maximum pos_delta to skyrocket, skipping any buffer size enlargement. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Account for negative position differences in ↵Martin Storsjö2023-04-021-1/+3
| | | | | | | | | | | ff_configure_buffers_for_index When scanning through the index, account for the fact that the compared samples may be located in an unexpected order in the file; this function is mainly interested in the absolute difference between file locations. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat/tcp: add local_addr/local_port for network optionjackarain2023-03-304-8/+63
| | | | | Signed-off-by: jackarain <jack.wgm@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf/oggdec: fix demux with unrecognized header packetsrcombs2023-03-281-1/+6
| | | | | | Fixes ticket #10289. Co-authored-by: James Almer <jamrial@gmail.com>
* lavf/mpegts.c: set some properties for ARIB captionTADANO Tokumei2023-03-281-1/+5
| | | | | | | | | | | Some additional properties are set for ARIB caption. * need_parsing = 0 ARIB caption doesn't require any parser. This avoids "parser not found" warning message. * need_context_update = 1 When any profiles are changed, set this flag to notify. Signed-off-by: rcombs <rcombs@rcombs.me>
* lavf: return AVERROR_EOF rather than EIO on EOFAnton Khirnov2023-03-276-6/+7
|
* avformat/mxfenc: fix stored/sampled/displayed width/heightJerome Martinez2023-03-261-6/+21
| | | | | | | | | | | | | | | | | | | | According to MXF specs the Stored Rectangle corresponds to the data which is passed to the compressor and received from the decompressor, so they should contain the width / height extended to the macroblock boundary. In practice however width and height values rounded to the upper 16 multiples are only seen when muxing MPEG formats. Therefore this patch changes stored width and height values to unrounded for all non-MPEG formats, even macroblock based ones. For DNXHD the specs (ST 2019-4) explicitly indicates to use 1080 for 1088p. For ProRes the specs (RDD 44) only refer to to ST 377-1 without precision but no known commercial implementations are using rounded values. DV is not using 16x16 macroblocks, so 16 rounding makes no sense. The patch also fixes Sampled Width / Display Width to use unrounded values. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: reindent after last mxfenc commitMarton Balint2023-03-261-36/+36
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: add support for preserving SMPTE 2038 when transcoding ↵Devin Heitmueller2023-03-263-2/+10
| | | | | | | | | | | | | | | | | MPEG-TS streams Add the appropriate descriptors to the MPEG-TS demux and mux to ensure that SMPTE 2038 VANC streams are properly preserved when using codec copy (including adding the appropriate PMT descriptors). The focus of this patch is TS input to TS output. A separate patch adds support for output of 2038 VANC over decklink SDI. Thanks to Marton Balint for feedback to preserve ABI compatibility. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: SMPTE RDD 48:2018 Amd 1:2022 supportJerome Martinez2023-03-253-3/+164
|
* lavf/mpeg: Add G.711 A law supportJun Zhao2023-03-251-0/+3
| | | | | | Add G.711 A law support Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/mpegtsenc: Restrict "async" behavior to KLV async packetsDevin Heitmueller2023-03-161-1/+2
| | | | | | | | | | | | | | The original code would strip off the PTS/DTS of any packets which had a stream ID of STREAM_ID_PRIVATE_STREAM_1. While the intent was to apply this to asynchronous KLV packets, it was being applied to any codec that had that same stream ID (including types such as SMPTE 2038). Add a clause to the if() statement to ensure it only gets applied if the codec actually is KLV. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: fix 2 compile errorsTong Wu2023-03-162-2/+2
| | | | | | | | | | | Compiler: MSVC 14.35.32215 Error type: error C2059: syntax error: '}' Related commit: 9e1ffed fate/mov: add PCM in mp4 test d7e8643 avformat/mov: parse ISO-14496-12 ChannelLayout Signed-off-by: Tong Wu <tong1.wu@intel.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> Reviewed-by: Haihao Xiang <haihao.xiang@intel.com>
* avformat/movenc: add PCM in mp4 supportZhao Zhili2023-03-151-1/+83
| | | | | | | | It's defined by ISO/IEC 23003-5. Fixes ticket #10185 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov: parse ISO-14496-12 ChannelLayoutZhao Zhili2023-03-153-1/+406
| | | | | | Only support chnl version 0 now. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/isom_tags: remove ipcm from movaudio_tagsZhao Zhili2023-03-151-2/+0
| | | | | | | ipcm is defined by ISO/IEC 23003-5, not defined by quicktime. After adding ISO/IEC 23003-5 support, we don't need it for ticket #9219. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov: fix ISO/IEC 23003-5 supportZhao Zhili2023-03-152-0/+51
| | | | | | Missing floating-point formats support. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/img2dec: fix unable to find svg format when the svg resources start ↵Wang Yaqiang2023-03-091-2/+7
| | | | | | | | | | | | with "<svg" or "<!--" svg is xml, but <?xml is not required, it can start with <svg and can have multiple empty lines, or start with <!-- include some comments, but must first line if start with <?xml. Signed-off-by: Wang Yaqiang <wangyaqiang03@kuaishou.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aea: make the AEA demuxer return EOF at the end of file instead of EIOasivery2023-03-091-7/+1
| | | | | Signed-off-by: asivery <asivery@protonmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/http: cookie path attribute should be optional not compulsoryMichael J. Walsh2023-03-081-2/+2
| | | | | | | The path attribute in the Set-Cookie header is optional but treated by ffmpeg as being compulsory. Signed-off-by: Michael J. Walsh <mjfwalsh@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tls: check for memory allocation failure when setting optionsjackarain2023-03-081-6/+20
| | | | | Signed-off-by: jackarain <jack.wgm@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: check for memory allocation failure when setting localaddrjackarain2023-03-081-0/+4
| | | | | Signed-off-by: jackarain <jack.wgm@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/matroska: add support for ARIB captionsrcombs2023-03-083-0/+54
|
* avformat/mov: base pcmC endianness on just the LSBJan Ekström2023-03-051-1/+1
| | | | | | | | | | As per 23003-5:2020, the rest of the bits are reserved, and thus in the future they may be utilized for something else. Quote: format_flags is a field of flags that modify the default PCM sample format. Undefined flags are reserved and shall be zero. The following flag is defined: 0x01 indicates little-endian format. If not present, big-endian format is used.
* avformat/mov: check that pcmC box is of the expected typeJan Ekström2023-03-051-2/+11
| | | | | | As per 23003-5:2020 this box is defined as PCMConfig extends FullBox(‘pcmC’, version = 0, 0), which means that version is 0 and flags should be zero.
* avformat/hlsenc: hls_init_time should used in living stream modeSteven Liu2023-02-271-1/+1
| | | | | | | When hls_init_time should available when hls_list_size > 0. Because the list will not refresh new top line segment when hls_list_size is 0 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/wavarc: Check if extradata has been fully readMichael Niedermayer2023-02-231-1/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rka: Fix 1/0 with bps=1Michael Niedermayer2023-02-221-1/+1
| | | | | | | | | | | | Fixes: division by zero Fixes: 55940/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6333107679920128 The decoder does not support bps=1 and i have no such sample so it is not known if this duration is correct. Alternatively we could error out on all bps we currently do not support on the decoder side or not set duration. Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Check samplesize and offset to avoid integer overflowMichael Niedermayer2023-02-221-0/+7
| | | | | | | | Fixes: signed integer overflow: 9223372036854775584 + 536870912 cannot be represented in type 'long' Fixes: 55844/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-510613920664780 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/imfdec: remove the experimental flagPierre-Anthony Lemieux2023-02-211-1/+1
| | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
* avformat/mpegtsenc: re-emit extradata ahead of IDR pictures even if AUD is ↵John Coiner2023-02-191-7/+41
| | | | | | | | | | | | | | | | | | already present Current mpegtsenc code only inserts SPS/PPS from extradata before IDR frames if AUD is also inserted. Unfortunately some encoders may preface a key frame with an AUD, but no SPS/PPS. In that case current code does not repeat the "extradata" and the resulting HLS stream may become noncompliant and unjoinable. Fix this by always inserting SPS/PPS and moving AUD to the beginning of the packet if it is already present. Fixes ticket #10148. Signed-off-by: Marton Balint <cus@passwd.hu>
* version.h: Bump minor post 6.0 branchn6.1-devMichael Niedermayer2023-02-191-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* version.h: Bump minor for 6.0 branchMichael Niedermayer2023-02-191-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: fix EOS tagZhao Zhili2023-02-191-3/+6
| | | | | | | | | | FLV spec only has AVC end of sequence tag, and the EOS tag has a CodecID as other video data packet. MPEG4 doesn't conformance to the spec, but it's there for a decade. So only 'fix' the EOS tag rather than remove it completely. Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/cdg: add probePaul B Mahol2023-02-181-0/+17
|
* avformat: deprecate AVFormatContext io_close callbackMarton Balint2023-02-1610-0/+42
| | | | | | io_close2 should be used instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/rka: improve probingPaul B Mahol2023-02-141-1/+1
|
* avformat/movenc: allow writing out channel count in MP4 and 3GPJan Ekström2023-02-141-7/+1
| | | | | | | | | | | | | | | | | | | ISOBMFF (14496-12) made this field ('channelcount') in the AudioSampleEntry structure non-template¹ somewhere before the release of the 2022 edition. As for ETSI TS 126 244 AKA 3GPP file format (V16.1.0, 2020-10), it does not seem contain any references limiting the channelcount entry in AudioSampleEntry or in its own definition of EVSSampleEntry. fate-mov-mp4-chapters test had to be adjusted as it output a mono vorbis stream, which would now be properly marked as such in the container. 1: As per 14496-12: Fields shown as “template” in the box descriptions are fields which are coded with a default value unless a derived specification defines their use and permits writers to use other values than the default.
* avformat: add RKA demuxerPaul B Mahol2023-02-114-1/+176
|
* avformat: add SDNS demuxerPaul B Mahol2023-02-114-1/+99
|
* avformat/wavarc: demux only data chunk contentPaul B Mahol2023-02-092-6/+26
|
* Bump major versions of all librariesJames Almer2023-02-092-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/version: postpone the remaining API deprecationsJames Almer2023-02-091-3/+3
| | | | | | They are either too recent, or still need work like FF_API_COMPUTE_PKT_FIELDS2. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/{color_utils, csp}: merge color_utils into csp and expose APILeo Izen2023-02-091-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | libavutil/color_utils contains some avpriv_ symbols that map enum AVTransferCharacteristic values to gamma-curve approximations and to the actual transfer functions to invert them (i.e. -> linear). There's two issues with this: (1) avpriv is evil and should be avoided whenever possible (2) libavutil/csp.h exposes a public API for handling color that already handles primaries and matricies I don't see any reason this API has to be private, so this commit takes the functionality from avutil/color_utils and merges it into avutil/csp with an exposed av_ API rather than the previous avpriv_ API. Every reference to the previous API has been updated to point to the new one. color_utils.h has been deleted as well. This should not break any applications as it only contained avpriv_ symbols in the first place, so nothing in that header could be referenced by other applications. Signed-off-by: Leo Izen <leo.izen@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat: remove FF_API_AVSTREAM_CLASSJames Almer2023-02-093-6/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove FF_HLS_TS_OPTIONSJames Almer2023-02-092-4/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>