[FFmpeg-devel] [PATCH] fate: add fate-sub-dvb test

Clément Bœsch u at pkh.me
Tue Aug 11 15:19:01 EEST 2020


On Tue, Aug 11, 2020 at 12:06:40AM +0200, Andreas Rheinhardt wrote:
> Clément Bœsch:
> > On Mon, Aug 10, 2020 at 08:36:13PM +0200, Andreas Rheinhardt wrote:
> >> Clément Bœsch:
> >>> Source: Videolan sample database (samples/sub/dvbsub)
> >>> ---
> >>> Can someone upload https://streams.videolan.org/samples/sub/dvbsub/dvbsubtest.ts to fate-samples/sub?
> >>
> >> A 20MB sample? Can't one use a smaller sample or filter out the
> >> interesting PIDs from this sample? (If I remux only the subtitle stream
> >> to Matroska with mkvmerge, the sample is 33 kB.)
> > 
> > Yup, you're correct. New patch attached.
> > 
> > For the sample:
> >   curl 'https://0x0.st/i35H.mks' -o fate-samples/sub/dvbsubtest.mks
> > 
> > sha256sum:
> >   3fccc784eb61e701f1d6789253f637a32374ce6c81539d44a4e74075246ff02b  fate-samples/sub/dvbsubtest.mks
> > 
> If one strips the video and the audio PID away, one gets a 77KB
> transport stream. And as it turns out, this file is unusable since
> commit a1b4f120c031e6697bac9fd8c725d9c37ee36d13; see ticket #8844 for
> details. Maybe it would be better to go with the stripped down transport
> stream (the file I attached to #8844) in order to make sure that we
> don't regress again (after the regression has been fixed, of course)?

Yes I agree, it will make the test even more useful: MPEG-TS demuxing, DVB
sub regression for ticket #8844, ffmpeg.c DVB hack, DVB decoding and DVB
encoding. It sounds like a good idea to me.

I'm attaching the 2 patches but the first one (revert) is not to be
applied (or at least not as-is), it's just for the record while the
regression is being investigated and solved.

> But anyway, the Matroska file uses zlib compression (that's why it's so
> small -- the actual data size is 51KB) and therefore your test needs to
> check for zlib.

Ah, I see. Well, I went back to MPEG-TS so...

Regards,

-- 
Clément B.
-------------- next part --------------
>From d6f352288b9ba3cfcc758e373c80171523e818bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <u at pkh.me>
Date: Tue, 11 Aug 2020 10:41:54 +0200
Subject: [PATCH 1/2] Revert "avformat/mpegts: unset DTS/PTS for subtitle PES
 packets if PCR not available"

This reverts commit a1b4f120c031e6697bac9fd8c725d9c37ee36d13.
---
 libavformat/mpegts.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index c6fd3e1cef..903d858dd7 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1297,7 +1297,6 @@ skip:
                         || pes->st->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE)
                     ) {
                     AVProgram *p = NULL;
-                    int pcr_found = 0;
                     while ((p = av_find_program_from_stream(pes->stream, p, pes->st->index))) {
                         if (p->pcr_pid != -1 && p->discard != AVDISCARD_ALL) {
                             MpegTSFilter *f = pes->ts->pids[p->pcr_pid];
@@ -1321,7 +1320,6 @@ skip:
                                     // and the pcr error to this packet should be no more than 100 ms.
                                     // TODO: we should interpolate the PCR, not just use the last one
                                     int64_t pcr = f->last_pcr / 300;
-                                    pcr_found = 1;
                                     if (st) {
                                         pes->st->pts_wrap_reference = st->pts_wrap_reference;
                                         pes->st->pts_wrap_behavior = st->pts_wrap_behavior;
@@ -1340,15 +1338,6 @@ skip:
                             }
                         }
                     }
-
-                    if (!pcr_found) {
-                        av_log(pes->stream, AV_LOG_VERBOSE,
-                               "Forcing DTS/PTS to be unset for a "
-                               "non-trustworthy PES packet for PID %d as "
-                               "PCR hasn't been received yet.\n",
-                               pes->pid);
-                        pes->dts = pes->pts = AV_NOPTS_VALUE;
-                    }
                 }
             }
             break;
-- 
2.28.0

-------------- next part --------------
>From 8340ce6fd0af6d3e1b4e7526d03e62a0b3bbcf7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <u at pkh.me>
Date: Mon, 10 Aug 2020 15:59:26 +0200
Subject: [PATCH 2/2] fate: add fate-sub-dvb test

The dvbsubtest_filter.ts sample is a filtered version of the Videolan
sample database (samples/sub/dvbsub/dvbsubtest.ts) using Project X. It
originates from ticket #8844.
---
 tests/fate/subtitles.mak |  3 ++
 tests/ref/fate/sub-dvb   | 75 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)
 create mode 100644 tests/ref/fate/sub-dvb

diff --git a/tests/fate/subtitles.mak b/tests/fate/subtitles.mak
index 0042902161..6323d0f93d 100644
--- a/tests/fate/subtitles.mak
+++ b/tests/fate/subtitles.mak
@@ -103,6 +103,9 @@ fate-sub-charenc: CMD = fmtstdout ass -sub_charenc cp1251 -i $(TARGET_SAMPLES)/s
 FATE_SUBTITLES-$(call DEMDEC, SCC, CCAPTION) += fate-sub-scc
 fate-sub-scc: CMD = fmtstdout ass -ss 57 -i $(TARGET_SAMPLES)/sub/witch.scc
 
+FATE_SUBTITLES-$(call ALLYES, MPEGTS_DEMUXER DVBSUB_DECODER DVBSUB_ENCODER) += fate-sub-dvb
+fate-sub-dvb: CMD = framecrc -i $(TARGET_SAMPLES)/sub/dvbsubtest_filter.ts -map s:0 -c dvbsub
+
 FATE_SUBTITLES-$(call ENCMUX, ASS, ASS) += $(FATE_SUBTITLES_ASS-yes)
 FATE_SUBTITLES += $(FATE_SUBTITLES-yes)
 
diff --git a/tests/ref/fate/sub-dvb b/tests/ref/fate/sub-dvb
new file mode 100644
index 0000000000..cbd1801d64
--- /dev/null
+++ b/tests/ref/fate/sub-dvb
@@ -0,0 +1,75 @@
+#tb 0: 1/1000000
+#media_type 0: subtitle
+#codec_id 0: dvb_subtitle
+0,   15600000,   15600000,   159000,     1168, 0xd0f89d82
+0,   15759000,   15759000,   159000,       14, 0x064900eb
+0,   15760000,   15760000,   239000,     1544, 0xe60f1751
+0,   15999000,   15999000,   239000,       14, 0x0729010b
+0,   16000000,   16000000,   339000,     1658, 0xbe343093
+0,   16339000,   16339000,   339000,       14, 0x0809012b
+0,   16340000,   16340000,   599000,     2343, 0xc68f07ef
+0,   16939000,   16939000,   599000,       14, 0x08e9014b
+0,   16940000,   16940000,   459000,     2568, 0x0ee657b1
+0,   17399000,   17399000,   459000,       14, 0x09c9016b
+0,   17400000,   17400000,   359000,     3422, 0xba5b63ce
+0,   17759000,   17759000,   359000,       14, 0x0aa9018b
+0,   17760000,   17760000,   219000,     5078, 0x95b19902
+0,   17979000,   17979000,   219000,       14, 0x0b8901ab
+0,   17980000,   17980000,   959000,     5808, 0xc9717b89
+0,   18939000,   18939000,   959000,       14, 0x0c6901cb
+0,   18940000,   18940000,   219000,     6015, 0x0becbfac
+0,   19159000,   19159000,   219000,       14, 0x064900eb
+0,   19160000,   19160000,   259000,     6519, 0xfcd24d26
+0,   19419000,   19419000,   259000,       14, 0x0729010b
+0,   19420000,   19420000,    99000,     7061, 0xf0320408
+0,   19519000,   19519000,    99000,       14, 0x0809012b
+0,   19520000,   19520000,   219000,     4773, 0x66c93074
+0,   19739000,   19739000,   219000,       14, 0x08e9014b
+0,   19740000,   19740000,   219000,     5546, 0x06052c81
+0,   19959000,   19959000,   219000,       14, 0x09c9016b
+0,   19960000,   19960000,   239000,     5754, 0x904f7325
+0,   20199000,   20199000,   239000,       14, 0x0aa9018b
+0,   20200000,   20200000,   139000,     6099, 0xe30cde07
+0,   20339000,   20339000,   139000,       14, 0x0b8901ab
+0,   20340000,   20340000,   799000,     6839, 0x770fcb6c
+0,   21139000,   21139000,   799000,       14, 0x0c6901cb
+0,   21140000,   21140000,   239000,     4744, 0xa91e1b41
+0,   21379000,   21379000,   239000,       14, 0x064900eb
+0,   21380000,   21380000,   339000,     5824, 0xcf6d782b
+0,   21719000,   21719000,   339000,       14, 0x0729010b
+0,   21720000,   21720000,  1439000,     6212, 0xabf8f7cf
+0,   23159000,   23159000,  1439000,       14, 0x0809012b
+0,   23160000,   23160000,  1319000,     7082, 0xd7ca10f2
+0,   24479000,   24479000,  1319000,       14, 0x08e9014b
+0,   24480000,   24480000,   219000,     5345, 0x12b2cae0
+0,   24699000,   24699000,   219000,       14, 0x09c9016b
+0,   24700000,   24700000,   219000,     5765, 0xc7d46192
+0,   24919000,   24919000,   219000,       14, 0x0aa9018b
+0,   24920000,   24920000,   599000,     6557, 0xcb995d30
+0,   25519000,   25519000,   599000,       14, 0x0b8901ab
+0,   25520000,   25520000,   219000,     7091, 0xe6ea0559
+0,   25739000,   25739000,   219000,       14, 0x0c6901cb
+0,   25740000,   25740000,   239000,     7305, 0xb66c404e
+0,   25979000,   25979000,   239000,       14, 0x064900eb
+0,   25980000,   25980000,   359000,     7590, 0x0cc2a481
+0,   26339000,   26339000,   359000,       14, 0x0729010b
+0,   26340000,   26340000,   219000,     4629, 0xe18cfea8
+0,   26559000,   26559000,   219000,       14, 0x0809012b
+0,   26560000,   26560000,   719000,     4785, 0x82043fc0
+0,   27279000,   27279000,   719000,       14, 0x08e9014b
+0,   27280000,   27280000,   459000,     6061, 0xbde7d245
+0,   27739000,   27739000,   459000,       14, 0x09c9016b
+0,   27740000,   27740000,   239000,     6301, 0x92d01a51
+0,   27979000,   27979000,   239000,       14, 0x0aa9018b
+0,   27980000,   27980000,    99000,     6736, 0xbd25a134
+0,   28079000,   28079000,    99000,       14, 0x0b8901ab
+0,   28080000,   28080000,   219000,     7214, 0x7ef93c13
+0,   28299000,   28299000,   219000,       14, 0x0c6901cb
+0,   28300000,   28300000,   239000,     7366, 0x5bed7fcd
+0,   28539000,   28539000,   239000,       14, 0x064900eb
+0,   28540000,   28540000,   599000,     4564, 0x7f4c014b
+0,   29139000,   29139000,   599000,       14, 0x0729010b
+0,   29140000,   29140000,   219000,     4637, 0x682626b7
+0,   29359000,   29359000,   219000,       14, 0x0809012b
+0,   29360000,   29360000,  1679000,     5358, 0x29e30c48
+0,   31039000,   31039000,  1679000,       14, 0x08e9014b
-- 
2.28.0



More information about the ffmpeg-devel mailing list