PR #25570 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25570
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25570.patch

# Summary of changes

Briefly describe what this PR does and why.

<!--
If this PR requires new FATE test samples, attach them to the PR and
list their target paths below (relative to the fate-suite root).

Attached filenames must match the sample's filename:

```fate-samples
# e.g. vorbis/new-sample.ogg
```
-->



From 687cffbaddcc0a95ef0efac9ca5603065e380de2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 23:40:14 +0100
Subject: [PATCH 1/7] fate/aac: pipe the channel layout encodes into ffprobe
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Each GEN rule wrote an adts file that only one probe test read. Pipe
the encode straight into the probe instead.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/aac.mak | 86 +++++++---------------------------------------
 1 file changed, 12 insertions(+), 74 deletions(-)

diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
index 802c00784ae..7bc9780fed3 100644
--- a/tests/fate/aac.mak
+++ b/tests/fate/aac.mak
@@ -279,84 +279,22 @@ fate-aac-nmr-abr-encode: REF = 
$(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s
 fate-aac-nmr-abr-encode: CMP_TARGET = 451
 fate-aac-nmr-abr-encode: FUZZ = 15
 
-tests/data/fate/aac-5_1_2.adts: TAG = GEN
-tests/data/fate/aac-5_1_2.adts: tests/data/asynth-44100-8.wav
-tests/data/fate/aac-5_1_2.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "5.1.2(back)" -i 
$(TARGET_PATH)/tests/data/asynth-44100-8.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-5_1_4.adts: TAG = GEN
-tests/data/fate/aac-5_1_4.adts: tests/data/asynth-44100-10.wav
-tests/data/fate/aac-5_1_4.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "5.1.4" -i $(TARGET_PATH)/tests/data/asynth-44100-10.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-7_1_2.adts: TAG = GEN
-tests/data/fate/aac-7_1_2.adts: tests/data/asynth-44100-10.wav
-tests/data/fate/aac-7_1_2.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "7.1.2" -i $(TARGET_PATH)/tests/data/asynth-44100-10.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-5_1_6.adts: TAG = GEN
-tests/data/fate/aac-5_1_6.adts: tests/data/asynth-44100-12.wav
-tests/data/fate/aac-5_1_6.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "5.1.6" -i $(TARGET_PATH)/tests/data/asynth-44100-12.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-7_2_3.adts: TAG = GEN
-tests/data/fate/aac-7_2_3.adts: tests/data/asynth-44100-12.wav
-tests/data/fate/aac-7_2_3.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "7.2.3" -i $(TARGET_PATH)/tests/data/asynth-44100-12.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-7_1_4.adts: TAG = GEN
-tests/data/fate/aac-7_1_4.adts: tests/data/asynth-44100-12.wav
-tests/data/fate/aac-7_1_4.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "7.1.4" -i $(TARGET_PATH)/tests/data/asynth-44100-12.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-7_1_6.adts: TAG = GEN
-tests/data/fate/aac-7_1_6.adts: tests/data/asynth-44100-14.wav
-tests/data/fate/aac-7_1_6.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "7.1.6" -i $(TARGET_PATH)/tests/data/asynth-44100-14.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-9_1_4.adts: TAG = GEN
-tests/data/fate/aac-9_1_4.adts: tests/data/asynth-44100-14.wav
-tests/data/fate/aac-9_1_4.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "9.1.4" -i $(TARGET_PATH)/tests/data/asynth-44100-14.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
-tests/data/fate/aac-9_1_6.adts: TAG = GEN
-tests/data/fate/aac-9_1_6.adts: tests/data/asynth-44100-16.wav
-tests/data/fate/aac-9_1_6.adts: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -ch_layout "9.1.6" -i $(TARGET_PATH)/tests/data/asynth-44100-16.wav \
-       -c:a aac -aac_pce 1 -aframes 5 -f adts -y $(TARGET_PATH)/$@ 2>/dev/null
-
 define FATE_AAC_LAYOUT_TEST
 FATE_AAC_ENCODE_FFPROBE += fate-aac-encode-$(1)
-fate-aac-encode-$(1): tests/data/fate/aac-$(1).adts
-fate-aac-encode-$(1): CMD = probe -show_entries 
stream=codec_name,channel_layout $(TARGET_PATH)/tests/data/fate/aac-$(1).adts
+fate-aac-encode-$(1): tests/data/asynth-44100-$(3).wav
+fate-aac-encode-$(1): CMD = ffmpeg -auto_conversion_filters -ch_layout "$(2)" 
-i $(TARGET_PATH)/tests/data/asynth-44100-$(3).wav \
+    -c:a aac -aac_pce 1 -aframes 5 -f adts - | probe -count_packets 
-show_entries stream=codec_name,channel_layout pipe:
 endef
 
-$(eval $(call FATE_AAC_LAYOUT_TEST,5_1_2))
-$(eval $(call FATE_AAC_LAYOUT_TEST,5_1_4))
-$(eval $(call FATE_AAC_LAYOUT_TEST,5_1_6))
-$(eval $(call FATE_AAC_LAYOUT_TEST,7_1_2))
-$(eval $(call FATE_AAC_LAYOUT_TEST,7_1_4))
-$(eval $(call FATE_AAC_LAYOUT_TEST,7_1_6))
-$(eval $(call FATE_AAC_LAYOUT_TEST,7_2_3))
-$(eval $(call FATE_AAC_LAYOUT_TEST,9_1_4))
-$(eval $(call FATE_AAC_LAYOUT_TEST,9_1_6))
+$(eval $(call FATE_AAC_LAYOUT_TEST,5_1_2,5.1.2(back),8))
+$(eval $(call FATE_AAC_LAYOUT_TEST,5_1_4,5.1.4,10))
+$(eval $(call FATE_AAC_LAYOUT_TEST,5_1_6,5.1.6,12))
+$(eval $(call FATE_AAC_LAYOUT_TEST,7_1_2,7.1.2,10))
+$(eval $(call FATE_AAC_LAYOUT_TEST,7_1_4,7.1.4,12))
+$(eval $(call FATE_AAC_LAYOUT_TEST,7_1_6,7.1.6,14))
+$(eval $(call FATE_AAC_LAYOUT_TEST,7_2_3,7.2.3,12))
+$(eval $(call FATE_AAC_LAYOUT_TEST,9_1_4,9.1.4,14))
+$(eval $(call FATE_AAC_LAYOUT_TEST,9_1_6,9.1.6,16))
 
 FATE_AAC_LATM += fate-aac-latm_000000001180bc60
 fate-aac-latm_000000001180bc60: CMD = pcm -i 
$(TARGET_SAMPLES)/aac/latm_000000001180bc60.mpg
-- 
2.54.0


From 9b495f718e04bd838afccab9011d513fd8f4962c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 23:42:14 +0100
Subject: [PATCH 2/7] fate/ac3: pipe the dexp24 and dither encodes into the
 decode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Both GEN rules wrote an ac3 file that only one test decoded. Pipe the
encode straight into the decode instead.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/ac3.mak | 32 ++++++++++----------------------
 1 file changed, 10 insertions(+), 22 deletions(-)

diff --git a/tests/fate/ac3.mak b/tests/fate/ac3.mak
index 605a411799d..4e211475c17 100644
--- a/tests/fate/ac3.mak
+++ b/tests/fate/ac3.mak
@@ -160,24 +160,16 @@ fate-ac3-fixed-encode-3: CMD = framecrc -i $(SRC) -c:a 
ac3_fixed -flags2 +fixed_
 
 # With coupling and rematrixing disabled, this produces bap=0, dexp=24 bins
 # whose dither affects the decoded output.
-tests/data/fate/ac3-fixed-dexp24.ac3: TAG = GEN
-tests/data/fate/ac3-fixed-dexp24.ac3: tests/data/asynth-44100-2.wav
-tests/data/fate/ac3-fixed-dexp24.ac3: ffmpeg$(PROGSSUF)$(EXESUF) | 
tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
-       -hide_banner -loglevel error -nostdin \
-       -i $(TARGET_PATH)/tests/data/asynth-44100-2.wav \
-       -c:a ac3_fixed -b:a 192k \
-       -channel_coupling 0 -stereo_rematrixing 0 -flags +bitexact \
-       -frames:a 173 -f ac3 -y $(TARGET_PATH)/$@
-
 FATE_AC3_FIXED_DEXP24-$(call ALLYES, FFMPEG WAV_DEMUXER ARESAMPLE_FILTER 
ATRIM_FILTER \
                                     AC3_FIXED_ENCODER FRAMECRC_MUXER \
                                     AC3_MUXER AC3_DEMUXER AC3_FIXED_DECODER \
                                     PCM_S16LE_DECODER PCM_S16LE_ENCODER \
-                                    FILE_PROTOCOL) += fate-ac3-fixed-dexp24
-fate-ac3-fixed-dexp24: tests/data/fate/ac3-fixed-dexp24.ac3
-fate-ac3-fixed-dexp24: CMD = framecrc -auto_conversion_filters -c ac3_fixed \
-                                   -i 
$(TARGET_PATH)/tests/data/fate/ac3-fixed-dexp24.ac3 \
+                                    FILE_PROTOCOL PIPE_PROTOCOL) += 
fate-ac3-fixed-dexp24
+fate-ac3-fixed-dexp24: tests/data/asynth-44100-2.wav
+fate-ac3-fixed-dexp24: CMD = ffmpeg -auto_conversion_filters -i 
$(TARGET_PATH)/tests/data/asynth-44100-2.wav \
+                                   -c:a ac3_fixed -b:a 192k -channel_coupling 
0 -stereo_rematrixing 0 \
+                                   -flags +bitexact -frames:a 173 -f ac3 - | \
+                             framecrc -auto_conversion_filters -c ac3_fixed -i 
- \
                                    -af atrim=start_sample=264192
 
 # digital silence encoded with the bitexact fixed-point encoder must decode
@@ -185,12 +177,6 @@ fate-ac3-fixed-dexp24: CMD = framecrc 
-auto_conversion_filters -c ac3_fixed \
 # The former truncating dequantization (mantissa >> exp) collapsed the dither
 # mantissas to coarse {-1, 0} steps, raising the decoded noise floor by a
 # factor of ~7 (stddev 18.22 instead of 2.69, tiny_psnr f32 units).
-tests/data/fate/ac3-silence.ac3: TAG = GEN
-tests/data/fate/ac3-silence.ac3: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-       -f lavfi -i anullsrc=r=44100:cl=stereo -t 1 \
-       -c:a ac3_fixed -b:a 192k -flags +bitexact -f ac3 -y $(TARGET_PATH)/$@ 
2>/dev/null
-
 tests/data/fate/ac3-silence.f32: TAG = GEN
 tests/data/fate/ac3-silence.f32: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data/fate
        $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
@@ -201,8 +187,10 @@ FATE_AC3_DITHER-$(call ALLYES, FFMPEG LAVFI_INDEV 
ANULLSRC_FILTER ATRIM_FILTER \
                                ARESAMPLE_FILTER AC3_FIXED_ENCODER AC3_MUXER \
                                AC3_DEMUXER AC3_DECODER PCM_F32LE_ENCODER \
                                PCM_F32LE_MUXER FILE_PROTOCOL PIPE_PROTOCOL) += 
fate-ac3-float-dither
-fate-ac3-float-dither: tests/data/fate/ac3-silence.ac3 
tests/data/fate/ac3-silence.f32
-fate-ac3-float-dither: CMD = ffmpeg -auto_conversion_filters -cons_noisegen 1 
-i $(TARGET_PATH)/tests/data/fate/ac3-silence.ac3 -af atrim=end_sample=44100 -f 
f32le -
+fate-ac3-float-dither: tests/data/fate/ac3-silence.f32
+fate-ac3-float-dither: CMD = ffmpeg -auto_conversion_filters -f lavfi -i 
anullsrc=r=44100:cl=stereo -t 1 \
+                             -c:a ac3_fixed -b:a 192k -flags +bitexact -f ac3 
- | \
+                         ffmpeg -auto_conversion_filters -cons_noisegen 1 -i - 
-af atrim=end_sample=44100 -f f32le -
 fate-ac3-float-dither: CMP = stddev
 fate-ac3-float-dither: CMP_UNIT = f32
 fate-ac3-float-dither: REF = tests/data/fate/ac3-silence.f32
-- 
2.54.0


From 05d4144c1f492c98efddc81af84744d79a8c8821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 23:42:58 +0100
Subject: [PATCH 3/7] fate/rtsp: pipe the SDP descriptions into ffprobe
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The sample rate tests wrote each description to a file only to probe
it. Pipe it into ffprobe instead, with -f sdp, as the format was found
by the file extension before.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/rtsp.mak | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tests/fate/rtsp.mak b/tests/fate/rtsp.mak
index 473f592c661..83bc1ac8878 100644
--- a/tests/fate/rtsp.mak
+++ b/tests/fate/rtsp.mak
@@ -1,4 +1,4 @@
-FATE_RTSP_FFPROBE-$(call ALLYES, SDP_DEMUXER FILE_PROTOCOL) \
+FATE_RTSP_FFPROBE-$(call ALLYES, SDP_DEMUXER PIPE_PROTOCOL) \
                                += fate-rtsp-sdp-sample-rate \
                                   fate-rtsp-sdp-sample-rate-leading-zero \
                                   fate-rtsp-sdp-sample-rate-negative \
@@ -14,15 +14,12 @@ FATE_RTSP_FFPROBE-$(call ALLYES, SDP_DEMUXER FILE_PROTOCOL) 
\
 # from opening a transport, which keeps these tests offline.
 SDP_SAMPLE_RATE_HEAD = v=0\no=- 0 0 IN IP4 127.0.0.1\ns=SampleRate\nc=IN IP4 
127.0.0.1\nt=0 0\nm=audio 5004 RTP/AVP 97\na=rtpmap:97 L16/44100/1\n
 SDP_SAMPLE_RATE_PROBE = run ffprobe$(PROGSSUF)$(EXESUF) -v error \
-    -sdp_flags custom_io -protocol_whitelist file \
+    -f sdp -sdp_flags custom_io -protocol_whitelist pipe \
     -analyzeduration 0 -probesize 32 \
     -show_entries stream=sample_rate -print_format compact
 
 define FATE_SDP_SAMPLE_RATE_CMD
-    cleanfiles="$${cleanfiles} $${outfile}.sdp"; \
-    printf "$(SDP_SAMPLE_RATE_HEAD)a=SampleRate:integer;$(1)\n" \
-        > "$${outfile}.sdp"; \
-    $(SDP_SAMPLE_RATE_PROBE) "$$(target_path "$${outfile}.sdp")"
+    printf "$(SDP_SAMPLE_RATE_HEAD)a=SampleRate:integer;$(1)\n" | 
$(SDP_SAMPLE_RATE_PROBE) pipe:
 endef
 
 # A valid attribute must be applied, otherwise the tests below would pass
-- 
2.54.0


From 31c6ccdb7ee920fcaee29a62aa6b513a4902953b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 23:44:20 +0100
Subject: [PATCH 4/7] fate/matroska: pipe the stereo3d override and metadata
 tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The metadata test wrote its matroska files to tests/data/fate and
deleted them by hand, the override test went through run_with_temp.
Pipe the encode, the remux and the probe instead.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/matroska.mak | 47 ++++++++++++++++++-----------------------
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index f165ce19476..77d601a87c7 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -356,49 +356,42 @@ fate-matroska-stereo3d-sbs: CMD = transcode rawvideo 
$(TARGET_PATH)/tests/data/v
   "-c:v mpeg4 -qscale:v 10 -stereo3d:v sbsl -frames:v 2" \
   "-c:v copy" "-show_entries stream_side_data_list" "" "" "-s 352x288 -pix_fmt 
yuv420p"
 
+MATROSKA_STEREO3D_PROBE = probe -v error -count_packets \
+  -show_entries stream=index:stream_tags=stereo_mode:stream_side_data_list -of 
default=nw=1 pipe:
+
 # The global stereo_mode fallback must keep applying to output streams that
 # do not have -stereo3d.
-FATE_MATROSKA_STEREO3D-$(call ALLYES, FILE_PROTOCOL RAWVIDEO_DEMUXER 
RAWVIDEO_DECODER \
+FATE_MATROSKA_STEREO3D-$(call ALLYES, FILE_PROTOCOL PIPE_PROTOCOL 
RAWVIDEO_DEMUXER RAWVIDEO_DECODER \
                                                        MPEG4_ENCODER 
MATROSKA_MUXER MATROSKA_DEMUXER) \
                        += fate-matroska-stereo3d-override
 fate-matroska-stereo3d-override: tests/data/vsynth1.yuv
-fate-matroska-stereo3d-override: CMD = run_with_temp \
-  "$(FFMPEG) -nostdin -nostats -bitexact -s 352x288 -pix_fmt yuv420p \
-   -f rawvideo -i $(TARGET_PATH)/tests/data/vsynth1.yuv -frames:v 2 \
-   -map 0:v -map 0:v -c:v mpeg4 -metadata:g stereo_mode=top_bottom \
-   -stereo3d:v:0 sbsl -f matroska -y" \
-  "ffprobe${PROGSUF}${EXESUF} -v error -bitexact \
-   -show_entries stream=index:stream_tags=stereo_mode:stream_side_data_list \
-   -of default=nw=1" mkv
+fate-matroska-stereo3d-override: CMD = \
+  ffmpeg -bitexact -s 352x288 -pix_fmt yuv420p -f rawvideo -i 
$(TARGET_PATH)/tests/data/vsynth1.yuv -frames:v 2 \
+   -map 0:v -map 0:v -c:v mpeg4 -metadata:g stereo_mode=top_bottom 
-stereo3d:v:0 sbsl -f matroska - | \
+  $(MATROSKA_STEREO3D_PROBE)
+
+MATROSKA_STEREO3D_TAGGED = ffmpeg -bitexact -s 352x288 -pix_fmt yuv420p -f 
rawvideo \
+  -i $(TARGET_PATH)/tests/data/vsynth1.yuv -frames:v 2 -c:v mpeg4 \
+  -metadata:s:v:0 stereo_mode=top_bottom -f matroska -
 
 # A stereo_mode tag inherited from the input must not win over -stereo3d,
 # while an explicitly requested tag still describes the layout.
-FATE_MATROSKA_STEREO3D-$(call ALLYES, FILE_PROTOCOL RAWVIDEO_DEMUXER 
RAWVIDEO_DECODER \
+FATE_MATROSKA_STEREO3D-$(call ALLYES, FILE_PROTOCOL PIPE_PROTOCOL 
RAWVIDEO_DEMUXER RAWVIDEO_DECODER \
                                                        MPEG4_ENCODER 
MATROSKA_MUXER MATROSKA_DEMUXER) \
                        += fate-matroska-stereo3d-metadata
 fate-matroska-stereo3d-metadata: tests/data/vsynth1.yuv
 fate-matroska-stereo3d-metadata: CMP = diff
 fate-matroska-stereo3d-metadata: REF = 
$(SRC_PATH)/tests/ref/fate/matroska-stereo3d-metadata
-fate-matroska-stereo3d-metadata: CMD = 
tmp=tests/data/fate/matroska-stereo3d-metadata.mkv; \
-  out=$$tmp-out.mkv; \
-  ffmpeg -bitexact -s 352x288 -pix_fmt yuv420p -f rawvideo \
-   -i $(TARGET_PATH)/tests/data/vsynth1.yuv -frames:v 2 -c:v mpeg4 \
-   -metadata:s:v:0 stereo_mode=top_bottom -f matroska -y $$tmp && \
+fate-matroska-stereo3d-metadata: CMD = \
   echo "option over inherited tag:" && \
-  ffmpeg -y -i $$tmp -c copy -stereo3d:v:0 sbsl -f matroska -y $$out && \
-  probe -v error -show_entries 
stream=index:stream_tags=stereo_mode:stream_side_data_list \
-   -of default=nw=1 $$out && \
+  $(MATROSKA_STEREO3D_TAGGED) | ffmpeg -i - -c copy -stereo3d:v:0 sbsl -f 
matroska - | \
+  $(MATROSKA_STEREO3D_PROBE) && \
   echo "explicit tag:" && \
-  ffmpeg -y -i $$tmp -c copy -metadata:s:v:0 stereo_mode=right_left \
-   -f matroska -y $$out && \
-  probe -v error -show_entries 
stream=index:stream_tags=stereo_mode:stream_side_data_list \
-   -of default=nw=1 $$out && \
+  $(MATROSKA_STEREO3D_TAGGED) | ffmpeg -i - -c copy -metadata:s:v:0 
stereo_mode=right_left -f matroska - | \
+  $(MATROSKA_STEREO3D_PROBE) && \
   echo "empty tag:" && \
-  ffmpeg -y -i $$tmp -c copy -stereo3d:v:0 tb -metadata:s:v:0 stereo_mode= \
-   -f matroska -y $$out && \
-  probe -v error -show_entries 
stream=index:stream_tags=stereo_mode:stream_side_data_list \
-   -of default=nw=1 $$out; \
-  ret=$$?; rm -f $$tmp $$out; test $$ret -eq 0
+  $(MATROSKA_STEREO3D_TAGGED) | ffmpeg -i - -c copy -stereo3d:v:0 tb 
-metadata:s:v:0 stereo_mode= -f matroska - | \
+  $(MATROSKA_STEREO3D_PROBE)
 
 FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes)
 FATE_SAMPLES_FFPROBE += $(FATE_MATROSKA_FFPROBE-yes)
-- 
2.54.0


From d1751646a655647079d001fb0437dd446f488213 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 23:45:36 +0100
Subject: [PATCH 5/7] fate/demux: pipe the crafted VPK header into ffmpeg
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The GEN rule wrote the 21 bytes to a file that only this test read.
Print them straight into ffmpeg instead.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/demux.mak | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index d4ac666f810..e49124c05de 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -240,13 +240,8 @@ fate-jxs-concat-demux: CMD = framecrc "-i 
concat:$(TARGET_SAMPLES)/jxs/lena.jxs|
 # fails. After find_stream_info the layout must stay 80, not 0.
 # ffprobe cannot be used: it aborts on the failed decoder open before
 # printing -show_entries.
-tests/data/vpk-div0.vpk: TAG = GEN
-tests/data/vpk-div0.vpk: | tests/data
-       $(Q)printf 
'\040\113\120\126\126\120\000\370\004\000\073\003\141\071\126\062\066\066\060\070\120'
 > $@
-
-FATE_FFMPEG-$(call ALLYES, VPK_DEMUXER ADPCM_PSX_DECODER FILE_PROTOCOL 
NULL_MUXER) += fate-demux-vpk-div0
-fate-demux-vpk-div0: tests/data/vpk-div0.vpk
-fate-demux-vpk-div0: CMD = ffmpeg -i $(TARGET_PATH)/tests/data/vpk-div0.vpk 
-map 0 -c copy -f null -
+FATE_FFMPEG-$(call ALLYES, VPK_DEMUXER ADPCM_PSX_DECODER PIPE_PROTOCOL 
NULL_MUXER) += fate-demux-vpk-div0
+fate-demux-vpk-div0: CMD = printf 
"\040\113\120\126\126\120\000\370\004\000\073\003\141\071\126\062\066\066\060\070\120"
 | ffmpeg -i - -map 0 -c copy -f null -
 fate-demux-vpk-div0: CMP = grep
 fate-demux-vpk-div0: REF = 80 channels
 
-- 
2.54.0


From e4be842fbbba55defc385ca6f4dc19bf22bf2c28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 23:45:37 +0100
Subject: [PATCH 6/7] fate/voice: pipe the zero G.723.1 frame into the
 comfortnoise decode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The GEN rule wrote the 24 zero bytes to a file that only this test
read. Pipe them straight into the decode instead.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/voice.mak | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/tests/fate/voice.mak b/tests/fate/voice.mak
index 6def61689c5..a4e49614235 100644
--- a/tests/fate/voice.mak
+++ b/tests/fate/voice.mak
@@ -99,19 +99,13 @@ fate-truespeech: REF = $(SAMPLES)/truespeech/a6.pcm
 # The bug causes positive float values to overflow to negative integer values
 # during clipping, resulting in massive negative bias (RMS near 0dB).
 # The fixed version clips correctly, resulting in quieter output (RMS < -3dB).
-tests/data/g723_1-comfortnoise-overflow.bin: TAG = GEN
-tests/data/g723_1-comfortnoise-overflow.bin: ffmpeg$(PROGSSUF)$(EXESUF) | 
tests/data
-       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-           -lavfi nullsrc=s=4x4,format=yuv420p,geq=lum=0:cb=0:cr=0 \
-           -vframes 1 -f rawvideo -y $(TARGET_PATH)/$@ 2>/dev/null
-
 FATE_VOICE-$(call FILTERDEMDECENCMUX, ASTATS NULLSRC FORMAT GEQ, G723_1, \
                                       COMFORTNOISE WRAPPED_AVFRAME, PCM_S16LE 
RAWVIDEO, \
-                                      NULL RAWVIDEO, LAVFI_INDEV) += 
fate-comfortnoise
-fate-comfortnoise: tests/data/g723_1-comfortnoise-overflow.bin
+                                      NULL RAWVIDEO, LAVFI_INDEV 
PIPE_PROTOCOL) += fate-comfortnoise
 fate-comfortnoise: CMP = grep
 fate-comfortnoise: REF = RMS level dB: \(-[3-9]\|-[1-9][0-9]\)
-fate-comfortnoise: CMD = ffmpeg -f g723_1 -codec:a comfortnoise -i 
$(TARGET_PATH)/tests/data/g723_1-comfortnoise-overflow.bin -af astats -c:a 
pcm_s16le -f null -
+fate-comfortnoise: CMD = ffmpeg -lavfi 
nullsrc=s=4x4,format=yuv420p,geq=lum=0:cb=0:cr=0 -vframes 1 -f rawvideo - | \
+    ffmpeg -f g723_1 -codec:a comfortnoise -i - -af astats -c:a pcm_s16le -f 
null -
 
 FATE_SAMPLES_FFMPEG += $(FATE_VOICE-yes)
 fate-voice: $(FATE_VOICE-yes)
-- 
2.54.0


From 8c92975aca6be19b909e7c9937b70ffc67884b18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 28 Oct 2026 23:53:51 +0100
Subject: [PATCH 7/7] fate/astc: pipe the KTX header and HDR reject outputs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The header test wrote two KTX files only to read a few header fields,
the reject test wrote a file it expects to fail. Pipe the header test's
output into od, which dumps the fields from glInternalFormat to the
mipmap level count, and send the reject test's output to stdout.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 tests/fate/astc.mak            | 23 +++++------------------
 tests/ref/fate/astc-ktx-header | 10 ++++------
 2 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/tests/fate/astc.mak b/tests/fate/astc.mak
index 665043e56a9..7b4d4085fee 100644
--- a/tests/fate/astc.mak
+++ b/tests/fate/astc.mak
@@ -29,24 +29,12 @@ fate-astc-ktx: CMD = transcode lavfi "testsrc=size=128x128" 
ktx \
 
 # Check the KTX enum and single-level header fields directly rather than only
 # through the FFmpeg KTX demuxer, which could mirror the muxer's mistake.
-FATE_ASTC-$(call ENCMUX, LIBASTCENC, KTX, LAVFI_INDEV WRAPPED_AVFRAME_DECODER 
TESTSRC_FILTER FILE_PROTOCOL) += fate-astc-ktx-header
+FATE_ASTC-$(call ENCMUX, LIBASTCENC, KTX, LAVFI_INDEV WRAPPED_AVFRAME_DECODER 
TESTSRC_FILTER PIPE_PROTOCOL) += fate-astc-ktx-header
 fate-astc-ktx-header: CMD = \
-    cleanfiles="$${cleanfiles} $${outfile}.linear.ktx $${outfile}.srgb.ktx"; \
-    linear="$$(target_path "$${outfile}.linear.ktx")"; \
-    srgb="$$(target_path "$${outfile}.srgb.ktx")"; \
-    read_le32() { \
-        od -An -tx1 -j "$$2" -N 4 "$$1" | tr -d "[:space:]"; \
-    }; \
     ffmpeg -f lavfi -i "testsrc=size=16x16" -frames:v 1 -c:v libastcenc 
-block_size 8x8 -profile:v ldr -srgb 0 \
-        -f ktx -y "$$linear" && \
+        -f ktx - | od -An -tx1 -v -j 28 | sed -n 1,2p && \
     ffmpeg -f lavfi -i "testsrc=size=16x16" -frames:v 1 -c:v libastcenc 
-block_size 8x8 -profile:v ldr-srgb -srgb 1 \
-        -f ktx -y "$$srgb" && \
-    printf "linear glInternalFormat: " && read_le32 "$${outfile}.linear.ktx" 
28 && printf "\n" && \
-    printf "linear faces: " && read_le32 "$${outfile}.linear.ktx" 52 && printf 
"\n" && \
-    printf "linear mipmap levels: " && read_le32 "$${outfile}.linear.ktx" 56 
&& printf "\n" && \
-    printf "srgb glInternalFormat: " && read_le32 "$${outfile}.srgb.ktx" 28 && 
printf "\n" && \
-    printf "srgb faces: " && read_le32 "$${outfile}.srgb.ktx" 52 && printf 
"\n" && \
-    printf "srgb mipmap levels: " && read_le32 "$${outfile}.srgb.ktx" 56 && 
printf "\n"
+        -f ktx - | od -An -tx1 -v -j 28 | sed -n 1,2p
 
 # The KTX linear GL enum fixes the colour space but not the endpoint format, 
so a
 # linear texture may hold HDR endpoints and must be sampled with HDR precision 
by
@@ -141,14 +129,13 @@ fate-astc-3d:  CMD = transcode lavfi "testsrc=size=64x64" 
astc \
 # and the specific "Writing HDR ASTC to KTX 1.0 is not supported" message.
 # The command asserts the non-zero exit status, and CMP = grep asserts the
 # diagnostic.
-FATE_ASTC-$(call ENCMUX, LIBASTCENC, KTX, LAVFI_INDEV WRAPPED_AVFRAME_DECODER 
TESTSRC_FILTER FORMAT_FILTER SCALE_FILTER FILE_PROTOCOL) += 
fate-astc-ktx-hdr-reject
+FATE_ASTC-$(call ENCMUX, LIBASTCENC, KTX, LAVFI_INDEV WRAPPED_AVFRAME_DECODER 
TESTSRC_FILTER FORMAT_FILTER SCALE_FILTER PIPE_PROTOCOL) += 
fate-astc-ktx-hdr-reject
 fate-astc-ktx-hdr-reject: CMP = grep
 fate-astc-ktx-hdr-reject: REF = Writing HDR ASTC to KTX 1.0 is not supported
 fate-astc-ktx-hdr-reject: CMD = \
-    cleanfiles="$${cleanfiles} $${outfile}.ktx"; \
     ffmpeg -y -f lavfi -i "testsrc=size=128x128,format=gbrapf32" \
     -threads 1 -c:v libastcenc -block_size 8x8 -frames:v 1 \
-    -f ktx "$$(target_path "$${outfile}.ktx")" ; \
+    -f ktx - ; \
     test $$? -ne 0
 
 FATE_ASTC += $(FATE_ASTC-yes)
diff --git a/tests/ref/fate/astc-ktx-header b/tests/ref/fate/astc-ktx-header
index 2d3edeabc9b..f8c1430cb59 100644
--- a/tests/ref/fate/astc-ktx-header
+++ b/tests/ref/fate/astc-ktx-header
@@ -1,6 +1,4 @@
-linear glInternalFormat: b7930000
-linear faces: 01000000
-linear mipmap levels: 01000000
-srgb glInternalFormat: d7930000
-srgb faces: 01000000
-srgb mipmap levels: 01000000
+ b7 93 00 00 08 19 00 00 10 00 00 00 10 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00
+ d7 93 00 00 08 19 00 00 10 00 00 00 10 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to