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

Nicolas George george at nsup.org
Sun Oct 25 14:57:56 CET 2015


Le tridi 3 brumaire, an CCXXIV, Marton Balint a écrit :
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  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 0000000..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 0000000..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 0000000..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 0000000..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 0000000..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
<snip>

Does it need that many in/outpoints?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151025/a92f6e1e/attachment.sig>


More information about the ffmpeg-devel mailing list