Commit Graph

25096 Commits

Author SHA1 Message Date
Marvin Scholz 45ab5307a6 avformat/fifo: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:15 +01:00
Marvin Scholz d75d8370bd avformat/matroskaenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:15 +01:00
Marvin Scholz 643c2b4722 avformat/http: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:15 +01:00
Marvin Scholz fb93d3d043 avformat/asfenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:15 +01:00
Marvin Scholz 521d8dcf88 avformat/apetag: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:15 +01:00
Marvin Scholz 4bf8c9c2d8 avformat/nutenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 0464aa484e avformat/id3v2enc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 995616b752 avformat/ffmetaenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz b31c16d625 avformat/wtvenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 2b5391b88f avformat/dump: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 8298f20c59 avformat/lrcenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 6c4f23cc20 avformat/hls: use av_dict_iterate
And constify oldentry too while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz b463ef0339 avformat/flvenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz b7c577cec7 avformat/metadata: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 562d19b503 avformat/movenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 401508b24b avformat/cafenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz 734acfde4c avformat/vorbiscomment: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Marvin Scholz f8584c13f0 avformat/smjpegenc: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Andreas Rheinhardt 4d9c0b3efa configure: Add (h264|hevc)_sei subsystems
Currently, several components select atsc_a53, despite
not using anything from it themselves. They only select
it because parsing SEI messages adds an indirect dependency.
But using direct dependencies is more natural, so add
dedicated subsystems for them.

It already allows to remove a superfluous dependency of
the HEVC QSV encoder on hevc_sei and atsc_a53.

Adding new subsystems only becomes effective after a reconfiguration.
In order to force this, some needed headers (which are only included
implicitly before this commit) were included explicitly in
libavformat/allformats.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:00:40 +01:00
Sasi Inguva 9d8d7bdffb avformat/mov: Set duration to zero if the duration is UINT_MAX
Fixes some MP4F files which have duration in mdhd set to UINT_MAX instead of zero.

Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-29 08:39:32 -03:00
Michael Niedermayer a798af91d7
avformat/id3v2: Check taglen in read_uslt()
Fixes: Timeout (read mostly the same data repeatly)
Fixes: 52457/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-6610706313379840
Fixes: 53098/clusterfuzz-testcase-minimized-ffmpeg_dem_SOL_fuzzer-6481382981632000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Paul B Mahol 2ad199ae31 avformat/wavenc: w64 muxer supports only 1 stream 2022-11-25 10:23:19 +01:00
Marton Balint 98f6c59f4f avformat/electronicarts: add option to return alpha channel in the main video stream in VP6A codec
VP6 alpha in EA format is a second VP6 encoded video stream where only the Y
component is used and is interpreted as the alpha channel of the first VP6
stream. The alpha VP6 stream is muxed separately from the main VP6 stream, has
its own stream headers and packet headers. In theory the two streams might not
even have the same resolution (although most likely that is not something that
is seen or supported in the wild), but the format is capable of doing it.

Merged VP6 alpha (also known as the VP6A codec) means that a packet of the
video stream contains the corresponding packet of both VP6 substreams like
this:

{OffsetOfAlpha, DataPacket, AlphaDataPacket}

So data and alpha data of a frame is merged to a single packet, this is how VP6
video with alpha is muxed in FLV and SWF.

The first approach is more like how the demuxer sees data in the EA format,
unfortunately it is different to what the FLV or SWF format expects, so -
having no better place for it in the framework - I decided to do an optional
format conversion in the EA demuxer.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-11-22 22:59:51 +01:00
Marton Balint bd5ea78556 avformat/electronicarts: set packet_read in one place
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-11-22 22:54:27 +01:00
Marton Balint 29d1d3e2e8 avformat/electronicarts: fix EOF check
Similar to feof(), avio_feof() is only true after an actual overread.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-11-22 22:54:27 +01:00
James Almer 63db6a02a7 avformat/concatdec: check that there's extradata before trying to copy it
The first argument for memcpy must not be NULL.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-17 10:53:20 -03:00
James Almer cb925c0bc0 avformat/vpcc: parse bitstream data to get profile and bitdepth
Profile can be derived from values codecpar pixel format only with software
formats. For hardware formats, we're forced to parse a frame header to get
the required information.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-17 10:05:49 -03:00
Michael Niedermayer 2532b20b17
avformat/replaygain: avoid undefined / negative abs
Fixes: signed integer overflow: -2147483648 * 100000 cannot be represented in type 'int'
Fixes: 52060/clusterfuzz-testcase-minimized-ffmpeg_dem_MP3_fuzzer-5131616708329472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-04 22:44:16 +01:00
Paul B Mahol e27bef9a56 avformat/serdec: fix BE/LE format handling 2022-11-03 16:59:18 +01:00
Pierre-Anthony Lemieux 89a49fd5a9
avformat/imfdec: variable initialiaztion cosmetics 2022-11-03 21:16:10 +10:00
Pierre-Anthony Lemieux 906219e3ca
avformat/tests/imf: add CPL timecode test 2022-11-03 21:16:10 +10:00
Pierre-Anthony Lemieux 94922f6cab
avformat/imfdec: use CPL start timecode if available
The IMF CPL contains an optional timecode start address. This patch reads the
latter, if present, into the context's timecode metadata parameter.
This addresses https://trac.ffmpeg.org/ticket/9842.
2022-11-03 21:16:03 +10:00
James Almer 5d5b87f688 avformat/mov_chan: use the cube layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-10-30 16:46:48 -03:00
Andreas Rheinhardt cdd50223a6 avformat/argo_cvg: Mark overrides as const
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:08:00 +02:00
Andreas Rheinhardt 9aa7397db1 avformat/mux: Constify validate_codec_tag()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:32:37 +02:00
Andreas Rheinhardt 5da8b522c8 avformat/mux: Don't call ff_toupper4() unnecessarily
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:32:37 +02:00
Anton Khirnov a2f5913857 lavf: set internal thread names 2022-10-24 02:00:31 +02:00
Carl Eugen Hoyos fc410ce572 lavf/hevc: Fix type specifiers, missed in 8b5d1553
Fixes several warnings with msvc:
warning: format specifies type 'unsigned char' but the argument has type 'unsigned int'
2022-10-23 20:45:25 +02:00
Andreas Rheinhardt 1132007d3c avformat/mj2kdec: Remove always-true #if CONFIG_MJPEG_2000_DEMUXER
This file is built iff the MJPEG 2000 demuxer is enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00
Chema Gonzalez a1a87b7a24 avformat/yuv4mpegdec: increase header limit
Allows demuxing UHD F1000000000:33333333 fps yuvj420p files

ffmpeg (at HEAD as of now) is creating this:

```
$ ffmpeg -y -i source.265 /tmp/foo.y4m >& /dev/null
...
$ xxd /tmp/raw.y4m |less
00000000: 5955 5634 4d50 4547 3220 5731 3932 3020  YUV4MPEG2 W1920
00000010: 4831 3038 3020 4631 3030 3030 3030 3030  H1080 F100000000
00000020: 303a 3333 3333 3333 3333 2049 7020 4130  0:33333333 Ip A0
00000030: 3a30 2043 3432 306d 7065 6732 2058 5953  :0 C420mpeg2 XYS
00000040: 4353 533d 3432 304d 5045 4732 2058 434f  CSS=420MPEG2 XCO
00000050: 4c4f 5252 414e 4745 3d4c 494d 4954 4544  LORRANGE=LIMITED
00000060: 0a46 5241 4d45 0a82 8282 8282 8282 8282  .FRAME..........
...
```

Which cannot be parsed by the same ffmpeg decoder:
```
$ ffmpeg -i /tmp/foo.y4m /tmp/bar.y4m
...
[yuv4mpegpipe @ 0x2b69a40] Header too large.
/tmp/foo.y4m: Invalid argument
```

This is kicking the ball (per 0b1ff3265e),
but seems to work.
2022-10-21 20:11:14 +02:00
Michael Niedermayer 557aa7772e
avformat/asfdec_o: Check offset before adding index entry
Fixes: signed integer overflow: 9223372036854550860 + 530259564 cannot be represented in type 'long'
Fixes: 49093/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-4697179192688640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-10-20 21:42:20 +02:00
Tristan Matthews eb9153b4a7 avformat/hls: fix spelling and grammar on wrap warning 2022-10-20 16:27:06 +05:30
Peter Ross 3141dbb7ad avcodec: ViewQuest VQC decoder
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Peter Ross <pross@xvid.org>
2022-10-18 13:20:37 +11:00
Marvin Scholz 226dde687f avformat/avio: Add doxy for missing argument 2022-10-17 09:56:47 +02:00
Marvin Scholz 99f6d0bdde avformat/avformat: Improve doxy style
Mostly re-indenting and adding some missing references.
2022-10-17 09:51:47 +02:00
Marvin Scholz 1f0529ec5f avformat/avformat: Fix mismatching argument names 2022-10-17 09:51:47 +02:00
Guangyu Sun fc6f7e2a3b lavf/async: Fix ring_write return value
This fixes a regression from commit 36117968ad.

wrapped_url_read() used to be able to return positive number from
ffurl_read(). It relies on the result to check if EOF is reached in
async_buffer_task().

But FIFO callbacks must return 0 on success. This should be handled
in ring_write() instead.

Test case:
  ffmpeg -f lavfi -i testsrc -t 1 test.mp4
  ffmpeg -i async:test.mp4

Signed-off-by: Guangyu Sun <gsun@roblox.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-10-14 12:19:13 +02:00
Zhao Zhili 94644343a6 avformat/mp3dec: remove a call to avio_tell()
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-10-08 22:56:30 +08:00
Zhao Zhili 0d17f5228f avformat/mp3dec: avoid seek back and forth
avio_seek() is called inside check(). Seeking to 'off' then seeking
to 'off + i' is unefficient, and it can loop 64 * 1024 times in the
worst case. When probe a malformed file over HTTP, it looks like
stucked forvever. ffio_ensure_seekback() doesn't solve the issue
when the stream is seekable but slow.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-10-08 22:56:20 +08:00
Zhao Zhili 2205ccd216 avformat/mpegtsenc: add omit_rai flag
Add PCR at keyframe can be undesirable when -pcr_period is
specified. Add an flag to disable this behavior.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-10-08 22:55:31 +08:00