From e4563c2caf3aae298d4022ca778b1217e2dc0f12 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 4 May 2022 15:49:40 +0200 Subject: [PATCH] tests/fate-run: Remove temporary fate-lavf files if possible The temporary fate-lavf files can easily be removed if they are not needed as inputs for other tests (mainly fate-seek-tests). This commit implements this. The size of the remaining files decreases from 260890083B to 79481793B. Signed-off-by: Andreas Rheinhardt --- tests/fate-run.sh | 12 +++++++++++- tests/fate/api.mak | 1 + tests/fate/concatdec.mak | 7 ++++++- tests/fate/ffmpeg.mak | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/fate-run.sh b/tests/fate-run.sh index 42cd50f50f..5939761997 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -310,6 +310,7 @@ lavf_audio(){ t="${test#lavf-}" outdir="tests/data/lavf" file=${outdir}/lavf.$t + test "$keep" -ge 1 || cleanfiles="$cleanfiles $file" do_avconv $file -auto_conversion_filters $DEC_OPTS $1 -ar 44100 -f s16le -i $pcm_src "$ENC_OPTS -metadata title=lavftest" -t 1 -qscale 10 $2 test "$4" = "disable_crc" || do_avconv_crc $file -auto_conversion_filters $DEC_OPTS $3 -i $target_path/$file @@ -319,6 +320,7 @@ lavf_container(){ t="${test#lavf-}" outdir="tests/data/lavf" file=${outdir}/lavf.$t + test "$keep" -ge 1 || cleanfiles="$cleanfiles $file" do_avconv $file -auto_conversion_filters $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $DEC_OPTS -ar 44100 -f s16le $1 -i $pcm_src "$ENC_OPTS -metadata title=lavftest" -b:a 64k -t 1 -qscale:v 10 $2 test "$3" = "disable_crc" || do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i $target_path/$file $3 @@ -347,11 +349,18 @@ lavf_container_fate() } lavf_image(){ + nb_frames=13 t="${test#lavf-}" outdir="tests/data/images/$t" mkdir -p "$outdir" file=${outdir}/%02d.$t - run_avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $1 "$ENC_OPTS -metadata title=lavftest" -vf scale -frames 13 -y -qscale 10 $target_path/$file + if [ "$keep" -lt 1 ]; then + for i in `seq $nb_frames`; do + filename=`printf "$file" $i` + cleanfiles="$cleanfiles $filename" + done + fi + run_avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $1 "$ENC_OPTS -metadata title=lavftest" -vf scale -frames $nb_frames -y -qscale 10 $target_path/$file do_md5sum ${outdir}/02.$t do_avconv_crc $file -auto_conversion_filters $DEC_OPTS $2 -i $target_path/$file $2 echo $(wc -c ${outdir}/02.$t) @@ -370,6 +379,7 @@ lavf_video(){ t="${test#lavf-}" outdir="tests/data/lavf" file=${outdir}/lavf.$t + test "$keep" -ge 1 || cleanfiles="$cleanfiles $file" do_avconv $file -auto_conversion_filters $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src "$ENC_OPTS -metadata title=lavftest" -t 1 -qscale 10 $1 $2 do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i $target_path/$file $1 } diff --git a/tests/fate/api.mak b/tests/fate/api.mak index 10288f5aba..688fc0f9b3 100644 --- a/tests/fate/api.mak +++ b/tests/fate/api.mak @@ -18,6 +18,7 @@ fate-api-h264-slice: CMD = run $(APITESTSDIR)/api-h264-slice-test$(EXESUF) 2 $(T FATE_API_LIBAVFORMAT-$(call DEMDEC, FLV, FLV) += fate-api-seek fate-api-seek: $(APITESTSDIR)/api-seek-test$(EXESUF) fate-lavf-flv +fate-lavf-flv: KEEP_FILES ?= 1 fate-api-seek: CMD = run $(APITESTSDIR)/api-seek-test$(EXESUF) $(TARGET_PATH)/tests/data/lavf/lavf.flv 0 720 fate-api-seek: CMP = null diff --git a/tests/fate/concatdec.mak b/tests/fate/concatdec.mak index 26d4a63179..c0dc6d4c94 100644 --- a/tests/fate/concatdec.mak +++ b/tests/fate/concatdec.mak @@ -4,7 +4,12 @@ FATE_CONCAT_DEMUXER_SIMPLE2_LAVF := ts FATE_CONCAT_DEMUXER_EXTENDED_LAVF := mxf mxf_d10 -$(foreach D,SIMPLE1 SIMPLE2 EXTENDED,$(eval FATE_CONCAT_DEMUXER_$(D)_LAVF := $$(filter $$(FATE_LAVF_CONTAINER:fate-lavf-%=%),$$(FATE_CONCAT_DEMUXER_$(D)_LAVF)))) +define FATE_CONCAT_DEMUXER_SUITE +$$(addprefix fate-lavf-,$$(FATE_CONCAT_DEMUXER_$(D)_LAVF)): KEEP_FILES ?= 1 +FATE_CONCAT_DEMUXER_$(D)_LAVF := $$(filter $$(FATE_LAVF_CONTAINER:fate-lavf-%=%),$$(FATE_CONCAT_DEMUXER_$(D)_LAVF)) +endef + +$(foreach D,SIMPLE1 SIMPLE2 EXTENDED,$(eval $(FATE_CONCAT_DEMUXER_SUITE))) $(foreach D,$(FATE_CONCAT_DEMUXER_SIMPLE1_LAVF),$(eval fate-concat-demuxer-simple1-lavf-$(D): fate-lavf-$(D))) $(foreach D,$(FATE_CONCAT_DEMUXER_SIMPLE1_LAVF),$(eval fate-concat-demuxer-simple1-lavf-$(D): CMD = concat $(SRC_PATH)/tests/simple1.ffconcat ../lavf/lavf.$(D))) diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index c83978f39e..9d14a96e13 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -138,6 +138,7 @@ fate-copy-trac2211-avi: CMD = transcode "h264 -r 14" $(TARGET_SAMPLES)/h264/bbc2 FATE_STREAMCOPY-$(call ENCDEC, APNG, APNG) += fate-copy-apng fate-copy-apng: fate-lavf-apng +fate-lavf-apng: KEEP_FILES ?= 1 fate-copy-apng: CMD = transcode apng tests/data/lavf/lavf.apng apng "-c:v copy" FATE_STREAMCOPY-$(call DEMMUX, OGG, OGG) += fate-limited_input_seek fate-limited_input_seek-copyts