diff mbox

[FFmpeg-devel,3/4] avformat/mpegenc - accept PCM_DVD streams

Message ID 3edf4acc-38ce-a25a-1003-a21cfea03c3e@gmail.com
State Accepted
Commit 310d56e86f494273e2859cf25dd4ae2433f9a2be
Headers show

Commit Message

Gyan Feb. 15, 2018, 12:57 p.m. UTC
On 2/15/2018 8:58 AM, Michael Niedermayer wrote:
> On Tue, Feb 13, 2018 at 12:36:15AM +0530, Gyan Doshi wrote:

>> FATE patch and sample file attached. Sample file should go into (new) mpegps
>> directory in suite.
> 
> have you checked that none of the existing fate samples can be used ?

Yes. There's only MPEG-PS with PCM audio in it in the suite at present 
but the stream is 24-bit, which can't be muxed.

New FATE test attached. Removed the md5 test and added a framecrc test 
on a remuxed file since any bit flips due to other parts of the muxer 
should be disregarded.

Regards,
Gyan
From 15e27259aa05988751eb0456b457b11ce5019ae8 Mon Sep 17 00:00:00 2001
From: Gyan Doshi <gyandoshi@gmail.com>
Date: Thu, 15 Feb 2018 17:48:47 +0530
Subject: [PATCH v2] fate/mpegps: add tests for PCM_DVD stream remux

---
 tests/Makefile                          |  1 +
 tests/fate-run.sh                       | 16 +++++++++++
 tests/fate/mpegps.mak                   |  7 +++++
 tests/ref/fate/mpegps-remuxed-pcm-demux | 50 +++++++++++++++++++++++++++++++++
 4 files changed, 74 insertions(+)
 create mode 100644 tests/fate/mpegps.mak
 create mode 100644 tests/ref/fate/mpegps-remuxed-pcm-demux
diff mbox

Patch

diff --git a/tests/Makefile b/tests/Makefile
index 327e3f4420..f1ac610454 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -149,6 +149,7 @@  include $(SRC_PATH)/tests/fate/mov.mak
 include $(SRC_PATH)/tests/fate/mp3.mak
 include $(SRC_PATH)/tests/fate/mpc.mak
 include $(SRC_PATH)/tests/fate/mpeg4.mak
+include $(SRC_PATH)/tests/fate/mpegps.mak
 include $(SRC_PATH)/tests/fate/mpegts.mak
 include $(SRC_PATH)/tests/fate/mxf.mak
 include $(SRC_PATH)/tests/fate/opus.mak
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 82862b7ef4..457761c152 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -226,6 +226,22 @@  transcode(){
         -f framecrc - || return
 }
 
+stream_remux(){
+    src_fmt=$1
+    srcfile=$2
+    enc_fmt=$3
+    stream_maps=$4
+    final_decode=$5
+    encfile="${outdir}/${test}.${enc_fmt}"
+    test "$7" = -keep || cleanfiles="$cleanfiles $encfile"
+    tsrcfile=$(target_path $srcfile)
+    tencfile=$(target_path $encfile)
+    ffmpeg -f $src_fmt -i $tsrcfile $stream_maps -codec copy $FLAGS \
+        -f $enc_fmt -y $tencfile || return
+    ffmpeg $DEC_OPTS -i $encfile $ENC_OPTS $FLAGS $final_decode \
+        -f framecrc - || return
+}
+
 lavffatetest(){
     t="${test#lavf-fate-}"
     ref=${base}/ref/lavf-fate/$t
diff --git a/tests/fate/mpegps.mak b/tests/fate/mpegps.mak
new file mode 100644
index 0000000000..cec1ea77fa
--- /dev/null
+++ b/tests/fate/mpegps.mak
@@ -0,0 +1,7 @@ 
+# This tests that a 16-bit pcm_dvd stream is correctly remuxed in mpegps
+FATE_MPEGPS-$(call DEMMUX, MPEGPS, MPEG1SYSTEM) += fate-mpegps-remuxed-pcm-demux
+fate-mpegps-remuxed-pcm-demux: $(TARGET_SAMPLES)/mpegps/pcm_aud.mpg
+fate-mpegps-remuxed-pcm-demux: CMD = stream_remux "mpeg" "$(TARGET_SAMPLES)/mpegps/pcm_aud.mpg" "mpeg" "-map 0:a:0" "-codec copy"
+
+FATE_SAMPLES_FFMPEG += $(FATE_MPEGPS-yes)
+fate-mpegps: $(FATE_MPEGPS-yes)
diff --git a/tests/ref/fate/mpegps-remuxed-pcm-demux b/tests/ref/fate/mpegps-remuxed-pcm-demux
new file mode 100644
index 0000000000..b5b277868f
--- /dev/null
+++ b/tests/ref/fate/mpegps-remuxed-pcm-demux
@@ -0,0 +1,50 @@ 
+#tb 0: 1/90000
+#media_type 0: audio
+#codec_id 0: pcm_dvd
+#sample_rate 0: 44100
+#channel_layout 0: 4
+#channel_layout_name 0: mono
+0,          0,          0,     2040,     2005, 0x8e98e563
+0,       2090,       2090,     2069,     2033, 0xd6f2f455
+0,       4180,       4180,     2057,     2021, 0x77a6e6c9
+0,       6269,       6269,     2057,     2021, 0x8dbcf6be
+0,       8359,       8359,     2057,     2021, 0xc629eaa0
+0,      10449,      10449,     2057,     2021, 0xa951ebe5
+0,      12539,      12539,     2057,     2021, 0x1324f29b
+0,      14629,      14629,     2057,     2021, 0x55f1e968
+0,      16718,      16718,     2057,     2021, 0x98a7f994
+0,      18808,      18808,     2057,     2021, 0xba42f42f
+0,      20898,      20898,     2057,     2021, 0xcf5cefe6
+0,      22988,      22988,     2057,     2021, 0xeef8f2b5
+0,      25078,      25078,     2057,     2021, 0x71faf42f
+0,      27167,      27167,     2057,     2021, 0x0346f019
+0,      29257,      29257,     2057,     2021, 0xbca0f4a3
+0,      31347,      31347,     2057,     2021, 0x3b6ced4f
+0,      33437,      33437,     2057,     2021, 0xc8b9ea0a
+0,      35527,      35527,     2057,     2021, 0x18e5f385
+0,      37616,      37616,     2057,     2021, 0x74f6e9d6
+0,      39706,      39706,     2057,     2021, 0x35d8f2b5
+0,      41796,      41796,     2057,     2021, 0x9d2aec53
+0,      43886,      43886,     2057,     2021, 0xf0acf1a0
+0,      45976,      45976,     2057,     2021, 0xa724ebe9
+0,      48065,      48065,     2057,     2021, 0xd4f8f534
+0,      50155,      50155,     2057,     2021, 0xdf62efc6
+0,      52245,      52245,     2057,     2021, 0x9865f504
+0,      54335,      54335,     2057,     2021, 0x8670efb7
+0,      56424,      56424,     2057,     2021, 0xe51af219
+0,      58514,      58514,     2057,     2021, 0x0210f27f
+0,      60604,      60604,     2057,     2021, 0x4b08f406
+0,      62694,      62694,     2057,     2021, 0x2b02eed4
+0,      64784,      64784,     2057,     2021, 0x0445ed00
+0,      66873,      66873,     2057,     2021, 0xfae9f21f
+0,      68963,      68963,     2057,     2021, 0x3d6beabc
+0,      71053,      71053,     2057,     2021, 0xc50af39c
+0,      73143,      73143,     2057,     2021, 0xf9eceb82
+0,      75233,      75233,     2057,     2021, 0x7b89eb9b
+0,      77322,      77322,     2057,     2021, 0x7c07ef4b
+0,      79412,      79412,     2057,     2021, 0xbfacf1eb
+0,      81502,      81502,     2057,     2021, 0xccb2f27b
+0,      83592,      83592,     2057,     2021, 0xc035f557
+0,      85682,      85682,     2057,     2021, 0xbdf1edea
+0,      87771,      87771,     2057,     2021, 0x3644f424
+0,      89861,      89861,     1457,     1433, 0xdd17d51f