Re: [FFmpeg-devel] [PATCH 2/5] fate: add concat demuxer tests

2015-10-30 Thread Nicolas George
Le quartidi 4 brumaire, an CCXXIV, Marton Balint a écrit :
> I used this many (25 1-frame segment) because this is also a seek test for
> open gop mxf. I can reduce it but in that case I will have to maintain my
> own out of tree tests for it which is counter-productive IMHO.

It seems that the your script is ready to use several templates: maybe do
just that: a short one with full output in the ref file to make testing and
debugging easy, and a long one to cover your full MXF test. But only if it
is not too much work.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/5] fate: add concat demuxer tests

2015-10-25 Thread Marton Balint

On Sun, 25 Oct 2015, Nicolas George wrote:

[...]


--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -249,6 +249,20 @@ gapless(){
 do_md5sum $decfile3
 }

+concat(){



+template=$(target_path $1)


Should it really be target_path? The template is in the source.


You are right, target path is unneeded here.


+sample=$(target_path $2)
+
+concatfile="${outdir}/${test}.ffconcat"
+packetfile="${outdir}/${test}.ffprobe"
+cleanfiles="$concatfile $packetfile"
+
+awk "{gsub(/%SRCFILE%/, \"$sample\"); print}" $template > $concatfile
+run ffprobe${PROGSUF} -show_streams -show_packets -v 0 -fflags keepside -f 
concat $concatfile > $packetfile
+



+do_md5sum $packetfile


Since the output files are text, I would prefer it being the reference as
is, without a hash. With a hash, you need two extra steps to know what you
just broke.


I used the md5 hash because the packet files are quite big - around 
3000-1 lines each. It seemed like a waste of space in the repository 
for relatively little benefit.





+}
+
 mkdir -p "$outdir"

 # Disable globbing: command arguments may contain globbing characters and
diff --git a/tests/fate/concatdec.mak b/tests/fate/concatdec.mak
new file mode 100644
index 000..89d5409
--- /dev/null
+++ b/tests/fate/concatdec.mak
@@ -0,0 +1,12 @@
+FATE_CONCAT_TEMPLATE=tests/test_template.ffconcat
+
+FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2, MPEGTS)+= ts
+FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += mxf
+FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += mxf_d10
+
+$(foreach D,$(FATE_CONCAT_DEMUXER_LAVF-yes),$(eval 
fate-concat-demuxer-lavf-$(D): ffprobe$(PROGSSUF)$(EXESUF) fate-lavf-$(D)))
+$(foreach D,$(FATE_CONCAT_DEMUXER_LAVF-yes),$(eval 
fate-concat-demuxer-lavf-$(D): CMD = concat $(FATE_CONCAT_TEMPLATE) 
tests/data/lavf/lavf.$(D)))
+
+FATE_CONCAT_DEMUXER-$(CONFIG_CONCAT_DEMUXER) += 
$(FATE_CONCAT_DEMUXER_LAVF-yes:%=fate-concat-demuxer-lavf-%)
+
+FATE-$(CONFIG_FFPROBE) += $(FATE_CONCAT_DEMUXER-yes)


I am not fluent enough in make, I will trust you on this.


I am not very fluent either, I only hope I've made it right...

[...]


diff --git a/tests/test_template.ffconcat b/tests/test_template.ffconcat
new file mode 100644
index 000..e9b685d
--- /dev/null
+++ b/tests/test_template.ffconcat
@@ -0,0 +1,112 @@



+#ffconcat version 1.0
+# ^ header is commented out to avoid probing therefore enable unsafe paths


Probably better to pass "-safe 0" explicitly.


OK.


+
+file  %SRCFILE%
+
+file  %SRCFILE%
+file_packet_metadata dummy=1
+duration  1
+



+file  %SRCFILE%
+inpoint   00:00.00
+outpoint  00:00.04
+
+file  %SRCFILE%
+inpoint   00:00.04
+outpoint  00:00.08



Does it need that many in/outpoints?


I used this many (25 1-frame segment) because this is also a seek test for 
open gop mxf. I can reduce it but in that case I will have to maintain my 
own out of tree tests for it which is counter-productive IMHO.


Let me know what you think, I can change any point you still find 
unjustified.


Thanks,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/5] fate: add concat demuxer tests

2015-10-25 Thread Nicolas George
Le tridi 3 brumaire, an CCXXIV, Marton Balint a écrit :
> Signed-off-by: Marton Balint 
> ---
>  tests/Makefile |   1 +
>  tests/fate-run.sh  |  14 
>  tests/fate/concatdec.mak   |  12 
>  tests/ref/fate/concat-demuxer-lavf-mxf |   1 +
>  tests/ref/fate/concat-demuxer-lavf-mxf_d10 |   1 +
>  tests/ref/fate/concat-demuxer-lavf-ts  |   1 +
>  tests/test_template.ffconcat   | 112 
> +
>  7 files changed, 142 insertions(+)
>  create mode 100644 tests/fate/concatdec.mak
>  create mode 100644 tests/ref/fate/concat-demuxer-lavf-mxf
>  create mode 100644 tests/ref/fate/concat-demuxer-lavf-mxf_d10
>  create mode 100644 tests/ref/fate/concat-demuxer-lavf-ts
>  create mode 100644 tests/test_template.ffconcat

Thanks, I had this on my TODO list since forever.

> 
> diff --git a/tests/Makefile b/tests/Makefile
> index 7ee4a46..62544d0 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -113,6 +113,7 @@ include $(SRC_PATH)/tests/fate/audio.mak
>  include $(SRC_PATH)/tests/fate/bmp.mak
>  include $(SRC_PATH)/tests/fate/cdxl.mak
>  include $(SRC_PATH)/tests/fate/checkasm.mak
> +include $(SRC_PATH)/tests/fate/concatdec.mak
>  include $(SRC_PATH)/tests/fate/cover-art.mak
>  include $(SRC_PATH)/tests/fate/demux.mak
>  include $(SRC_PATH)/tests/fate/dfa.mak
> diff --git a/tests/fate-run.sh b/tests/fate-run.sh
> index a3938dc..2056093 100755
> --- a/tests/fate-run.sh
> +++ b/tests/fate-run.sh
> @@ -249,6 +249,20 @@ gapless(){
>  do_md5sum $decfile3
>  }
>  
> +concat(){

> +template=$(target_path $1)

Should it really be target_path? The template is in the source.

> +sample=$(target_path $2)
> +
> +concatfile="${outdir}/${test}.ffconcat"
> +packetfile="${outdir}/${test}.ffprobe"
> +cleanfiles="$concatfile $packetfile"
> +
> +awk "{gsub(/%SRCFILE%/, \"$sample\"); print}" $template > $concatfile
> +run ffprobe${PROGSUF} -show_streams -show_packets -v 0 -fflags keepside 
> -f concat $concatfile > $packetfile
> +

> +do_md5sum $packetfile

Since the output files are text, I would prefer it being the reference as
is, without a hash. With a hash, you need two extra steps to know what you
just broke.

> +}
> +
>  mkdir -p "$outdir"
>  
>  # Disable globbing: command arguments may contain globbing characters and
> diff --git a/tests/fate/concatdec.mak b/tests/fate/concatdec.mak
> new file mode 100644
> index 000..89d5409
> --- /dev/null
> +++ b/tests/fate/concatdec.mak
> @@ -0,0 +1,12 @@
> +FATE_CONCAT_TEMPLATE=tests/test_template.ffconcat
> +
> +FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2, MPEGTS)+= ts
> +FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += mxf
> +FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += 
> mxf_d10
> +
> +$(foreach D,$(FATE_CONCAT_DEMUXER_LAVF-yes),$(eval 
> fate-concat-demuxer-lavf-$(D): ffprobe$(PROGSSUF)$(EXESUF) fate-lavf-$(D)))
> +$(foreach D,$(FATE_CONCAT_DEMUXER_LAVF-yes),$(eval 
> fate-concat-demuxer-lavf-$(D): CMD = concat $(FATE_CONCAT_TEMPLATE) 
> tests/data/lavf/lavf.$(D)))
> +
> +FATE_CONCAT_DEMUXER-$(CONFIG_CONCAT_DEMUXER) += 
> $(FATE_CONCAT_DEMUXER_LAVF-yes:%=fate-concat-demuxer-lavf-%)
> +
> +FATE-$(CONFIG_FFPROBE) += $(FATE_CONCAT_DEMUXER-yes)

I am not fluent enough in make, I will trust you on this.

> diff --git a/tests/ref/fate/concat-demuxer-lavf-mxf 
> b/tests/ref/fate/concat-demuxer-lavf-mxf
> new file mode 100644
> index 000..a6fa554
> --- /dev/null
> +++ b/tests/ref/fate/concat-demuxer-lavf-mxf
> @@ -0,0 +1 @@
> +56359998da34c3957124a8928fb58f3d 
> *tests/data/fate/concat-demuxer-lavf-mxf.ffprobe
> diff --git a/tests/ref/fate/concat-demuxer-lavf-mxf_d10 
> b/tests/ref/fate/concat-demuxer-lavf-mxf_d10
> new file mode 100644
> index 000..018d631
> --- /dev/null
> +++ b/tests/ref/fate/concat-demuxer-lavf-mxf_d10
> @@ -0,0 +1 @@
> +89c81149b4673c60aba7cf5f27cec823 
> *tests/data/fate/concat-demuxer-lavf-mxf_d10.ffprobe
> diff --git a/tests/ref/fate/concat-demuxer-lavf-ts 
> b/tests/ref/fate/concat-demuxer-lavf-ts
> new file mode 100644
> index 000..2e8ba46
> --- /dev/null
> +++ b/tests/ref/fate/concat-demuxer-lavf-ts
> @@ -0,0 +1 @@
> +1993b3613952fa76da8c5c260a16a96a 
> *tests/data/fate/concat-demuxer-lavf-ts.ffprobe
> diff --git a/tests/test_template.ffconcat b/tests/test_template.ffconcat
> new file mode 100644
> index 000..e9b685d
> --- /dev/null
> +++ b/tests/test_template.ffconcat
> @@ -0,0 +1,112 @@

> +#ffconcat version 1.0
> +# ^ header is commented out to avoid probing therefore enable unsafe paths

Probably better to pass "-safe 0" explicitly.

> +
> +file  %SRCFILE%
> +
> +file  %SRCFILE%
> +file_packet_metadata dummy=1
> +duration  1
> +

> +file  %SRCFILE%
> +inpoint   00:00.00
> +outpoint  00:00.04
> +
> +file  %SRCFILE%
> +inpoint   00:00.04
> +outpoint  00:00.08


Does it need that many in/outpoints?

Regards,

-

[FFmpeg-devel] [PATCH 2/5] fate: add concat demuxer tests

2015-10-24 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 tests/Makefile |   1 +
 tests/fate-run.sh  |  14 
 tests/fate/concatdec.mak   |  12 
 tests/ref/fate/concat-demuxer-lavf-mxf |   1 +
 tests/ref/fate/concat-demuxer-lavf-mxf_d10 |   1 +
 tests/ref/fate/concat-demuxer-lavf-ts  |   1 +
 tests/test_template.ffconcat   | 112 +
 7 files changed, 142 insertions(+)
 create mode 100644 tests/fate/concatdec.mak
 create mode 100644 tests/ref/fate/concat-demuxer-lavf-mxf
 create mode 100644 tests/ref/fate/concat-demuxer-lavf-mxf_d10
 create mode 100644 tests/ref/fate/concat-demuxer-lavf-ts
 create mode 100644 tests/test_template.ffconcat

diff --git a/tests/Makefile b/tests/Makefile
index 7ee4a46..62544d0 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -113,6 +113,7 @@ include $(SRC_PATH)/tests/fate/audio.mak
 include $(SRC_PATH)/tests/fate/bmp.mak
 include $(SRC_PATH)/tests/fate/cdxl.mak
 include $(SRC_PATH)/tests/fate/checkasm.mak
+include $(SRC_PATH)/tests/fate/concatdec.mak
 include $(SRC_PATH)/tests/fate/cover-art.mak
 include $(SRC_PATH)/tests/fate/demux.mak
 include $(SRC_PATH)/tests/fate/dfa.mak
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index a3938dc..2056093 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -249,6 +249,20 @@ gapless(){
 do_md5sum $decfile3
 }
 
+concat(){
+template=$(target_path $1)
+sample=$(target_path $2)
+
+concatfile="${outdir}/${test}.ffconcat"
+packetfile="${outdir}/${test}.ffprobe"
+cleanfiles="$concatfile $packetfile"
+
+awk "{gsub(/%SRCFILE%/, \"$sample\"); print}" $template > $concatfile
+run ffprobe${PROGSUF} -show_streams -show_packets -v 0 -fflags keepside -f 
concat $concatfile > $packetfile
+
+do_md5sum $packetfile
+}
+
 mkdir -p "$outdir"
 
 # Disable globbing: command arguments may contain globbing characters and
diff --git a/tests/fate/concatdec.mak b/tests/fate/concatdec.mak
new file mode 100644
index 000..89d5409
--- /dev/null
+++ b/tests/fate/concatdec.mak
@@ -0,0 +1,12 @@
+FATE_CONCAT_TEMPLATE=tests/test_template.ffconcat
+
+FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2, MPEGTS)+= ts
+FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += mxf
+FATE_CONCAT_DEMUXER_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += mxf_d10
+
+$(foreach D,$(FATE_CONCAT_DEMUXER_LAVF-yes),$(eval 
fate-concat-demuxer-lavf-$(D): ffprobe$(PROGSSUF)$(EXESUF) fate-lavf-$(D)))
+$(foreach D,$(FATE_CONCAT_DEMUXER_LAVF-yes),$(eval 
fate-concat-demuxer-lavf-$(D): CMD = concat $(FATE_CONCAT_TEMPLATE) 
tests/data/lavf/lavf.$(D)))
+
+FATE_CONCAT_DEMUXER-$(CONFIG_CONCAT_DEMUXER) += 
$(FATE_CONCAT_DEMUXER_LAVF-yes:%=fate-concat-demuxer-lavf-%)
+
+FATE-$(CONFIG_FFPROBE) += $(FATE_CONCAT_DEMUXER-yes)
diff --git a/tests/ref/fate/concat-demuxer-lavf-mxf 
b/tests/ref/fate/concat-demuxer-lavf-mxf
new file mode 100644
index 000..a6fa554
--- /dev/null
+++ b/tests/ref/fate/concat-demuxer-lavf-mxf
@@ -0,0 +1 @@
+56359998da34c3957124a8928fb58f3d 
*tests/data/fate/concat-demuxer-lavf-mxf.ffprobe
diff --git a/tests/ref/fate/concat-demuxer-lavf-mxf_d10 
b/tests/ref/fate/concat-demuxer-lavf-mxf_d10
new file mode 100644
index 000..018d631
--- /dev/null
+++ b/tests/ref/fate/concat-demuxer-lavf-mxf_d10
@@ -0,0 +1 @@
+89c81149b4673c60aba7cf5f27cec823 
*tests/data/fate/concat-demuxer-lavf-mxf_d10.ffprobe
diff --git a/tests/ref/fate/concat-demuxer-lavf-ts 
b/tests/ref/fate/concat-demuxer-lavf-ts
new file mode 100644
index 000..2e8ba46
--- /dev/null
+++ b/tests/ref/fate/concat-demuxer-lavf-ts
@@ -0,0 +1 @@
+1993b3613952fa76da8c5c260a16a96a 
*tests/data/fate/concat-demuxer-lavf-ts.ffprobe
diff --git a/tests/test_template.ffconcat b/tests/test_template.ffconcat
new file mode 100644
index 000..e9b685d
--- /dev/null
+++ b/tests/test_template.ffconcat
@@ -0,0 +1,112 @@
+#ffconcat version 1.0
+# ^ header is commented out to avoid probing therefore enable unsafe paths
+
+file  %SRCFILE%
+
+file  %SRCFILE%
+file_packet_metadata dummy=1
+duration  1
+
+file  %SRCFILE%
+inpoint   00:00.00
+outpoint  00:00.04
+
+file  %SRCFILE%
+inpoint   00:00.04
+outpoint  00:00.08
+
+file  %SRCFILE%
+inpoint   00:00.08
+outpoint  00:00.12
+
+file  %SRCFILE%
+inpoint   00:00.12
+outpoint  00:00.16
+
+file  %SRCFILE%
+inpoint   00:00.16
+outpoint  00:00.20
+
+file  %SRCFILE%
+inpoint   00:00.20
+outpoint  00:00.24
+
+file  %SRCFILE%
+inpoint   00:00.24
+outpoint  00:00.28
+
+file  %SRCFILE%
+inpoint   00:00.28
+outpoint  00:00.32
+
+file  %SRCFILE%
+inpoint   00:00.32
+outpoint  00:00.36
+
+file  %SRCFILE%
+inpoint   00:00.36
+outpoint  00:00.40
+
+file  %SRCFILE%
+inpoint   00:00.40
+outpoint  00:00.44
+
+file  %SRCFILE%
+inpoint   00:00.44
+outpoint  00:00.48
+
+file  %SRCFILE%
+inpoint   00:00.48
+outpoint  00:00.52
+
+file  %SRCFILE%
+inpoint   00:00.52
+outpoint  00:00.56