Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] tests: add test for ffmpeg's fix_sub_duration feature
@ 2021-12-20 17:22 Jan Ekström
  2021-12-21  7:46 ` [FFmpeg-devel] [PATCH v2] " Jan Ekström
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Ekström @ 2021-12-20 17:22 UTC (permalink / raw)
  To: ffmpeg-devel

From: Jan Ekström <jan.ekstrom@24i.com>

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

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 4ba73a8dfa..63721f2209 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -94,6 +94,14 @@ 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_FFMPEG-$(call ALLYES, FILE_PROTOCOL PIPE_PROTOCOL SAMI_DEMUXER \
+                           SAMI_DECODER TEXT_ENCODER SRT_MUXER) \
+                           += fate-ffmpeg-fix_sub_duration
+fate-ffmpeg-fix_sub_duration: CMD = fmtstdout srt -fix_sub_duration \
+  -i "$(TARGET_SAMPLES)/sub/SAMI_capability_tester.smi"
+
 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..238c9ab635
--- /dev/null
+++ b/tests/ref/fate/ffmpeg-fix_sub_duration
@@ -0,0 +1,40 @@
+1
+00:00:00,000 --> 00:00:00,010
+<i>Pres. John F. Kennedy</i>
+
+
+2
+00:00:00,010 --> 00:00:08,800
+<i>Pres. John F. Kennedy</i>
+Let the word go forth, from this time and place to friend and foe alike that the torch
+
+3
+00:00:08,800 --> 00:00:19,500
+<i>Pres. John F. Kennedy</i>
+has been passed to a new generation of Americans, born in this century, tempered by war,
+
+4
+00:00:19,500 --> 00:00:28,000
+<i>Pres. John F. Kennedy</i>
+disciplined by a hard and bitter peace, proud of our ancient heritage, and unwilling to witness
+
+5
+00:00:28,000 --> 00:00:38,000
+<i>Pres. John F. Kennedy</i>
+or permit the slow undoing of those human rights to which this nation has always
+
+6
+00:00:38,000 --> 00:00:46,000
+<i>Pres. John F. Kennedy</i>
+been committed and to which we are committed today at home and around the world.
+
+7
+00:00:46,000 --> 00:01:01,000
+<i>Pres. John F. Kennedy</i>
+Let every nation know, whether it wishes us well or ill, that we shall pay any price, bear any burden,
+
+8
+00:01:01,000 --> 00:01:13,000
+<i>Pres. John F. Kennedy</i>
+meet any hardship, support any friend, oppose any foe, to ensure the survival and success of liberty.
+
-- 
2.33.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [FFmpeg-devel] [PATCH v2] tests: add test for ffmpeg's fix_sub_duration feature
  2021-12-20 17:22 [FFmpeg-devel] [PATCH] tests: add test for ffmpeg's fix_sub_duration feature Jan Ekström
@ 2021-12-21  7:46 ` Jan Ekström
  2021-12-21  8:01   ` Andreas Rheinhardt
  2021-12-21 15:02   ` [FFmpeg-devel] [PATCH v3] " Jan Ekström
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Ekström @ 2021-12-21  7:46 UTC (permalink / raw)
  To: ffmpeg-devel

From: Jan Ekström <jan.ekstrom@24i.com>

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

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 4ba73a8dfa..ff321eba7f 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_FFMPEG-$(call ALLYES, AVDEVICE LAVFI_INDEV MOVIE_FILTER \
+                           FILE_PROTOCOL PIPE_PROTOCOL MPEGVIDEO_DEMUXER \
+                           MPEG2VIDEO_DECODER CCAPTION_DECODER \
+                           TEXT_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..9cd36d4888
--- /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>
+
-- 
2.33.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] tests: add test for ffmpeg's fix_sub_duration feature
  2021-12-21  7:46 ` [FFmpeg-devel] [PATCH v2] " Jan Ekström
@ 2021-12-21  8:01   ` Andreas Rheinhardt
  2021-12-21 15:02   ` [FFmpeg-devel] [PATCH v3] " Jan Ekström
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2021-12-21  8:01 UTC (permalink / raw)
  To: ffmpeg-devel

Jan Ekström:
> From: Jan Ekström <jan.ekstrom@24i.com>
> 
> 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
> 
> diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
> index 4ba73a8dfa..ff321eba7f 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_FFMPEG-$(call ALLYES, AVDEVICE LAVFI_INDEV MOVIE_FILTER \

AVDEVICE is redundant with LAVFI_INDEV.

> +                           FILE_PROTOCOL PIPE_PROTOCOL MPEGVIDEO_DEMUXER \
> +                           MPEG2VIDEO_DECODER CCAPTION_DECODER \
> +                           TEXT_ENCODER SRT_MUXER) \

TEXT_ENCODER? Not SUBRIP_ENCODER? You are not encoding to text, but to
subrip after all (subtitle_codec of the srt muxer is AV_CODEC_ID_SUBRIP).

> +                           += 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..9cd36d4888
> --- /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>
> +
> 

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [FFmpeg-devel] [PATCH v3] tests: add test for ffmpeg's fix_sub_duration feature
  2021-12-21  7:46 ` [FFmpeg-devel] [PATCH v2] " Jan Ekström
  2021-12-21  8:01   ` Andreas Rheinhardt
@ 2021-12-21 15:02   ` Jan Ekström
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Ekström @ 2021-12-21 15:02 UTC (permalink / raw)
  To: ffmpeg-devel

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                  | 10 +++++++++
 tests/ref/fate/ffmpeg-fix_sub_duration | 31 ++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 tests/ref/fate/ffmpeg-fix_sub_duration

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 4ba73a8dfa..f0d737aa5d 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -94,6 +94,16 @@ 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_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>
+
-- 
2.33.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-21 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 17:22 [FFmpeg-devel] [PATCH] tests: add test for ffmpeg's fix_sub_duration feature Jan Ekström
2021-12-21  7:46 ` [FFmpeg-devel] [PATCH v2] " Jan Ekström
2021-12-21  8:01   ` Andreas Rheinhardt
2021-12-21 15:02   ` [FFmpeg-devel] [PATCH v3] " Jan Ekström

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git