[FFmpeg-devel] [PATCH] fate: use the lavfi -graph_file option to workaround path issues.

Clément Bœsch ubitux at gmail.com
Wed Oct 24 23:42:31 CEST 2012


---
FATE is still broken due to various path issues. This is an attempt to fix it
using the new introduced -graph_file option. I have no mean to test it with
mingw/msys/msvc stuff so I have no idea if it works as expected.

Here are the two issues supposed to be fixed:

  - the source file is passed as a standalone argument to printf, and I just
    hope here msys will do its work and replace paths such as "/d/foo/bar" into
    "d:/foo/bar". This is a problem currently happening with the scene
    detection because the filename is bogged down into the middle of the
    filtergraph and isn't substitute.

  - in the command line, when you do "movie='d:/foo/bar':foobar=...", the ''
    are dropped in a first pass, so the filter receives
    "movie=d:/foo/bar:foobar=..." thus breaks. This is a problem currently
    happening with the silence detection. It shouldn't happen with a
    filtergraph in a file since it is opened within lavfi.
---
 tests/fate-run.sh     | 19 +++++++++++++++++++
 tests/fate/filter.mak |  6 ++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index ccd04a3..75bc1b7 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -104,6 +104,25 @@ pcm(){
     ffmpeg "$@" -vn -f s16le -
 }
 
+metadata(){
+    filter_type=$1
+    name=$2
+    src=$3
+    filter=$4
+
+    graph_file=tests/data/$name.lavfi
+    if [ $filter_type = audio ]; then
+        printf "amovie='" > $graph_file
+    else
+        printf "sws_flags=+accurate_rnd+bitexact; movie='" > $graph_file
+    fi
+
+    # two different commands to make sure the path is substituted by msys
+    printf $src        >> $graph_file
+    printf "',$filter" >> $graph_file
+    run ffprobe -show_frames -of compact=nk=1:p=0 -bitexact -f lavfi -graph_file $graph_file $name
+}
+
 enc_dec_pcm(){
     out_fmt=$1
     dec_fmt=$2
diff --git a/tests/fate/filter.mak b/tests/fate/filter.mak
index 66ff333..f6bcbed 100644
--- a/tests/fate/filter.mak
+++ b/tests/fate/filter.mak
@@ -49,18 +49,16 @@ FATE_SAMPLES_AVCONV += $(FATE_FILTER-yes)
 #
 # Metadata tests
 #
-FILTER_METADATA_COMMAND = ffprobe$(EXESUF) -show_frames -of compact=nk=1:p=0 -bitexact -f lavfi
-
 SCENEDETECT_DEPS = FFPROBE LAVFI_INDEV MOVIE_FILTER SELECT_FILTER SCALE_FILTER \
                    AVCODEC MOV_DEMUXER SVQ3_DECODER ZLIB
 FATE_METADATA_FILTER-$(call ALLYES, $(SCENEDETECT_DEPS)) += fate-filter-metadata-scenedetect
 fate-filter-metadata-scenedetect: SRC = $(SAMPLES)/svq3/Vertical400kbit.sorenson3.mov
-fate-filter-metadata-scenedetect: CMD = run $(FILTER_METADATA_COMMAND) "sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',select=gt(scene\,.4)"
+fate-filter-metadata-scenedetect: CMD = metadata video scenedetect $(SRC) "select=gt(scene\,.4)"
 
 SILENCEDETECT_DEPS = FFPROBE LAVFI_INDEV AMOVIE_FILTER AMR_DEMUXER AMRWB_DECODER
 FATE_METADATA_FILTER-$(call ALLYES, $(SILENCEDETECT_DEPS)) += fate-filter-metadata-silencedetect
 fate-filter-metadata-silencedetect: SRC = $(SAMPLES)/amrwb/seed-12k65.awb
-fate-filter-metadata-silencedetect: CMD = run $(FILTER_METADATA_COMMAND) "amovie='$(SRC)',silencedetect=d=.1"
+fate-filter-metadata-silencedetect: CMD = metadata audio silencedetect $(SRC) "silencedetect=d=.1"
 
 FATE_SAMPLES_FFPROBE += $(FATE_METADATA_FILTER-yes)
 
-- 
1.8.0



More information about the ffmpeg-devel mailing list