Commit Graph

3456 Commits

Author SHA1 Message Date
Niklas Haas
978a0821ee avfilter/avfiltergraph: always retry format negotiation after auto-filters
There is an edge case not covered by the current logic: If there is only
a single auto-filter inserted, but the auto-inserted filter is incompatible
with a *different* format attribute (after settling the previous formats),
we may need a second auto-filter (e.g. `scale`) to settle the newly introduced
incompatibility.

A regression test demonstrating the issue is added.
2025-12-09 21:31:58 +00:00
Andreas Rheinhardt
fb20009f47 tests/ref/fate/source: Fix fate-source after last commit
Broken in ac9552bebf.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-12-08 23:33:47 +00:00
Niklas Haas
f39fe6380c swscale/ops_optimizer: set correct value range for subpixel reads
e.g. rgb4 only reads values up to 15, not 255.

Setting this correctly eliminates a number of redundant clamps in cases
like e.g. rgb4 -> monow.
2025-12-08 20:09:37 +00:00
Niklas Haas
fddeb84fb2 tests/fate: add fate-sws-ops-list test
This one uses the test framework added in the previous commit to add a
light-weight regression test to ensure the generated SwsOpsList is identical.

Only compare the md5sum, to make the reference file significantly smaller
(down from ~10 MB).
2025-12-08 16:58:53 +00:00
Marton Balint
07e3d760bf fate/filter-audio: add amerge layout_mode test
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-12-07 19:36:49 +00:00
Michael Niedermayer
12e7d095b1 Revert "avformat/rawdec: set framerate in codec parameters"
Fixes single image videos
this works and creates our single image video
./ffmpeg -i lena.pnm /tmp/file.m2v

this fails after 3d96d83a0a:
./ffmpeg -i /tmp/file.m2v /tmp/file.jpg -y

This reverts commit 3d96d83a0a.
2025-12-04 01:59:04 +00:00
Jack Lau
c4b050fd67 tests/fate/filter-video: add two feedback tests
- Add fate-filter-feedback-yadif

- add fate-filter-feedback-hflip

Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2025-12-03 21:23:51 +00:00
Zhao Zhili
413346bd06 tests/fate/ffmpeg: add test for -force_key_frames scd_metadata 2025-12-02 03:03:55 +00:00
Gavin Li
3d96d83a0a avformat/rawdec: set framerate in codec parameters
Commit ba4b73c977 caused a regression in
the usage of avg_frame_rate to detect the frame rate of raw h264/hevc
bitstreams: after the commit, avg_frame_rate is always the value of the
-framerate option (which is set to 25 by default) instead of the actual
frame rate derived from the bitstream SPS/VPS NALUs.

This commit fixes the regression by setting the framerate codec
parameter to the value of the framerate option instead. After this
change, bitstreams without timing information will derive avg_frame_rate
from the -framerate option, while bitstreams with timing information
will derive avg_frame_rate from the bitstream itself.

The h264-bsf-dts2pts test now returns the correct frame durations for a
bitstream with a mix of single-field and double-field frames.

Signed-off-by: Gavin Li <git@thegavinli.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-27 20:01:54 -03:00
James Almer
69534d4e7e avcodec/cavs_parser: parse sequence headers for stream parameters
Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-27 20:01:54 -03:00
Kacper Michajłow
a75b15a4ab avfilter/vf_drawvg: round color values to avoid differences on some platforms
This ensures consistent color conversion between double and u8 and
guarantees that values remain consistent across different platforms,
especially when x87 math is used.

Note that libcairo also performs rounding internally when converting
doubles to integers, see _cairo_color_double_to_short().

Fixes: fate-filter-drawvg-interpreter
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-25 22:32:50 +01:00
James Almer
6f4a3be9dc avformat/movenc: add support for writing srat box
Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-24 02:59:02 +00:00
James Almer
c0044ec9c4 avformat/mov: don't parse reserved ISOBMFF fields as if they were QT
Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-23 11:51:26 +00:00
Anders Rein
32f73138f5 fate/filter-audio: Added test for aselect 2025-11-22 18:36:41 +00:00
Stefan Breunig
4c4ab2ec6f fate/filter-video: add frei0r test where input is realigned
An installation of frei0r-plugins is required to run the tests,
which is usually seperate from the build headers. Some systems
have it packaged (e.g. apt install frei0r-plugins). An upstream
release extracted to FREI0R_PATH also works.

The distort0r filter requires dimensions to be divisible by 8.
2025-11-18 21:26:36 +00:00
Zhao Zhili
071db4b81c tests/fate/hevc: add a mv-hevc sample using long term ref 2025-11-10 12:22:05 +08:00
Romain Beauxis
f2b9b1923d Don't reset last{pts,dts} on new sequentialized ogg streams.
This fixes PTS/DTS discontinuity on sequentialized ogg streams.
2025-11-09 10:46:08 +00:00
Stefan Breunig
549b45459e avfilter/vf_frei0r: fix time not being passed in seconds
The frei0r API expects the time in seconds, but was given it in
milliseconds. The bug might exist since 41f1d3a (~14 years ago),
but plugins depending on the time are unwatchable without this
patch. For example:

ffmpeg -filter_complex "testsrc2=d=5,frei0r=distort0r" out.mp4

Signed-off-by: Stefan Breunig <stefan-ffmpeg-devel@breunig.xyz>
2025-11-08 20:55:03 +00:00
Lynne
9a7174bc9a Revert "lavu/pixfmt: add grayscale 10 and 12-bit MSB padded variants"
This reverts commit ed5b694ebe.
2025-11-06 21:46:43 +01:00
Lynne
26236a47b2 Revert "lavu/pixfmt: add 420 and 422, 10 and 12-bit MSB padded variants"
This reverts commit e42c7698f5.
2025-11-06 21:46:43 +01:00
Lynne
b982b2a2a3 Revert "swscale: add support for 10/12-bit grayscale MSB pixfmts"
This reverts commit a5be0ecbfd.
2025-11-06 21:46:41 +01:00
Lynne
72a19a1c4a Revert "swscale: add support for 10/12-bit 422 and 444 MSB pixfmts"
This reverts commit bc0ee8b7cc.
2025-11-06 21:44:13 +01:00
Ramiro Polla
4bee010844 swscale/range_convert: fix truncation bias in range conversion
384fe39623 introduced a regression in the
range conversion offset calculation, resulting in a slight green tint
in full-range RGB to YUV conversions of grayscale values.

The offset being calculated was not taking into consideration a bias
needed for correctly rounding the result from the multiplication stage,
leading to a truncated value.

Fixes issue #11646.
2025-11-06 20:36:08 +00:00
Niklas Haas
01b105bb06 tests/fate/swscale: add swscale self-test
This one takes about 2.93s on my machine, but ensures that every pixel
format conversion roundtrips correctly. Note that due to existing bugs in
libswscale, this one only passes when using the new format conversion code.

Restrict the test to -v 16 (AV_LOG_ERROR) to avoid excess amounts of output.
2025-11-06 20:34:51 +00:00
Zhao Zhili
84fcbce16c fate/hevc: add tests for the dts2pts bsf 2025-11-05 15:13:54 +00:00
Martin Storsjö
8313dc1120 movenc: Make hybrid_fragmented retain the fragmented form headers
This makes the final file truly hybrid: Externally the file
is a regular, non-fragmented file, but internally, the fragmented
form also exists un-overwritten.

To make any use of that, first, the fragments need to be muxed in
a position independent form, i.e. with empty_moov+default_base_moof
(or the dash or cmaf meta-flags).

Making use of the fragmented form when the file is finalized is
not entirely obvious though. One can dump the contents of the
single mdat box, and get the fragmented form. (This is a neat
trick, but not something that anybody really is expected to
want to do.)

The main expected use case is accessing fragments in the form of
byte range segments, for e.g. HLS.

Previously, the start of the file would look like this:

- ftyp
- free
- moov
 - (moov contents)

After finalizing the file, it would look like this:

- ftyp
- free
- mdat (previously moov)
 - (moov contents)

In this form, the size and type of the original moov box were
overwritten, and the original moov contents is just leftover
as unused data in the mdat box.

To avoid this issue, the start of the file now looks like this:

- ftyp
- free
- free
 - ftyp
- moov
 - (moov contents)

The second, hidden ftyp box inside mdat, would normally never be
seen.

After finalizing, the difference is that the mdat box now is
extended to cover the ftyp and the whole moov including its header
(and all the following fragments).

I.e., the start of the file looks like this:

- ftyp
- free
- mdat
 - ftyp
 - moov
  - (moov contents)

This allows accessing the "ftyp+moov" pair sequentially as such,
with a byte range - this range is untouched when finalizing,
producing the same ftyp+moov pair both while writing, when the
file is fragmented, and after finalizing, when the file is
transformed to non-fragmented externally.

Note; the sequential two "free+free" boxes may look slightly
silly; it could be tempting to make the second one an mdat
from the get-go. However, some players of fragmented mp4 (in
particular, Apple's HLS player) bail out if the initialization
segment contains an mdat box - therefore, use a free box.

It could also be possible to use just one single free box with
8 bytes of padding at the start - but that would require more
changes to the finalization logic.

For a segmenting user of the muxer, the only unclarity is how
to determine the right byte range for the internal ftyp+moov
pair. Currently, this requires parsing the muxer output and skip
past anything up to the start of the non-empty free box.
2025-11-04 10:23:31 +00:00
James Almer
a979c9b935 tests/ffmpeg: add test for HEIF automatic tile merging
Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-30 11:02:01 -03:00
Lynne
aeb9b19ebc lavu: add support for Panasonic V-Log 2025-10-28 20:46:21 +01:00
James Almer
08c94518c9 avfilter/vsrc_testsrc: add support for YUV444P1{0,2}MSB to yuvtestsrc
Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-28 19:16:58 +00:00
Lynne
bc0ee8b7cc swscale: add support for 10/12-bit 422 and 444 MSB pixfmts 2025-10-27 22:59:41 -03:00
Lynne
a5be0ecbfd swscale: add support for 10/12-bit grayscale MSB pixfmts 2025-10-27 22:59:40 -03:00
Lynne
e42c7698f5 lavu/pixfmt: add 420 and 422, 10 and 12-bit MSB padded variants
Vulkan has defined all its 3-plane formats as MSB padded.
2025-10-27 22:59:39 -03:00
Lynne
ed5b694ebe lavu/pixfmt: add grayscale 10 and 12-bit MSB padded variants 2025-10-27 22:58:21 -03:00
Ayose
016d767c8e lavfi: add drawvg video filter.
The drawvg filter can draw vector graphics on top of a video, using libcairo. It
is enabled if FFmpeg is configured with `--enable-cairo`.

The language for drawvg scripts is documented in `doc/drawvg-reference.texi`.

There are two new tests:

- `fate-filter-drawvg-interpreter` launch a script with most commands, and
  verify which libcairo functions are executed.
- `fate-filter-drawvg-video` render a very simple image, just to verify that
  libcairo is working as expected.

Signed-off-by: Ayose <ayosec@gmail.com>
2025-10-25 13:21:50 +00:00
Kacper Michajłow
c5edd125f4 tests/ref/fate: remove leftover mapchan ref files
Those tests were removed in e48055fdce.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-10-25 11:11:41 +02:00
Kacper Michajłow
51762c956c tests/ref/fate/iirfilter: remove leftover ref file
Test doesn't exist anymore.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-10-25 11:11:41 +02:00
Kacper Michajłow
df7b6b23ff tests/fate/filter-atempo: remove leftover ref file
Test was onverted to oneoff in 6cde03739e.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-10-25 11:11:41 +02:00
Baptiste Coudurier
0b0cb7cd6c lavf/movenc: improve AVdh atom generation for DNxHD/DNxHR 2025-10-24 00:16:21 +00:00
Zhao Zhili
cd4b01707d Revert "avformat/movenc: sidx earliest_presentation_time is applied after editlist"
This reverts commit 301141b576.

cluster[0].dts, pts and frag_info[0].time are already in presentation
timeline, so they shouldn't be shift by start_pts.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-10-16 11:22:37 +08:00
James Almer
660983b7f3 avformat/mccenc: use Lavf version string instead of FFmpeg
The muxed subtitle is created by libavformat, and as such that's what should be
reported. This is in line with the string we write for every other muxer.
After this change, the muxer will no longer be recompiled every time a commit
is made.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-06 11:51:50 -03:00
James Almer
9b709532d5 avformat/demux: don't overwrite container level color information if set
If the information is coded at the container level, then that's what should be
exported. The user will still have access to values coded at the bitstream
level by firing a decoder.

Fixes issue #20121

Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-05 13:22:17 -03:00
Romain Beauxis
cb4052beae libavformat/oggparseopus.c: Parse comments from secondary chained streams header packet. 2025-10-01 14:20:55 +00:00
Romain Beauxis
45d7d5d3e2 libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg packets, add them to ogg stream
new_metadata.
2025-10-01 14:20:55 +00:00
Romain Beauxis
7dbf7d2a45 libavformat/oggdec.c: Use AV_PKT_DATA_STRINGS_METADATA to pass metadata updates. 2025-10-01 14:20:55 +00:00
Romain Beauxis
de8d57e4c5 ogg/vorbis: implement header packet skip in chained ogg bitstreams. 2025-10-01 14:20:55 +00:00
Paul B Mahol
e0638cee0a avcodec/adpcm: improve decooding output for 4-bit ADPCM IMA WAV
(cherry picked from commit f11422f1a6251e2b3c42b4044efbc722b863778d)
2025-09-22 23:46:29 +00:00
Zhao Zhili
e02e6d54b0 tests/fate/demux: add hxvs test case 2025-09-21 17:42:19 +08:00
James Almer
c6297b689f tests/fate/image: add Exif rotation metadata tests
Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-17 02:17:09 +00:00
James Almer
796b3ba63b tests/fate/prores: add a probe test
Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-16 15:42:03 -03:00
Jan Ekström
af35a13f6d avformat/movenc: add support for fragmented TTML muxing
Attempts to base the fragmentation timing on other streams
as most receivers expect media fragments to be more or less
aligned.

Currently does not support fragmentation on subtitle track
only, as the subtitle packet queue timings would have to be
checked in addition to the current fragmentation timing logic.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2025-09-16 16:29:48 +03:00