3 # automatic regression test for ffmpeg
11 logfile="$datadir/ffmpeg.regression"
14 if [ "$1" = "mpeg4" ] ; then
16 elif [ "$1" = "mpeg" ] ; then
18 elif [ "$1" = "ac3" ] ; then
20 elif [ "$1" = "libavtest" ] ; then
22 logfile="$datadir/libav.regression"
47 benchfile="$datadir/ffmpeg.bench"
48 raw_src="vsynth1/%d.pgm"
49 raw_dst="$datadir/out.yuv"
51 pcm_dst="$datadir/out.wav"
53 # create the data directory if it does not exists
60 echo $ffmpeg -bitexact -dct_algo 1 -idct_algo 2 $*
61 $ffmpeg -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp
62 md5sum -b $f >> $logfile
63 expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
64 echo `cat $datadir/bench2.tmp` $f >> $benchfile
71 echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
72 $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
73 echo -n "$f " >> $logfile
74 cat $datadir/ffmpeg.crc >> $logfile
77 echo "ffmpeg regression test" > $logfile
78 echo "ffmpeg benchmarks" > $benchfile
80 ###################################
81 if [ -n "$do_mpeg" ] ; then
83 file=${outfile}mpeg1.mpg
84 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
87 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
90 #do_ffmpeg /tmp/out-mpeg2.yuv -y -f mpegvideo -i a.vob \
91 # -f rawvideo /tmp/out-mpeg2.yuv
94 ###################################
95 if [ -n "$do_msmpeg4v2" ] ; then
97 file=${outfile}msmpeg4v2.avi
98 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
101 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
104 ###################################
105 if [ -n "$do_msmpeg4" ] ; then
107 file=${outfile}msmpeg4.avi
108 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
111 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
114 ###################################
115 if [ -n "$do_wmv1" ] ; then
117 file=${outfile}wmv1.avi
118 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
121 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
124 ###################################
125 if [ -n "$do_wmv2" ] ; then
127 file=${outfile}wmv2.avi
128 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
131 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
134 ###################################
135 if [ -n "$do_h263" ] ; then
137 file=${outfile}h263.avi
138 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
141 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
144 ###################################
145 if [ -n "$do_h263p" ] ; then
147 file=${outfile}h263p.avi
148 do_ffmpeg $file -y -qscale 10 -umv -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
151 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
154 ###################################
155 if [ -n "$do_mpeg4" ] ; then
157 file=${outfile}odivx.avi
158 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
161 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
164 ###################################
165 if [ -n "$do_huffyuv" ] ; then
167 file=${outfile}huffyuv.avi
168 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec huffyuv -strict -1 $file
171 do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
174 ###################################
175 if [ -n "$do_rc" ] ; then
177 file=${outfile}mpeg4-rc.avi
178 do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
180 # mpeg4 rate control decoding
181 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
184 ###################################
185 if [ -n "$do_mpeg4adv" ] ; then
187 file=${outfile}mpeg4-adv.avi
188 do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
191 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
194 ###################################
195 if [ -n "$do_mpeg1b" ] ; then
197 file=${outfile}mpeg1b.mpg
198 do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video $file
201 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
204 ###################################
205 if [ -n "$do_mjpeg" ] ; then
207 file=${outfile}mjpeg.avi
208 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg $file
211 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
214 ###################################
215 if [ -n "$do_rv10" ] ; then
217 file=${outfile}rv10.rm
218 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
221 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
224 ###################################
225 if [ -n "$do_mp2" ] ; then
227 file=${outfile}mp2.mp2
228 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
231 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
234 ###################################
235 if [ -n "$do_ac3" ] ; then
237 file=${outfile}ac3.rm
238 do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
241 #do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
244 ###################################
246 ###################################
248 if [ -n "$do_libav" ] ; then
251 file=${outfile}libav.avi
252 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
253 do_ffmpeg_crc $file -i $file
256 file=${outfile}libav.asf
257 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
258 do_ffmpeg_crc $file -i $file
261 file=${outfile}libav.rm
262 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
264 #do_ffmpeg_crc $file -i $file
267 file=${outfile}libav.mpg
268 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
269 do_ffmpeg_crc $file -i $file
271 # swf (decode audio only)
272 file=${outfile}libav.swf
273 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
274 do_ffmpeg_crc $file -i $file
277 file=${outfile}libav.ffm
278 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
279 do_ffmpeg_crc $file -i $file
281 # XXX: need mov and mpegts tests (add bitstreams or add output capability in ffmpeg)
286 file=${outfile}libav.mjpeg
287 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
288 do_ffmpeg_crc $file -i $file
291 file=${outfile}libav.pbm
292 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
293 do_ffmpeg_crc $file -f imagepipe -i $file
296 file=${outfile}libav.pgm
297 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
298 do_ffmpeg_crc $file -f imagepipe -i $file
301 file=${outfile}libav.ppm
302 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
303 do_ffmpeg_crc $file -f imagepipe -i $file
306 file=${outfile}libav.gif
307 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
308 #do_ffmpeg_crc $file -i $file
311 file=${outfile}libav.yuv4mpeg
312 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
313 #do_ffmpeg_crc $file -i $file
317 # pgm (we do not do md5 on image files yet)
318 file=${outfile}libav%d.pgm
319 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
320 do_ffmpeg_crc $file -i $file
322 # ppm (we do not do md5 on image files yet)
323 file=${outfile}libav%d.ppm
324 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
325 do_ffmpeg_crc $file -i $file
327 # jpeg (we do not do md5 on image files yet)
328 file=${outfile}libav%d.jpg
329 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
330 do_ffmpeg_crc $file -i $file
336 file=${outfile}libav.wav
337 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
338 do_ffmpeg_crc $file -i $file
341 file=${outfile}libav.al
342 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
343 do_ffmpeg_crc $file -i $file
346 file=${outfile}libav.ul
347 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
348 do_ffmpeg_crc $file -i $file
351 file=${outfile}libav.au
352 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
353 do_ffmpeg_crc $file -i $file
359 if diff -u $logfile $reffile ; then
361 echo Regression test succeeded.
365 echo Regression test: Error.