]> git.sesse.net Git - ffmpeg/blob - tests/regression.sh
snow regression test
[ffmpeg] / tests / regression.sh
1 #!/bin/sh
2 #
3 # automatic regression test for ffmpeg
4 #
5 #
6 #set -x
7 # Even in the 21st century some diffs are not supporting -u.
8 diff -u "$0" "$0" > /dev/null 2>&1
9 if [ $? -eq 0 ]; then
10   diff_cmd="diff -u"
11 else
12   diff_cmd="diff"
13 fi
14
15 diff -w "$0" "$0" > /dev/null 2>&1
16 if [ $? -eq 0 ]; then
17   diff_cmd="$diff_cmd -w"
18 fi
19
20 set -e
21
22 datadir="./data"
23
24 logfile="$datadir/ffmpeg.regression"
25 outfile="$datadir/a-"
26
27 # tests to do
28 if [ "$1" = "mpeg4" ] ; then
29     do_mpeg4=y
30 elif [ "$1" = "mpeg" ] ; then
31     do_mpeg=y
32     do_mpeg2=y
33 elif [ "$1" = "ac3" ] ; then
34     do_ac3=y
35 elif [ "$1" = "huffyuv" ] ; then
36     do_huffyuv=y
37 elif [ "$1" = "mpeg2thread" ] ; then
38     do_mpeg2thread=y
39 elif [ "$1" = "snow" ] ; then
40     do_snow=y
41 elif [ "$1" = "libavtest" ] ; then
42     do_libav=y
43     logfile="$datadir/libav.regression"
44     outfile="$datadir/b-"
45 else
46     do_mpeg=y
47     do_mpeg2=y
48     do_mpeg2thread=y
49     do_msmpeg4v2=y
50     do_msmpeg4=y
51     do_wmv1=y
52     do_wmv2=y
53     do_h261=y
54     do_h263=y
55     do_h263p=y
56     do_mpeg4=y
57     do_huffyuv=y
58     do_mjpeg=y
59     do_ljpeg=y
60     do_rv10=y
61     do_rv20=y
62     do_mp2=y
63     do_ac3=y
64     do_g726=y
65     do_adpcm_ima_wav=y
66     do_adpcm_ms=y
67     do_rc=y
68     do_mpeg4adv=y
69     do_mpeg4thread=y
70     do_mpeg4nr=y
71     do_mpeg1b=y
72     do_asv1=y
73     do_asv2=y
74     do_flv=y
75     do_ffv1=y
76     do_error=y
77     do_svq1=y
78     do_snow=y
79 fi
80
81
82 # various files
83 ffmpeg="../ffmpeg_g"
84 tiny_psnr="./tiny_psnr"
85 reffile="$2"
86 benchfile="$datadir/ffmpeg.bench"
87 raw_src="$3/%d.pgm"
88 raw_dst="$datadir/out.yuv"
89 raw_ref="$datadir/ref.yuv"
90 pcm_src="asynth1.sw"
91 pcm_dst="$datadir/out.wav"
92 pcm_ref="$datadir/ref.wav"
93 if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
94     do_md5sum() { md5sum -b $1; }
95 elif [ -x /sbin/md5 ]; then
96     do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
97 else
98     do_md5sum() { echo No md5sum program found; }
99 fi
100
101 # create the data directory if it does not exists
102 mkdir -p $datadir
103
104 do_ffmpeg()
105 {
106     f="$1"
107     shift
108     echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
109     $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
110     egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
111     rm -f /tmp/ffmpeg$$
112     do_md5sum $f >> $logfile
113     if [ $f = $raw_dst ] ; then
114         $tiny_psnr $f $raw_ref >> $logfile
115     elif [ $f = $pcm_dst ] ; then
116         $tiny_psnr $f $pcm_ref 2 >> $logfile
117     else
118         wc -c $f >> $logfile
119     fi
120     expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
121     echo `cat $datadir/bench2.tmp` $f >> $benchfile
122 }
123
124 do_ffmpeg_crc()
125 {
126     f="$1"
127     shift
128     echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
129     $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
130     egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
131     rm -f /tmp/ffmpeg$$ 
132     echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
133 }
134
135 do_ffmpeg_nocheck()
136 {
137     f="$1"
138     shift
139     echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
140     $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
141     egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
142     rm -f /tmp/ffmpeg$$
143     expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
144     echo `cat $datadir/bench2.tmp` $f >> $benchfile
145 }
146
147 echo "ffmpeg regression test" > $logfile
148 echo "ffmpeg benchmarks" > $benchfile
149
150 ###################################
151 # generate reference for quality check
152 do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
153 do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
154
155 ###################################
156 if [ -n "$do_mpeg" ] ; then
157 # mpeg1 encoding
158 file=${outfile}mpeg1.mpg
159 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file 
160
161 # mpeg1 decoding
162 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
163 fi
164
165 ###################################
166 if [ -n "$do_mpeg2" ] ; then
167 # mpeg2 encoding
168 file=${outfile}mpeg2.mpg
169 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file 
170
171 # mpeg2 decoding
172 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
173
174 # mpeg2 encoding
175 file=${outfile}mpeg2.mpg
176 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct_algo 1 -dct_algo 2 -f mpeg1video $file 
177
178 # mpeg2 decoding
179 do_ffmpeg $raw_dst -y -idct_algo 1 -i $file -f rawvideo $raw_dst
180
181 # mpeg2 encoding interlaced
182 file=${outfile}mpeg2i.mpg
183 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -ildct -ilme $file 
184
185 # mpeg2 decoding
186 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
187 fi
188
189 ###################################
190 if [ -n "$do_mpeg2thread" ] ; then
191 # mpeg2 encoding interlaced
192 file=${outfile}mpeg2thread.mpg
193 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -ildct -ilme -threads 2 $file 
194
195 # mpeg2 decoding
196 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
197
198 # mpeg2 encoding interlaced
199 file=${outfile}mpeg2reuse.mpg
200 do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -ildct -ilme -threads 4 $file 
201
202 # mpeg2 decoding
203 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
204 fi
205
206 ###################################
207 if [ -n "$do_msmpeg4v2" ] ; then
208 # msmpeg4 encoding
209 file=${outfile}msmpeg4v2.avi
210 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
211
212 # msmpeg4v2 decoding
213 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
214 fi
215
216 ###################################
217 if [ -n "$do_msmpeg4" ] ; then
218 # msmpeg4 encoding
219 file=${outfile}msmpeg4.avi
220 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
221
222 # msmpeg4 decoding
223 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
224 fi
225
226 ###################################
227 if [ -n "$do_wmv1" ] ; then
228 # wmv1 encoding
229 file=${outfile}wmv1.avi
230 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
231
232 # wmv1 decoding
233 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
234 fi
235
236 ###################################
237 if [ -n "$do_wmv2" ] ; then
238 # wmv2 encoding
239 file=${outfile}wmv2.avi
240 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
241
242 # wmv2 decoding
243 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
244 fi
245
246 ###################################
247 if [ -n "$do_h261" ] ; then
248 # h261 encoding
249 file=${outfile}h261.avi
250 do_ffmpeg $file -y -qscale 11 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h261 $file
251
252 # h261 decoding
253 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
254 fi
255
256 ###################################
257 if [ -n "$do_h263" ] ; then
258 # h263 encoding
259 file=${outfile}h263.avi
260 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
261
262 # h263 decoding
263 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
264 fi
265
266 ###################################
267 if [ -n "$do_h263p" ] ; then
268 # h263p encoding
269 file=${outfile}h263p.avi
270 do_ffmpeg $file -y -qscale 2 -umv -aiv -aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
271
272 # h263p decoding
273 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
274 fi
275
276 ###################################
277 if [ -n "$do_mpeg4" ] ; then
278 # mpeg4
279 file=${outfile}odivx.mp4
280 do_ffmpeg $file -y -4mv -hq -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
281
282 # mpeg4 decoding
283 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
284 fi
285
286 ###################################
287 if [ -n "$do_huffyuv" ] ; then
288 # huffyuv
289 file=${outfile}huffyuv.avi
290 do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec huffyuv -pix_fmt yuv422p $file
291
292 # huffyuv decoding
293 do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
294 fi
295
296 ###################################
297 if [ -n "$do_rc" ] ; then
298 # mpeg4 rate control
299 file=${outfile}mpeg4-rc.avi
300 do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
301
302 # mpeg4 rate control decoding
303 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
304 fi
305
306 ###################################
307 if [ -n "$do_mpeg4adv" ] ; then
308 # mpeg4
309 file=${outfile}mpeg4-adv.avi
310 do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 200 -aic -trell -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
311
312 # mpeg4 decoding
313 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
314 fi
315
316 ###################################
317 if [ -n "$do_mpeg4thread" ] ; then
318 # mpeg4
319 file=${outfile}mpeg4-thread.avi
320 do_ffmpeg $file -y -b 500 -4mv -hq -part -ps 200 -aic -trell -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 -threads 2 $file
321
322 # mpeg4 decoding
323 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
324 fi
325
326 ###################################
327 if [ -n "$do_mpeg4adv" ] ; then
328 # mpeg4
329 file=${outfile}mpeg4-Q.avi
330 do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -qpel -bf 2 -cmp 1 -subcmp 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
331
332 # mpeg4 decoding
333 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
334 fi
335
336 ###################################
337 if [ -n "$do_error" ] ; then
338 # damaged mpeg4
339 file=${outfile}error-mpeg4-adv.avi
340 do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -part -ps 250 -error 10 -aic -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
341
342 # damaged mpeg4 decoding
343 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
344 fi
345
346 ###################################
347 if [ -n "$do_mpeg4nr" ] ; then
348 # noise reduction
349 file=${outfile}mpeg4-nr.avi
350 do_ffmpeg $file -y -qscale 8 -4mv -mbd 2 -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
351
352 # mpeg4 decoding
353 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
354 fi
355
356 ###################################
357 if [ -n "$do_mpeg1b" ] ; then
358 # mpeg1
359 file=${outfile}mpeg1b.mpg
360 do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
361
362 # mpeg1 decoding
363 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
364 fi
365
366 ###################################
367 if [ -n "$do_mjpeg" ] ; then
368 # mjpeg
369 file=${outfile}mjpeg.avi
370 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg -pix_fmt yuvj420p $file
371
372 # mjpeg decoding
373 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
374 fi
375
376 ###################################
377 if [ -n "$do_ljpeg" ] ; then
378 # ljpeg
379 file=${outfile}ljpeg.avi
380 do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg -strict -1 $file
381
382 # ljpeg decoding
383 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
384 fi
385
386 ###################################
387 if [ -n "$do_rv10" ] ; then
388 # rv10 encoding
389 file=${outfile}rv10.rm
390 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file 
391
392 # rv10 decoding
393 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
394 fi
395
396 ###################################
397 if [ -n "$do_rv20" ] ; then
398 # rv20 encoding
399 file=${outfile}rv20.rm
400 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec rv20 -an $file 
401
402 # rv20 decoding
403 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
404 fi
405
406 ###################################
407 if [ -n "$do_asv1" ] ; then
408 # asv1 encoding
409 file=${outfile}asv1.avi
410 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
411
412 # asv1 decoding
413 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
414 fi
415
416 ###################################
417 if [ -n "$do_asv2" ] ; then
418 # asv2 encoding
419 file=${outfile}asv2.avi
420 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
421
422 # asv2 decoding
423 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
424 fi
425
426 ###################################
427 if [ -n "$do_flv" ] ; then
428 # flv encoding
429 file=${outfile}flv.flv
430 do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
431
432 # flv decoding
433 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
434 fi
435
436 ###################################
437 if [ -n "$do_ffv1" ] ; then
438 # ffv1 encoding
439 file=${outfile}ffv1.avi
440 do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
441
442 # ffv1 decoding
443 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
444 fi
445
446 ###################################
447 if [ -n "$do_snow" ] ; then
448 # snow encoding
449 file=${outfile}snow.avi
450 do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec snow -qscale 2 $file
451
452 # snow decoding
453 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
454
455 # snow encoding
456 file=${outfile}snow53.avi
457 do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec snow -pred 1 -qpel -4mv $file
458
459 # snow decoding
460 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
461 fi
462
463 ###################################
464 if [ -n "$do_svq1" ] ; then
465 # svq1 encoding
466 file=${outfile}svq1.mov
467 do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
468
469 # svq1 decoding
470 do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
471 fi
472
473 ###################################
474 if [ -n "$do_mp2" ] ; then
475 # mp2 encoding
476 file=${outfile}mp2.mp2
477 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file 
478
479 # mp2 decoding
480 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
481 $tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
482 fi
483
484 ###################################
485 if [ -n "$do_ac3" ] ; then
486 # ac3 encoding
487 file=${outfile}ac3.rm
488 do_ffmpeg $file -y -ab 128 -ac 2 -f s16le  -i $pcm_src -vn $file 
489
490 # ac3 decoding
491 #do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
492 fi
493
494 ###################################
495 if [ -n "$do_g726" ] ; then
496 # g726 encoding
497 file=${outfile}g726.wav
498 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file 
499
500 # g726 decoding
501 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
502 fi
503
504 ###################################
505 if [ -n "$do_adpcm_ima_wav" ] ; then
506 # encoding
507 file=${outfile}adpcm_ima.wav
508 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file 
509
510 # decoding
511 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
512 fi
513
514 ###################################
515 if [ -n "$do_adpcm_ms" ] ; then
516 # encoding
517 file=${outfile}adpcm_ms.wav
518 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file 
519
520 # decoding
521 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
522 fi
523
524 ###################################
525 # libav testing
526 ###################################
527
528 if [ -n "$do_libav" ] ; then
529
530 # avi
531 file=${outfile}libav.avi
532 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
533 do_ffmpeg_crc $file -i $file
534
535 # asf
536 file=${outfile}libav.asf
537 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
538 do_ffmpeg_crc $file -i $file -r 25
539
540 # rm
541 file=${outfile}libav.rm
542 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
543 # broken
544 #do_ffmpeg_crc $file -i $file
545
546 # mpegps
547 file=${outfile}libav.mpg
548 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
549 do_ffmpeg_crc $file -i $file
550
551 # swf (decode audio only)
552 file=${outfile}libav.swf
553 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
554 do_ffmpeg_crc $file -i $file
555
556 # ffm
557 file=${outfile}libav.ffm
558 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
559 do_ffmpeg_crc $file -i $file
560
561 # flv
562 file=${outfile}libav.flv
563 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
564 do_ffmpeg_crc $file -i $file
565
566 # mov
567 file=${outfile}libav.mov
568 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
569 do_ffmpeg_crc $file -i $file
570
571 # nut
572 file=${outfile}libav.nut
573 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
574 do_ffmpeg_crc $file -i $file
575
576 # dv
577 file=${outfile}libav.dv
578 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -ar 48000 -r 25 -s pal -ac 2 $file
579 do_ffmpeg_crc $file -i $file
580
581 # XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)
582
583 ####################
584 # streamed images
585 # mjpeg
586 #file=${outfile}libav.mjpeg
587 #do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
588 #do_ffmpeg_crc $file -i $file
589
590 # pbmpipe
591 file=${outfile}libav.pbm
592 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
593 do_ffmpeg_crc $file -f image2pipe -i $file
594
595 # pgmpipe
596 file=${outfile}libav.pgm
597 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
598 do_ffmpeg_crc $file -f image2pipe -i $file
599
600 # ppmpipe
601 file=${outfile}libav.ppm
602 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
603 do_ffmpeg_crc $file -f image2pipe -i $file
604
605 # gif
606 file=${outfile}libav.gif
607 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
608 #do_ffmpeg_crc $file -i $file
609
610 # yuv4mpeg
611 file=${outfile}libav.yuv4mpeg
612 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
613 #do_ffmpeg_crc $file -i $file
614
615 ####################
616 # image formats
617 # pgm (we do not do md5 on image files yet)
618 file=${outfile}libav%d.pgm
619 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
620 do_ffmpeg_crc $file -i $file
621
622 # ppm (we do not do md5 on image files yet)
623 file=${outfile}libav%d.ppm
624 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
625 do_ffmpeg_crc $file -i $file
626
627 # jpeg (we do not do md5 on image files yet)
628 file=${outfile}libav%d.jpg
629 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src -bitexact -dct_algo 1 -idct_algo 2 -pix_fmt yuvj420p -f image2 $file
630 do_ffmpeg_crc $file -f image2 -i $file
631
632 ####################
633 # audio only
634
635 # wav
636 file=${outfile}libav.wav
637 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
638 do_ffmpeg_crc $file -i $file
639
640 # alaw
641 file=${outfile}libav.al
642 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
643 do_ffmpeg_crc $file -i $file
644
645 # mulaw
646 file=${outfile}libav.ul
647 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
648 do_ffmpeg_crc $file -i $file
649
650 # au
651 file=${outfile}libav.au
652 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
653 do_ffmpeg_crc $file -i $file
654
655 ####################
656 # pix_fmt conversions
657 conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
658              yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
659              monob pal8"
660 for pix_fmt in $conversions ; do
661     file=${outfile}libav-${pix_fmt}.yuv
662     do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
663                             -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
664     do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
665                     -f rawvideo -s 352x288 -pix_fmt yuv444p $file
666 done
667
668 fi
669
670
671
672 if $diff_cmd "$logfile" "$reffile" ; then
673     echo 
674     echo Regression test succeeded.
675     exit 0
676 else
677     echo 
678     echo Regression test: Error.
679     exit 1
680 fi