3 # automatic regression test for ffmpeg
11 logfile="$datadir/ffmpeg.regression"
14 if [ "$1" = "mpeg4" ] ; then
16 elif [ "$1" = "mpeg" ] ; then
18 elif [ "$1" = "libavtest" ] ; then
20 logfile="$datadir/libav.regression"
37 benchfile="$datadir/ffmpeg.bench"
38 raw_src="vsynth1/%d.pgm"
39 raw_dst="$datadir/out.yuv"
41 pcm_dst="$datadir/out.wav"
43 # create the data directory if it does not exists
50 echo $ffmpeg -bitexact $*
51 $ffmpeg -bitexact -benchmark $* > $datadir/bench.tmp
53 expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
54 echo `cat $datadir/bench2.tmp` $f >> $benchfile
57 function do_ffmpeg_crc ()
61 echo $ffmpeg -y -bitexact $* -f crc $datadir/ffmpeg.crc
62 $ffmpeg -y -bitexact $* -f crc $datadir/ffmpeg.crc
63 echo -n "$f " >> $logfile
64 cat $datadir/ffmpeg.crc >> $logfile
67 echo "ffmpeg regression test" > $logfile
68 echo "ffmpeg benchmarks" > $benchfile
70 ###################################
71 if [ -n "$do_mpeg" ] ; then
73 file=${outfile}mpeg1.mpg
74 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
77 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
80 #do_ffmpeg /tmp/out-mpeg2.yuv -y -f mpegvideo -i a.vob \
81 # -f rawvideo /tmp/out-mpeg2.yuv
84 ###################################
85 if [ -n "$do_msmpeg4" ] ; then
87 file=${outfile}msmpeg4.avi
88 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
91 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
94 ###################################
95 if [ -n "$do_h263" ] ; then
97 file=${outfile}h263.avi
98 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
101 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
104 ###################################
105 if [ -n "$do_mpeg4" ] ; then
107 file=${outfile}odivx.avi
108 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
111 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
114 ###################################
115 if [ -n "$do_mjpeg" ] ; then
117 file=${outfile}mjpeg.avi
118 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg $file
121 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
124 ###################################
125 if [ -n "$do_rv10" ] ; then
127 file=${outfile}rv10.rm
128 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
131 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
134 ###################################
135 if [ -n "$do_mp2" ] ; then
137 file=${outfile}mp2.mp2
138 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
141 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
144 ###################################
145 if [ -n "$do_ac3" ] ; then
147 file=${outfile}ac3.rm
148 do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
151 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
154 ###################################
156 ###################################
158 if [ -n "$do_libav" ] ; then
161 file=${outfile}libav.avi
162 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
163 do_ffmpeg_crc $file -i $file
166 file=${outfile}libav.asf
167 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
168 do_ffmpeg_crc $file -i $file
171 file=${outfile}libav.rm
172 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
174 #do_ffmpeg_crc $file -i $file
177 file=${outfile}libav.mpg
178 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
179 do_ffmpeg_crc $file -i $file
181 # swf (decode audio only)
182 file=${outfile}libav.swf
183 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
184 do_ffmpeg_crc $file -i $file
187 file=${outfile}libav.ffm
188 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
189 do_ffmpeg_crc $file -i $file
191 # XXX: need mov and mpegts tests (add bitstreams or add output capability in ffmpeg)
196 file=${outfile}libav.mjpeg
197 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
198 do_ffmpeg_crc $file -i $file
201 file=${outfile}libav.pgmpipe
202 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f pgmpipe $file
203 do_ffmpeg_crc $file -f pgmpipe -i $file
206 file=${outfile}libav.ppmpipe
207 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f ppmpipe $file
208 do_ffmpeg_crc $file -f ppmpipe -i $file
211 file=${outfile}libav.gif
212 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f ppmpipe $file
213 #do_ffmpeg_crc $file -f ppmpipe -i $file
217 # pgm (we do not do md5 on image files yet)
218 file=${outfile}libav%d.pgm
219 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
220 do_ffmpeg_crc $file -i $file
222 # ppm (we do not do md5 on image files yet)
223 file=${outfile}libav%d.ppm
224 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
225 do_ffmpeg_crc $file -i $file
227 # jpeg (we do not do md5 on image files yet)
228 file=${outfile}libav%d.jpg
229 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
230 do_ffmpeg_crc $file -i $file
236 file=${outfile}libav.wav
237 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
238 do_ffmpeg_crc $file -i $file
241 file=${outfile}libav.al
242 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
243 do_ffmpeg_crc $file -i $file
246 file=${outfile}libav.ul
247 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
248 do_ffmpeg_crc $file -i $file
251 file=${outfile}libav.au
252 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
253 do_ffmpeg_crc $file -i $file
259 if diff -u $logfile $reffile ; then
261 echo Regression test succeeded.
265 echo Regression test: Error.