3 # automatic regression test for ffmpeg
10 if [ "$1" = "mpeg4" ] ; then
12 elif [ "$1" = "mpeg" ] ; then
30 logfile="/tmp/ffmpeg.regression"
31 benchfile="/tmp/ffmpeg.bench"
32 raw_src="vsynth1/%d.pgm"
33 raw_dst="/tmp/out.yuv"
35 pcm_dst="/tmp/out.wav"
42 $ffmpeg -benchmark $* > /tmp/bench.tmp
44 expr match "`cat /tmp/bench.tmp`" '.*utime=\(.*s\)' > /tmp/bench2.tmp
45 echo `cat /tmp/bench2.tmp` $f >> $benchfile
49 echo "ffmpeg regression test" > $logfile
50 echo "ffmpeg benchmarks" > $benchfile
52 ###################################
53 if [ -n "$do_mpeg" ] ; then
55 file=${outfile}mpeg1.mpg
56 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpegvideo $file
59 do_ffmpeg $raw_dst -y -f mpegvideo -i $file -f rawvideo $raw_dst
62 #do_ffmpeg /tmp/out-mpeg2.yuv -y -f mpegvideo -i a.vob \
63 # -f rawvideo /tmp/out-mpeg2.yuv
66 ###################################
67 if [ -n "$do_msmpeg4" ] ; then
69 file=${outfile}msmpeg4.avi
70 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
73 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
76 ###################################
77 if [ -n "$do_h263" ] ; then
79 file=${outfile}h263.avi
80 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
83 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
86 ###################################
87 if [ -n "$do_mpeg4" ] ; then
89 file=${outfile}odivx.avi
90 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
93 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
96 ###################################
97 if [ -n "$do_mjpeg" ] ; then
99 file=${outfile}mjpeg.avi
100 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg $file
103 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
106 ###################################
107 if [ -n "$do_rv10" ] ; then
109 file=${outfile}rv10.rm
110 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
113 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
116 ###################################
117 if [ -n "$do_mp2" ] ; then
119 file=${outfile}mp2.mp2
120 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
123 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
126 ###################################
127 if [ -n "$do_ac3" ] ; then
129 file=${outfile}ac3.rm
130 do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
133 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
137 if diff -u $logfile $reffile ; then
139 echo Regression test succeeded.
143 echo Regression test: Error.