diff mbox series

[FFmpeg-devel] tests/matroska: Add test for remuxing annex B H.264 into Matroska

Message ID HE1PR0301MB2154120827A573A767C4FD838F7C9@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 0c7d02844cafda542771124c6b6fd4db6308ffbb
Headers show
Series [FFmpeg-devel] tests/matroska: Add test for remuxing annex B H.264 into Matroska
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt March 31, 2021, 7:19 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Will apply this patch tomorrow unless there are objections.

 tests/fate/matroska.mak            | 17 ++++++++
 tests/ref/fate/matroska-h264-remux | 65 ++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+)
 create mode 100644 tests/ref/fate/matroska-h264-remux

Comments

James Almer March 31, 2021, 8:21 p.m. UTC | #1
On 3/31/2021 4:19 PM, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> Will apply this patch tomorrow unless there are objections.
> 
>   tests/fate/matroska.mak            | 17 ++++++++
>   tests/ref/fate/matroska-h264-remux | 65 ++++++++++++++++++++++++++++++
>   2 files changed, 82 insertions(+)
>   create mode 100644 tests/ref/fate/matroska-h264-remux
> 
> diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
> index f6d4bd1199..becca28e1a 100644
> --- a/tests/fate/matroska.mak
> +++ b/tests/fate/matroska.mak
> @@ -90,6 +90,23 @@ FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL MXF_DEMUXER        \
>                                  += fate-matroska-mastering-display-metadata
>   fate-matroska-mastering-display-metadata: CMD = transcode mxf $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf matroska "-map 0 -map 0:0 -c:v:0 copy -c:v:1 ffv1 -c:a:0 copy -bsf:a:0 noise=amount=3 -filter:a:1 aresample -c:a:1 pcm_s16be -bsf:a:1 noise=dropamount=4" "-map 0 -c copy" "" "-show_entries stream_side_data_list:stream=index,codec_name"
>   
> +# This test tests remuxing annex B H.264 into Matroska. It also tests writing
> +# the correct interlaced flags and overriding the sample aspect ratio, leading
> +# to anamorphic video. Given that the input file has lots of filler material,
> +# the h264_metadata filter is used to remove it as well as the H.264 AUD.

Aren't AUD NALUs removed as part of the process of encapsulating Annex B 
into isobmff samples, which Matroska uses? Or are we just passing them 
through by default?

> +# The video is decoded twice to show that this did not change the decoded
> +# output. Furthermore, this also tests writing PCM with bitdepth 32.
> +FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL MPEGTS_DEMUXER       \
> +                                            H264_PARSER MPEGAUDIO_PARSER       \
> +                                            EXTRACT_EXTRADATA_BSF MP2_DECODER  \
> +                                            H264_METADATA_BSF ARESAMPLE_FILTER \
> +                                            RAWVIDEO_ENCODER PCM_S32LE_ENCODER \
> +                                            PCM_S32BE_ENCODER MATROSKA_MUXER   \
> +                                            MATROSKA_DEMUXER H264_DECODER      \
> +                                            FRAMECRC_MUXER PIPE_PROTOCOL)      \
> +                               += fate-matroska-h264-remux
> +fate-matroska-h264-remux: CMD = transcode mpegts $(TARGET_SAMPLES)/h264/h264_intra_first-small.ts matroska "-map 0:0 -map 0 -c:v copy -sar:0 3:4 -bsf:v:1 h264_metadata=aud=remove:delete_filler=1 -disposition:v +hearing_impaired -af aresample -c:a:0 pcm_s32le -c:a:1 pcm_s32be -disposition:a:0 original -metadata:s:a:0 title=swedish_silence -metadata:s:a:1 title=norwegian_silence -disposition:a:1 dub" "-map 0:v" "" "-show_entries stream=index,codec_name:stream_tags=title,language"
> +
>   # Tests writing BlockAdditional and BlockGroups with ReferenceBlock elements;
>   # it also tests setting a track as suitable for hearing impaired.
>   # It also tests the capability of the VP8 parser to set the keyframe flag
> diff --git a/tests/ref/fate/matroska-h264-remux b/tests/ref/fate/matroska-h264-remux
> new file mode 100644
> index 0000000000..14e6758fa0
> --- /dev/null
> +++ b/tests/ref/fate/matroska-h264-remux
> @@ -0,0 +1,65 @@
> +ded6da7e46ce7df1232b116afb0b2f0a *tests/data/fate/matroska-h264-remux.matroska
> +2036083 tests/data/fate/matroska-h264-remux.matroska
> +#tb 0: 1/25
> +#media_type 0: video
> +#codec_id 0: rawvideo
> +#dimensions 0: 1920x1080
> +#sar 0: 3/4
> +#tb 1: 1/25
> +#media_type 1: video
> +#codec_id 1: rawvideo
> +#dimensions 1: 1920x1080
> +#sar 1: 1/1
> +0,         45,         45,        1,  3110400, 0xa426f15d
> +1,         45,         45,        1,  3110400, 0xa426f15d
> +0,         46,         46,        1,  3110400, 0x7066003b
> +1,         46,         46,        1,  3110400, 0x7066003b
> +0,         47,         47,        1,  3110400, 0x7691f2c5
> +1,         47,         47,        1,  3110400, 0x7691f2c5
> +0,         48,         48,        1,  3110400, 0x1bc501d2
> +1,         48,         48,        1,  3110400, 0x1bc501d2
> +0,         49,         49,        1,  3110400, 0xb616ecf1
> +1,         49,         49,        1,  3110400, 0xb616ecf1
> +0,         50,         50,        1,  3110400, 0xa334fb27
> +1,         50,         50,        1,  3110400, 0xa334fb27
> +0,         51,         51,        1,  3110400, 0x1097ea90
> +1,         51,         51,        1,  3110400, 0x1097ea90
> +0,         52,         52,        1,  3110400, 0xbc25f438
> +1,         52,         52,        1,  3110400, 0xbc25f438
> +0,         53,         53,        1,  3110400, 0xcab4f0d9
> +1,         53,         53,        1,  3110400, 0xcab4f0d9
> +0,         54,         54,        1,  3110400, 0xa740f58c
> +1,         54,         54,        1,  3110400, 0xa740f58c
> +0,         55,         55,        1,  3110400, 0x597de7df
> +1,         55,         55,        1,  3110400, 0x597de7df
> +0,         56,         56,        1,  3110400, 0x3b79f58d
> +1,         56,         56,        1,  3110400, 0x3b79f58d
> +0,         57,         57,        1,  3110400, 0x3705eb68
> +1,         57,         57,        1,  3110400, 0x3705eb68
> +0,         58,         58,        1,  3110400, 0x2292f7de
> +1,         58,         58,        1,  3110400, 0x2292f7de
> +0,         59,         59,        1,  3110400, 0x2171e805
> +1,         59,         59,        1,  3110400, 0x2171e805
> +0,         60,         60,        1,  3110400, 0x14a9f258
> +0,         61,         61,        1,  3110400, 0xa545ef91
> +1,         61,         61,        1,  3110400, 0xa545ef91
> +[STREAM]
> +index=0
> +codec_name=h264
> +[/STREAM]
> +[STREAM]
> +index=1
> +codec_name=h264
> +[/STREAM]
> +[STREAM]
> +index=2
> +codec_name=pcm_s32le
> +TAG:language=swe
> +TAG:title=swedish_silence
> +[/STREAM]
> +[STREAM]
> +index=3
> +codec_name=pcm_s32be
> +TAG:language=nor
> +TAG:title=norwegian_silence
> +[/STREAM]
>
Andreas Rheinhardt March 31, 2021, 8:24 p.m. UTC | #2
James Almer:
> On 3/31/2021 4:19 PM, Andreas Rheinhardt wrote:
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> Will apply this patch tomorrow unless there are objections.
>>
>>   tests/fate/matroska.mak            | 17 ++++++++
>>   tests/ref/fate/matroska-h264-remux | 65 ++++++++++++++++++++++++++++++
>>   2 files changed, 82 insertions(+)
>>   create mode 100644 tests/ref/fate/matroska-h264-remux
>>
>> diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
>> index f6d4bd1199..becca28e1a 100644
>> --- a/tests/fate/matroska.mak
>> +++ b/tests/fate/matroska.mak
>> @@ -90,6 +90,23 @@ FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES,
>> FILE_PROTOCOL MXF_DEMUXER        \
>>                                  +=
>> fate-matroska-mastering-display-metadata
>>   fate-matroska-mastering-display-metadata: CMD = transcode mxf
>> $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf matroska
>> "-map 0 -map 0:0 -c:v:0 copy -c:v:1 ffv1 -c:a:0 copy -bsf:a:0
>> noise=amount=3 -filter:a:1 aresample -c:a:1 pcm_s16be -bsf:a:1
>> noise=dropamount=4" "-map 0 -c copy" "" "-show_entries
>> stream_side_data_list:stream=index,codec_name"
>>   +# This test tests remuxing annex B H.264 into Matroska. It also
>> tests writing
>> +# the correct interlaced flags and overriding the sample aspect
>> ratio, leading
>> +# to anamorphic video. Given that the input file has lots of filler
>> material,
>> +# the h264_metadata filter is used to remove it as well as the H.264
>> AUD.
> 
> Aren't AUD NALUs removed as part of the process of encapsulating Annex B
> into isobmff samples, which Matroska uses? Or are we just passing them
> through by default?
> 

They are legal in ISOBMFF and are not removed by us (but by mkvmerge).

>> +# The video is decoded twice to show that this did not change the
>> decoded
>> +# output. Furthermore, this also tests writing PCM with bitdepth 32.
>> +FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL
>> MPEGTS_DEMUXER       \
>> +                                            H264_PARSER
>> MPEGAUDIO_PARSER       \
>> +                                            EXTRACT_EXTRADATA_BSF
>> MP2_DECODER  \
>> +                                            H264_METADATA_BSF
>> ARESAMPLE_FILTER \
>> +                                            RAWVIDEO_ENCODER
>> PCM_S32LE_ENCODER \
>> +                                            PCM_S32BE_ENCODER
>> MATROSKA_MUXER   \
>> +                                            MATROSKA_DEMUXER
>> H264_DECODER      \
>> +                                            FRAMECRC_MUXER
>> PIPE_PROTOCOL)      \
>> +                               += fate-matroska-h264-remux
>> +fate-matroska-h264-remux: CMD = transcode mpegts
>> $(TARGET_SAMPLES)/h264/h264_intra_first-small.ts matroska "-map 0:0
>> -map 0 -c:v copy -sar:0 3:4 -bsf:v:1
>> h264_metadata=aud=remove:delete_filler=1 -disposition:v
>> +hearing_impaired -af aresample -c:a:0 pcm_s32le -c:a:1 pcm_s32be
>> -disposition:a:0 original -metadata:s:a:0 title=swedish_silence
>> -metadata:s:a:1 title=norwegian_silence -disposition:a:1 dub" "-map
>> 0:v" "" "-show_entries
>> stream=index,codec_name:stream_tags=title,language"
>> +
>>   # Tests writing BlockAdditional and BlockGroups with ReferenceBlock
>> elements;
>>   # it also tests setting a track as suitable for hearing impaired.
>>   # It also tests the capability of the VP8 parser to set the keyframe
>> flag
>> diff --git a/tests/ref/fate/matroska-h264-remux
>> b/tests/ref/fate/matroska-h264-remux
>> new file mode 100644
>> index 0000000000..14e6758fa0
>> --- /dev/null
>> +++ b/tests/ref/fate/matroska-h264-remux
>> @@ -0,0 +1,65 @@
>> +ded6da7e46ce7df1232b116afb0b2f0a
>> *tests/data/fate/matroska-h264-remux.matroska
>> +2036083 tests/data/fate/matroska-h264-remux.matroska
>> +#tb 0: 1/25
>> +#media_type 0: video
>> +#codec_id 0: rawvideo
>> +#dimensions 0: 1920x1080
>> +#sar 0: 3/4
>> +#tb 1: 1/25
>> +#media_type 1: video
>> +#codec_id 1: rawvideo
>> +#dimensions 1: 1920x1080
>> +#sar 1: 1/1
>> +0,         45,         45,        1,  3110400, 0xa426f15d
>> +1,         45,         45,        1,  3110400, 0xa426f15d
>> +0,         46,         46,        1,  3110400, 0x7066003b
>> +1,         46,         46,        1,  3110400, 0x7066003b
>> +0,         47,         47,        1,  3110400, 0x7691f2c5
>> +1,         47,         47,        1,  3110400, 0x7691f2c5
>> +0,         48,         48,        1,  3110400, 0x1bc501d2
>> +1,         48,         48,        1,  3110400, 0x1bc501d2
>> +0,         49,         49,        1,  3110400, 0xb616ecf1
>> +1,         49,         49,        1,  3110400, 0xb616ecf1
>> +0,         50,         50,        1,  3110400, 0xa334fb27
>> +1,         50,         50,        1,  3110400, 0xa334fb27
>> +0,         51,         51,        1,  3110400, 0x1097ea90
>> +1,         51,         51,        1,  3110400, 0x1097ea90
>> +0,         52,         52,        1,  3110400, 0xbc25f438
>> +1,         52,         52,        1,  3110400, 0xbc25f438
>> +0,         53,         53,        1,  3110400, 0xcab4f0d9
>> +1,         53,         53,        1,  3110400, 0xcab4f0d9
>> +0,         54,         54,        1,  3110400, 0xa740f58c
>> +1,         54,         54,        1,  3110400, 0xa740f58c
>> +0,         55,         55,        1,  3110400, 0x597de7df
>> +1,         55,         55,        1,  3110400, 0x597de7df
>> +0,         56,         56,        1,  3110400, 0x3b79f58d
>> +1,         56,         56,        1,  3110400, 0x3b79f58d
>> +0,         57,         57,        1,  3110400, 0x3705eb68
>> +1,         57,         57,        1,  3110400, 0x3705eb68
>> +0,         58,         58,        1,  3110400, 0x2292f7de
>> +1,         58,         58,        1,  3110400, 0x2292f7de
>> +0,         59,         59,        1,  3110400, 0x2171e805
>> +1,         59,         59,        1,  3110400, 0x2171e805
>> +0,         60,         60,        1,  3110400, 0x14a9f258
>> +0,         61,         61,        1,  3110400, 0xa545ef91
>> +1,         61,         61,        1,  3110400, 0xa545ef91
>> +[STREAM]
>> +index=0
>> +codec_name=h264
>> +[/STREAM]
>> +[STREAM]
>> +index=1
>> +codec_name=h264
>> +[/STREAM]
>> +[STREAM]
>> +index=2
>> +codec_name=pcm_s32le
>> +TAG:language=swe
>> +TAG:title=swedish_silence
>> +[/STREAM]
>> +[STREAM]
>> +index=3
>> +codec_name=pcm_s32be
>> +TAG:language=nor
>> +TAG:title=norwegian_silence
>> +[/STREAM]
>>
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index f6d4bd1199..becca28e1a 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -90,6 +90,23 @@  FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL MXF_DEMUXER        \
                                += fate-matroska-mastering-display-metadata
 fate-matroska-mastering-display-metadata: CMD = transcode mxf $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf matroska "-map 0 -map 0:0 -c:v:0 copy -c:v:1 ffv1 -c:a:0 copy -bsf:a:0 noise=amount=3 -filter:a:1 aresample -c:a:1 pcm_s16be -bsf:a:1 noise=dropamount=4" "-map 0 -c copy" "" "-show_entries stream_side_data_list:stream=index,codec_name"
 
+# This test tests remuxing annex B H.264 into Matroska. It also tests writing
+# the correct interlaced flags and overriding the sample aspect ratio, leading
+# to anamorphic video. Given that the input file has lots of filler material,
+# the h264_metadata filter is used to remove it as well as the H.264 AUD.
+# The video is decoded twice to show that this did not change the decoded
+# output. Furthermore, this also tests writing PCM with bitdepth 32.
+FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL MPEGTS_DEMUXER       \
+                                            H264_PARSER MPEGAUDIO_PARSER       \
+                                            EXTRACT_EXTRADATA_BSF MP2_DECODER  \
+                                            H264_METADATA_BSF ARESAMPLE_FILTER \
+                                            RAWVIDEO_ENCODER PCM_S32LE_ENCODER \
+                                            PCM_S32BE_ENCODER MATROSKA_MUXER   \
+                                            MATROSKA_DEMUXER H264_DECODER      \
+                                            FRAMECRC_MUXER PIPE_PROTOCOL)      \
+                               += fate-matroska-h264-remux
+fate-matroska-h264-remux: CMD = transcode mpegts $(TARGET_SAMPLES)/h264/h264_intra_first-small.ts matroska "-map 0:0 -map 0 -c:v copy -sar:0 3:4 -bsf:v:1 h264_metadata=aud=remove:delete_filler=1 -disposition:v +hearing_impaired -af aresample -c:a:0 pcm_s32le -c:a:1 pcm_s32be -disposition:a:0 original -metadata:s:a:0 title=swedish_silence -metadata:s:a:1 title=norwegian_silence -disposition:a:1 dub" "-map 0:v" "" "-show_entries stream=index,codec_name:stream_tags=title,language"
+
 # Tests writing BlockAdditional and BlockGroups with ReferenceBlock elements;
 # it also tests setting a track as suitable for hearing impaired.
 # It also tests the capability of the VP8 parser to set the keyframe flag
diff --git a/tests/ref/fate/matroska-h264-remux b/tests/ref/fate/matroska-h264-remux
new file mode 100644
index 0000000000..14e6758fa0
--- /dev/null
+++ b/tests/ref/fate/matroska-h264-remux
@@ -0,0 +1,65 @@ 
+ded6da7e46ce7df1232b116afb0b2f0a *tests/data/fate/matroska-h264-remux.matroska
+2036083 tests/data/fate/matroska-h264-remux.matroska
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 1920x1080
+#sar 0: 3/4
+#tb 1: 1/25
+#media_type 1: video
+#codec_id 1: rawvideo
+#dimensions 1: 1920x1080
+#sar 1: 1/1
+0,         45,         45,        1,  3110400, 0xa426f15d
+1,         45,         45,        1,  3110400, 0xa426f15d
+0,         46,         46,        1,  3110400, 0x7066003b
+1,         46,         46,        1,  3110400, 0x7066003b
+0,         47,         47,        1,  3110400, 0x7691f2c5
+1,         47,         47,        1,  3110400, 0x7691f2c5
+0,         48,         48,        1,  3110400, 0x1bc501d2
+1,         48,         48,        1,  3110400, 0x1bc501d2
+0,         49,         49,        1,  3110400, 0xb616ecf1
+1,         49,         49,        1,  3110400, 0xb616ecf1
+0,         50,         50,        1,  3110400, 0xa334fb27
+1,         50,         50,        1,  3110400, 0xa334fb27
+0,         51,         51,        1,  3110400, 0x1097ea90
+1,         51,         51,        1,  3110400, 0x1097ea90
+0,         52,         52,        1,  3110400, 0xbc25f438
+1,         52,         52,        1,  3110400, 0xbc25f438
+0,         53,         53,        1,  3110400, 0xcab4f0d9
+1,         53,         53,        1,  3110400, 0xcab4f0d9
+0,         54,         54,        1,  3110400, 0xa740f58c
+1,         54,         54,        1,  3110400, 0xa740f58c
+0,         55,         55,        1,  3110400, 0x597de7df
+1,         55,         55,        1,  3110400, 0x597de7df
+0,         56,         56,        1,  3110400, 0x3b79f58d
+1,         56,         56,        1,  3110400, 0x3b79f58d
+0,         57,         57,        1,  3110400, 0x3705eb68
+1,         57,         57,        1,  3110400, 0x3705eb68
+0,         58,         58,        1,  3110400, 0x2292f7de
+1,         58,         58,        1,  3110400, 0x2292f7de
+0,         59,         59,        1,  3110400, 0x2171e805
+1,         59,         59,        1,  3110400, 0x2171e805
+0,         60,         60,        1,  3110400, 0x14a9f258
+0,         61,         61,        1,  3110400, 0xa545ef91
+1,         61,         61,        1,  3110400, 0xa545ef91
+[STREAM]
+index=0
+codec_name=h264
+[/STREAM]
+[STREAM]
+index=1
+codec_name=h264
+[/STREAM]
+[STREAM]
+index=2
+codec_name=pcm_s32le
+TAG:language=swe
+TAG:title=swedish_silence
+[/STREAM]
+[STREAM]
+index=3
+codec_name=pcm_s32be
+TAG:language=nor
+TAG:title=norwegian_silence
+[/STREAM]