[FFmpeg-cvslog] tests/fate/matroska: Add container cropping test
Andreas Rheinhardt
git at videolan.org
Mon May 19 04:28:24 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri May 16 15:37:02 2025 +0200| [bd2dcfaed478740dc9b0e467849535bc3426950c] | committer: Andreas Rheinhardt
tests/fate/matroska: Add container cropping test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd2dcfaed478740dc9b0e467849535bc3426950c
---
tests/fate/matroska.mak | 12 ++++++++
tests/ref/fate/matroska-crop | 70 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+)
diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index 563d756485..b00d19942d 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -100,6 +100,18 @@ fate-matroska-non-rotation-displaymatrix: CMD = transcode mov $(TARGET_SAMPLES)/
"-c copy" \
"-show_entries stream_side_data_list"
+# This test tests container cropping. The expected output is that
+# only the copied streams have cropping (and displaymatrix) side data
+# and that stream #1 (for which applying cropping was not disabled)
+# and the reencoded stream #2 decode to the same.
+FATE_MATROSKA_FFMPEG_FFPROBE-$(call TRANSCODE, UTVIDEO, MATROSKA, MOV_DEMUXER HEVC_DECODER) \
+ += fate-matroska-crop
+fate-matroska-crop: CMD = transcode mov $(TARGET_SAMPLES)/heif-conformance/MIAF007.heic matroska \
+ "-map 0:0 -map 0:0 -map 0:0 -c:0 copy -c:1 copy -c:2 utvideo" \
+ "-map 0" \
+ "-show_entries stream=index,codec_name,width,height:stream_side_data_list" "" \
+ "-apply_cropping:0 none"
+
# This tests DOVI (reading from MP4 and Matroska and writing to Matroska)
# as well as writing the Cues at the front (by shifting data) if
# the initially reserved amount of space turns out to be insufficient.
diff --git a/tests/ref/fate/matroska-crop b/tests/ref/fate/matroska-crop
new file mode 100644
index 0000000000..12a863942c
--- /dev/null
+++ b/tests/ref/fate/matroska-crop
@@ -0,0 +1,70 @@
+fc4932f90dfc955b55cfbdbb210fdd16 *tests/data/fate/matroska-crop.matroska
+355698 tests/data/fate/matroska-crop.matroska
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 720x1280
+#sar 0: 0/1
+#tb 1: 1/1
+#media_type 1: video
+#codec_id 1: rawvideo
+#dimensions 1: 360x640
+#sar 1: 0/1
+#tb 2: 1/1
+#media_type 2: video
+#codec_id 2: rawvideo
+#dimensions 2: 360x640
+#sar 2: 0/1
+0, 0, 0, 1, 1382400, 0xc8267e89
+1, 0, 0, 1, 345600, 0x84b4bdaa
+2, 0, 0, 1, 345600, 0x84b4bdaa
+[STREAM]
+index=0
+codec_name=hevc
+width=1280
+height=720
+[SIDE_DATA]
+side_data_type=Frame Cropping
+crop_top=180
+crop_bottom=180
+crop_left=320
+crop_right=320
+[/SIDE_DATA]
+[SIDE_DATA]
+side_data_type=Display Matrix
+displaymatrix=
+00000000: 0 65536 0
+00000001: 65536 0 0
+00000002: 0 0 1073741824
+
+rotation=-90
+[/SIDE_DATA]
+[/STREAM]
+[STREAM]
+index=1
+codec_name=hevc
+width=1280
+height=720
+[SIDE_DATA]
+side_data_type=Frame Cropping
+crop_top=180
+crop_bottom=180
+crop_left=320
+crop_right=320
+[/SIDE_DATA]
+[SIDE_DATA]
+side_data_type=Display Matrix
+displaymatrix=
+00000000: 0 65536 0
+00000001: 65536 0 0
+00000002: 0 0 1073741824
+
+rotation=-90
+[/SIDE_DATA]
+[/STREAM]
+[STREAM]
+index=2
+codec_name=utvideo
+width=360
+height=640
+[/STREAM]
More information about the ffmpeg-cvslog
mailing list