diff mbox series

[FFmpeg-devel,v4] tests: add test for ffmpeg's fix_sub_duration feature

Message ID 20220110132807.26929-1-jeebjp@gmail.com
State Accepted
Commit 0a83ecbf48bdd591b264c3cbb70393bb518b1ecc
Headers show
Series [FFmpeg-devel,v4] tests: add test for ffmpeg's fix_sub_duration feature | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Jan Ekström Jan. 10, 2022, 1:28 p.m. UTC
From: Jan Ekström <jan.ekstrom@24i.com>

This long-existing feature calculates subtitle durations by keeping
it around until the following subtitle is decoded, and then utilizes
the following subtitle's pts as the end point of the previous one.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
---
 tests/fate/ffmpeg.mak                  | 11 +++++++++
 tests/ref/fate/ffmpeg-fix_sub_duration | 31 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 tests/ref/fate/ffmpeg-fix_sub_duration

Comments

Jan Ekström Jan. 24, 2022, 10:43 a.m. UTC | #1
On Mon, Jan 10, 2022 at 3:28 PM Jan Ekström <jeebjp@gmail.com> wrote:
>
> From: Jan Ekström <jan.ekstrom@24i.com>
>
> This long-existing feature calculates subtitle durations by keeping
> it around until the following subtitle is decoded, and then utilizes
> the following subtitle's pts as the end point of the previous one.
>

As there have been no comments for about two weeks, I will be
rebasing/checking that FATE still passes and applying this, as this
will heighten the test coverage for existing ffmpeg.c features.

Jan
Jan Ekström Jan. 24, 2022, 11:30 a.m. UTC | #2
On Mon, Jan 24, 2022 at 12:43 PM Jan Ekström <jeebjp@gmail.com> wrote:
>
> On Mon, Jan 10, 2022 at 3:28 PM Jan Ekström <jeebjp@gmail.com> wrote:
> >
> > From: Jan Ekström <jan.ekstrom@24i.com>
> >
> > This long-existing feature calculates subtitle durations by keeping
> > it around until the following subtitle is decoded, and then utilizes
> > the following subtitle's pts as the end point of the previous one.
> >
>
> As there have been no comments for about two weeks, I will be
> rebasing/checking that FATE still passes and applying this, as this
> will heighten the test coverage for existing ffmpeg.c features.
>

Applied as 0a83ecbf48bdd591b264c3cbb70393bb518b1ecc .

Jan
diff mbox series

Patch

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 0b00bb5b23..c21de6e2a5 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -94,6 +94,17 @@  FATE_FFMPEG-$(call ALLYES, FILE_PROTOCOL LAVFI_INDEV RAWVIDEO_DEMUXER      \
 fate-shortest: tests/data/vsynth_lena.yuv
 fate-shortest: CMD = framecrc -auto_conversion_filters -f lavfi -i "sine=3000:d=10" -f lavfi -i "sine=1000:d=1" -sws_flags +accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -idct simple -f rawvideo -s 352x288 -pix_fmt yuv420p -i $(TARGET_PATH)/tests/data/vsynth_lena.yuv -filter_complex "[0:a:0][1:a:0]amix=inputs=2[audio]" -map 2:v:0 -map "[audio]" -sws_flags +accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -idct simple -dct fastint -qscale 10 -threads 1 -c:v mpeg4 -c:a ac3_fixed -shortest
 
+# Basic test for fix_sub_duration, which calculates duration based on the
+# following subtitle's pts.
+FATE_SAMPLES_FFMPEG-$(call ALLYES, LAVFI_INDEV MOVIE_FILTER FILE_PROTOCOL \
+                                   PIPE_PROTOCOL MPEGVIDEO_DEMUXER \
+                                   MPEG2VIDEO_DECODER CCAPTION_DECODER \
+                                   SUBRIP_ENCODER SRT_MUXER) \
+                           += fate-ffmpeg-fix_sub_duration
+fate-ffmpeg-fix_sub_duration: CMD = fmtstdout srt -fix_sub_duration \
+  -real_time 1 -f lavfi \
+  -i "movie=$(TARGET_SAMPLES)/sub/Closedcaption_rollup.m2v[out0+subcc]"
+
 FATE_STREAMCOPY-$(call ALLYES, EAC3_DEMUXER MOV_MUXER) += fate-copy-trac3074
 fate-copy-trac3074: $(SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3
 fate-copy-trac3074: CMD = transcode eac3 $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3\
diff --git a/tests/ref/fate/ffmpeg-fix_sub_duration b/tests/ref/fate/ffmpeg-fix_sub_duration
new file mode 100644
index 0000000000..0ede5c6b90
--- /dev/null
+++ b/tests/ref/fate/ffmpeg-fix_sub_duration
@@ -0,0 +1,31 @@ 
+1
+00:00:00,968 --> 00:00:01,168
+<font face="Monospace">{\an7}(</font>
+
+2
+00:00:01,168 --> 00:00:01,368
+<font face="Monospace">{\an7}(<i> inaudibl</i></font>
+
+3
+00:00:01,368 --> 00:00:01,568
+<font face="Monospace">{\an7}(<i> inaudible radio chat</i></font>
+
+4
+00:00:01,568 --> 00:00:03,103
+<font face="Monospace">{\an7}(<i> inaudible radio chatter</i> )</font>
+
+5
+00:00:03,103 --> 00:00:03,303
+<font face="Monospace">{\an7}(<i> inaudible radio chatter</i> )
+>></font>
+
+6
+00:00:03,303 --> 00:00:03,503
+<font face="Monospace">{\an7}(<i> inaudible radio chatter</i> )
+>> Safety rema</font>
+
+7
+00:00:03,504 --> 00:00:03,704
+<font face="Monospace">{\an7}(<i> inaudible radio chatter</i> )
+>> Safety remains our numb</font>
+