summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* libavformat/rtsp: pkt_size option is not honored in rtspYubo Xie2022-04-27
| | | | | Signed-off-by: xyb <xyb@xyb.name> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov: fix missing extra data updatingZhao Zhili2022-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | The stsc_index is checked and updated for the next sample. If the next sample needs to update stsd_index and stsc_index, then only stsc_index is updated, which leads to a missing AV_PKT_DATA_NEW_EXTRADATA. For example, the sample in the second chunk needs to update both. entry[0] first_chunk = 1 samples_per_chunk = 3 sample_description_index = 1 entry[1] first_chunk = 2 samples_per_chunk = 1 sample_description_index = 2 entry[2] first_chunk = 3 samples_per_chunk = 8 sample_description_index = 2 The fix is simple: first check and update stsd_index for current sample, then check and update stsc_index for the next. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov: Add avif to list of supported extensionsVignesh Venkatasubramanian2022-04-25
| | | | | | | | AVIF still and animations are now supported by the MOV parser. Add the "avif" extension to the list of supported extensions to AVInputFormat. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
* avformat/version: bump minor version for Jpeg XLLeo Izen2022-04-23
| | | | | The version.h bump got missed with the Jpeg XL patchset. This should bump the minor version in accordance with the contributing guidelines.
* avformat/image2: add Jpeg XL as image2 formatLeo Izen2022-04-23
| | | | | This commit adds support to libavformat for muxing and demuxing Jpeg XL images as image2 streams.
* avformat/mov: Add support for still image AVIF parsingVignesh Venkatasubramanian2022-04-23
| | | | | | | | | | | This patch supports AVIF still images conforming to the final specification that have exactly one item (i.e. no alpha channel). The iloc box is parsed and the mov index populated. Partially fixes #7621. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
* avformat/mov: fix timecode with high frame rate contentMarton Balint2022-04-22
| | | | | | | | | | | | | | | | | | | | 60 fps content have "Number of Frames" set to 30 in the tmcd atom, but the frame duration / timescale reflects the original video frame rate. Therefore we multiply the frame count with the quotient of the rounded timecode frame rate and the "Number of Frames" per second to get a frame count in the original (higher) frame rate. Note that the frames part in the timecode will be in high frame rate which will make the timecode different to e.g. MediaInfo which seems to show the 30 fps timecode even for 120 fps content. Regression since 428b4aacb1a91a267650de644519882a5f700388. Fixes ticket #9710. Fixes ticket #9492. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/rtmpproto: send proper status for response to play commandMarton Balint2022-04-22
| | | | | | | | This fixes referencing the uninitialized filename variable. Fixes ticket #9711. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/genh: Check sample rateMichael Niedermayer2022-04-21
| | | | | | | | | Fixes: signed integer overflow: -2515507630940093440 * 4 cannot be represented in type 'long' Fixes: 46318/clusterfuzz-testcase-minimized-ffmpeg_dem_GENH_fuzzer-5009637474172928 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/demux: Use unsigned to check duration vs duration_textMichael Niedermayer2022-04-21
| | | | | | | | | Fixes: signed integer overflow: 9223371898743775808 - -138111000000 cannot be represented in type 'long' Fixes: 46245/clusterfuzz-testcase-minimized-ffmpeg_dem_OGG_fuzzer-5075129786302464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* librtmp: use AVBPrint instead of char *Tristan Matthews2022-04-19
| | | | | | | This avoids having to do one pass to calculate the full length to allocate followed by a second pass to actually append values. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/ipfsgateway: define PATH_MAXMark Gaiser2022-04-14
| | | | | | | | | PATH_MAX is posix. Some compilers (MSVC) don't define this thus failing to compile the ipfsgateway file. Defining it fixes the compile. Signed-off-by: Mark Gaiser <markg85@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat: Add IPFS protocol support.Mark Gaiser2022-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for: - ffplay ipfs://<cid> - ffplay ipns://<cid> IPFS data can be played from so called "ipfs gateways". A gateway is essentially a webserver that gives access to the distributed IPFS network. This protocol support (ipfs and ipns) therefore translates ipfs:// and ipns:// to a http:// url. This resulting url is then handled by the http protocol. It could also be https depending on the gateway provided. To use this protocol, a gateway must be provided. If you do nothing it will try to find it in your $HOME/.ipfs/gateway file. The ways to set it manually are: 1. Define a -gateway <url> to the gateway. 2. Define $IPFS_GATEWAY with the full http link to the gateway. 3. Define $IPFS_PATH and point it to the IPFS data path. 4. Have IPFS running in your local user folder (under $HOME/.ipfs). Signed-off-by: Mark Gaiser <markg85@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vbnenc: add VBN encoderMarton Balint2022-04-10
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/vbndec: add VBN decoderMarton Balint2022-04-10
| | | | | | | | Add support for decoding Vizrt Binary Image (VBN) files. LZW-compressed data is not supported yet. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/codec2: remove surplus include 'memory.h' statementPeter Ross2022-04-09
| | | | | | | | on glibc memory.h drags in string.h, but codec2 does not use any str* or mem* functions. additionally, memory.h is not part of the C99 or POSIX standards. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts.c: ignore a section with next flagTADANO Tokumei2022-04-09
| | | | | | | | | | | 'current_next_indicator' of 0 (next) on each section header indicates the service information is for immediate future one. ffmpeg doesn't need to parse it but current (1) one. ref: section 5.1.1 of DVB BlueBook A038 (EN 300 468) Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts.c: fix to check end of each descriptor of SDTTADANO Tokumei2022-04-09
| | | | | | | | Current code incorrectly check against end of section rather than end of descriptor. Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/smacker: add better seeking supportPaul B Mahol2022-04-08
|
* avformat/webmdashenc: fix on-demand profile stringJames Almer2022-04-07
| | | | | | Fixes ticket #9596 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpegenc: Fix ever growing FIFO and infinite loop on errorAndreas Rheinhardt2022-04-05
| | | | | | | | | | | | | | | | | | | | | Since the switch to the new FIFO API in commit ea511196a6c85eb433e10cdbecb0b2c722faf20d, the FIFO is always grown by the amount of data intended to be written into it even in case the FIFO has enough free space. Fix this by only growing the FIFO if needed and then only by the amount that is actually needed. The allocation errors that resulted from this uncovered another bug: The context is left in an inconsistent state in case the FIFO can't be grown, because the FIFO does not contain as much data as the sizes contained in the PacketDesc list claim. This led to an infinite loop in output_packet() (called from mpeg_mux_end()). Fix this by growing the FIFO before adding a new PacketDesc element, thereby preventing the context from becoming inconsistent. Reported-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: don't use mono layout when a front center label is expectedJames Almer2022-04-05
| | | | | | | | | | | | | | | | On output streams where a multichannel stream needs to be stored as one track per channel, each track will have a channel layout describing the position of the channel they contain. For the track with front center, the mov muxer was using the mov layout "mono" instead of the label for the front center position. Since our channel layout API considers front center == mono, we need to do some heuristics. To achieve this, we make sure all audio tracks contain streams with a single channel, and only one of them is front center. In that case, we write the front center label instead of signaling mono layout. Fixes the last part of ticket #2865 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: move the definition of MovChannelLayoutTag to the headerJames Almer2022-04-05
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: write channel descriptions when a known layout or a bitmap ↵James Almer2022-04-05
| | | | | | | | can't be used Fixes part of ticket #2865 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: use a higher log level for a debug messageJames Almer2022-04-05
| | | | | | | Trace is too noisy and this line is useful enough to get it printed at debug level. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: add a few missing channel label mappingsJames Almer2022-04-05
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: rename mov_get_channel_label() to better reflect its purposeJames Almer2022-04-05
| | | | | | This function turns a mov channel label into a lavf native bitmask. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/libsrt: use a larger buffer for find_info_tagZhao Zhili2022-03-30
| | | | | | | | The upper limit of strlen(streamid) is 512. Use a larger buffer for future proof, for example, deal with percent-encoding. Reviewed-by: Zhao Jun <barryjzhao@tencent.com> Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/libsrt: fix deprecated warningZhao Zhili2022-03-30
| | | | | | | srt_socket was deprecated after 1.4.1. Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/aqtitledec: Skip unrepresentable durationsMichael Niedermayer2022-03-27
| | | | | | | | Fixes: signed integer overflow: -5 - 9223372036854775807 cannot be represented in type 'long' Fixes: 45665/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-475618463934054 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/apm: Check channelsMichael Niedermayer2022-03-27
| | | | | | | | Fixes: division by 0 Fixes: 45643/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4957777905188864.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cafdec: Do not store empty keys in read_info_chunk()Michael Niedermayer2022-03-27
| | | | | | | | Fixes: Timeout Fixes: 45543/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5684953164152832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Do not search through the AVOption table for a option not in it ↵Michael Niedermayer2022-03-27
| | | | | | | | | | | repeatedly on each packet This search takes alot of time especially when compared with small packets 46631 decicycles -> 15719 decicycles in read_frame_internal() for amr-nb in 3gp Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/alp: Check num_channelsMichael Niedermayer2022-03-27
| | | | | | | | | | | Fixes: division by 0 Fixes: 45615/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-582660348405350 Fixes: 45625/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-4821437943250944 Fixes: 45839/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5857286998851584.fuzz Fixes: 45844/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6552705772945408 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* rtpenc_vp8: Use 15-bit PictureIDsKevin Wang2022-03-26
| | | | | | | | | | 7-bit PictureIDs are not supported by WebRTC: https://groups.google.com/g/discuss-webrtc/c/333-L02vuWA In practice, 15-bit PictureIDs offer better compatibility. Signed-off-by: Kevin Wang <kevin@muxable.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat: Remove unnecessary inclusions from libavcodecAndreas Rheinhardt2022-03-23
| | | | | | Also improve the other headers a bit while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec, avformat: Remove unnecessary inclusions of lavc/internal.hAndreas Rheinhardt2022-03-23
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: use warning log level and small adjustment for the logLimin Wang2022-03-22
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/movenc: initialize pts/dts of timecode packetLimin Wang2022-03-22
| | | | | | | | | | | | | | | Fix below error message when timecode packet is written. "Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format" try to reproduce by: ffmpeg -y -f lavfi -i color -metadata "timecode=00:00:00:00" -t 1 test.mov Note although error message is printed, the timecode packet will be written anyway. So the patch 2/2 will try to change the log level to warning. Fixes ticket #9488 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/test/seek: set ch_layout instead of channelsJames Almer2022-03-22
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/dfpwmdec: add support to set channel layoutJames Almer2022-03-22
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/pcmdec: add support to set channel layout in sln demuxerJames Almer2022-03-22
| | | | | | | Deprecate the channels option, and ensure ch_layout has priority if set over channels, until the latter is gone. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/pcmdec: deprecate channels optionJames Almer2022-03-22
| | | | | | | And ensure ch_layout has priority if set over channels, until the latter is gone. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mxfdec: Do not clear array in mxf_read_strong_ref_array() before ↵Michael Niedermayer2022-03-21
| | | | | | writing Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: Check for avio_read() failure in mxf_read_strong_ref_array()Michael Niedermayer2022-03-21
| | | | | | | Fixes: 42827/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4900528511909888 Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: Check count in mxf_read_strong_ref_array()Michael Niedermayer2022-03-21
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/demux: ensure ch_layout is not lost in the stream's internal avctxJames Almer2022-03-21
| | | | | | | | | This is a workaround until avcodec_close() stops freeing ch_layout through av_opt_fre(), or the former is removed. Fixes a regression since 327efa66331ebdc0087c6b656059a8df2f404019. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hls: Check target_durationMichael Niedermayer2022-03-21
| | | | | | | | | Fixes: signed integer overflow: 77777777777777 * 1000000 cannot be represented in type 'long long' Fixes: 45545/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-6438101247983616 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hls: add AVFMT_NO_BYTE_SEEK flagZhao Zhili2022-03-21
| | | | | | | After d6ac6650b91, ffplay failed to seek HLS stream with AVSEEK_FLAG_BYTE enabled by default. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/concat: refactor to use ff_rescale_interval()Pierre-Anthony Lemieux2022-03-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>