Simplify regression test execution.
[libav.git] / 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" = "snowll" ] ; then
42 do_snowll=y
43 elif [ "$1" = "libavtest" ] ; then
44 do_libav=y
45 logfile="$datadir/libav.regression"
46 outfile="$datadir/b-"
47 else
48 do_mpeg=y
49 do_mpeg2=y
50 do_mpeg2thread=y
51 do_msmpeg4v2=y
52 do_msmpeg4=y
53 do_wmv1=y
54 do_wmv2=y
55 do_h261=y
56 do_h263=y
57 do_h263p=y
58 do_mpeg4=y
59 do_mp4psp=y
60 do_huffyuv=y
61 do_mjpeg=y
62 do_ljpeg=y
63 do_jpegls=y
64 do_rv10=y
65 do_rv20=y
66 do_mp2=y
67 do_ac3=y
68 do_g726=y
69 do_adpcm_ima_wav=y
70 do_adpcm_ms=y
71 do_flac=y
72 do_rc=y
73 do_mpeg4adv=y
74 do_mpeg4thread=y
75 do_mpeg4nr=y
76 do_mpeg1b=y
77 do_asv1=y
78 do_asv2=y
79 do_flv=y
80 do_ffv1=y
81 do_error=y
82 do_svq1=y
83 do_snow=y
84 do_snowll=y
85 do_adpcm_yam=y
86 do_dv=y
87 do_dv50=y
88 fi
89
90
91 # various files
92 ffmpeg="../ffmpeg_g"
93 tiny_psnr="./tiny_psnr"
94 reffile="$2"
95 benchfile="$datadir/ffmpeg.bench"
96 raw_src="$3/%02d.pgm"
97 raw_dst="$datadir/out.yuv"
98 raw_ref="$datadir/ref.yuv"
99 pcm_src="asynth1.sw"
100 pcm_dst="$datadir/out.wav"
101 pcm_ref="$datadir/ref.wav"
102 if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
103 do_md5sum() { md5sum -b $1; }
104 elif [ -x /sbin/md5 ]; then
105 do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
106 else
107 do_md5sum() { echo No md5sum program found; }
108 fi
109
110 # create the data directory if it does not exists
111 mkdir -p $datadir
112
113 FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple"
114
115 do_ffmpeg()
116 {
117 f="$1"
118 shift
119 echo $ffmpeg $FFMPEG_OPTS $*
120 $ffmpeg $FFMPEG_OPTS -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
121 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
122 rm -f /tmp/ffmpeg$$
123 do_md5sum $f >> $logfile
124 if [ $f = $raw_dst ] ; then
125 $tiny_psnr $f $raw_ref >> $logfile
126 elif [ $f = $pcm_dst ] ; then
127 $tiny_psnr $f $pcm_ref 2 >> $logfile
128 else
129 wc -c $f >> $logfile
130 fi
131 expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
132 echo `cat $datadir/bench2.tmp` $f >> $benchfile
133 }
134
135 do_ffmpeg_crc()
136 {
137 f="$1"
138 shift
139 echo $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc
140 $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
141 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:|ffmpeg version| configuration| built)" /tmp/ffmpeg$$ || true
142 rm -f /tmp/ffmpeg$$
143 echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
144 }
145
146 do_ffmpeg_nocheck()
147 {
148 f="$1"
149 shift
150 echo $ffmpeg $FFMPEG_OPTS $*
151 $ffmpeg $FFMPEG_OPTS -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
152 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
153 rm -f /tmp/ffmpeg$$
154 expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
155 echo `cat $datadir/bench2.tmp` $f >> $benchfile
156 }
157
158 do_video_decoding()
159 {
160 do_ffmpeg $raw_dst -y -i $file -f rawvideo $@ $raw_dst
161 }
162
163 do_video_encoding()
164 {
165 do_ffmpeg $file -y $1 -f pgmyuv -i $raw_src $2 $file
166 }
167
168 echo "ffmpeg regression test" > $logfile
169 echo "ffmpeg benchmarks" > $benchfile
170
171 ###################################
172 # generate reference for quality check
173 do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
174 do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
175
176 ###################################
177 if [ -n "$do_mpeg" ] ; then
178 # mpeg1 encoding
179 file=${outfile}mpeg1.mpg
180 do_video_encoding "-qscale 10" "-f mpeg1video"
181
182 # mpeg1 decoding
183 do_video_decoding
184 fi
185
186 ###################################
187 if [ -n "$do_mpeg2" ] ; then
188 # mpeg2 encoding
189 file=${outfile}mpeg2.mpg
190 do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
191
192 # mpeg2 decoding
193 do_video_decoding
194
195 # mpeg2 encoding using intra vlc
196 file=${outfile}mpeg2ivlc.mpg
197 do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags2 +ivlc"
198
199 # mpeg2 decoding
200 do_video_decoding
201
202 # mpeg2 encoding
203 file=${outfile}mpeg2.mpg
204 do_video_encoding "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
205
206 # mpeg2 decoding
207 do_ffmpeg $raw_dst -y -idct int -i $file -f rawvideo $raw_dst
208
209 # mpeg2 encoding interlaced
210 file=${outfile}mpeg2i.mpg
211 do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
212
213 # mpeg2 decoding
214 do_video_decoding
215 fi
216
217 ###################################
218 if [ -n "$do_mpeg2thread" ] ; then
219 # mpeg2 encoding interlaced
220 file=${outfile}mpeg2thread.mpg
221 do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
222
223 # mpeg2 decoding
224 do_video_decoding
225
226 # mpeg2 encoding interlaced using intra vlc
227 file=${outfile}mpeg2threadivlc.mpg
228 do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
229
230 # mpeg2 decoding
231 do_video_decoding
232
233 # mpeg2 encoding interlaced
234 file=${outfile}mpeg2reuse.mpg
235 do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
236
237 # mpeg2 decoding
238 do_video_decoding
239 fi
240
241 ###################################
242 if [ -n "$do_msmpeg4v2" ] ; then
243 # msmpeg4 encoding
244 file=${outfile}msmpeg4v2.avi
245 do_video_encoding "-qscale 10" "-an -vcodec msmpeg4v2"
246
247 # msmpeg4v2 decoding
248 do_video_decoding
249 fi
250
251 ###################################
252 if [ -n "$do_msmpeg4" ] ; then
253 # msmpeg4 encoding
254 file=${outfile}msmpeg4.avi
255 do_video_encoding "-qscale 10" "-an -vcodec msmpeg4"
256
257 # msmpeg4 decoding
258 do_video_decoding
259 fi
260
261 ###################################
262 if [ -n "$do_wmv1" ] ; then
263 # wmv1 encoding
264 file=${outfile}wmv1.avi
265 do_video_encoding "-qscale 10" "-an -vcodec wmv1"
266
267 # wmv1 decoding
268 do_video_decoding
269 fi
270
271 ###################################
272 if [ -n "$do_wmv2" ] ; then
273 # wmv2 encoding
274 file=${outfile}wmv2.avi
275 do_video_encoding "-qscale 10" "-an -vcodec wmv2"
276
277 # wmv2 decoding
278 do_video_decoding
279 fi
280
281 ###################################
282 if [ -n "$do_h261" ] ; then
283 # h261 encoding
284 file=${outfile}h261.avi
285 do_video_encoding "-qscale 11" "-s 352x288 -an -vcodec h261"
286
287 # h261 decoding
288 do_video_decoding
289 fi
290
291 ###################################
292 if [ -n "$do_h263" ] ; then
293 # h263 encoding
294 file=${outfile}h263.avi
295 do_video_encoding "-qscale 10" "-s 352x288 -an -vcodec h263"
296
297 # h263 decoding
298 do_video_decoding
299 fi
300
301 ###################################
302 if [ -n "$do_h263p" ] ; then
303 # h263p encoding
304 file=${outfile}h263p.avi
305 do_video_encoding "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
306
307 # h263p decoding
308 do_video_decoding
309 fi
310
311 ###################################
312 if [ -n "$do_mpeg4" ] ; then
313 # mpeg4
314 file=${outfile}odivx.mp4
315 do_video_encoding "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
316
317 # mpeg4 decoding
318 do_video_decoding
319 fi
320
321 ###################################
322 if [ -n "$do_huffyuv" ] ; then
323 # huffyuv
324 file=${outfile}huffyuv.avi
325 do_video_encoding "" "-an -vcodec huffyuv -pix_fmt yuv422p"
326
327 # huffyuv decoding
328 do_video_decoding -strict -2 -pix_fmt yuv420p
329 fi
330
331 ###################################
332 if [ -n "$do_rc" ] ; then
333 # mpeg4 rate control
334 file=${outfile}mpeg4-rc.avi
335 do_video_encoding "-b 400k -bf 2" "-an -vcodec mpeg4"
336
337 # mpeg4 rate control decoding
338 do_video_decoding
339 fi
340
341 ###################################
342 if [ -n "$do_mpeg4adv" ] ; then
343 # mpeg4
344 file=${outfile}mpeg4-adv.avi
345 do_video_encoding "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" "-an -vcodec mpeg4"
346
347 # mpeg4 decoding
348 do_video_decoding
349 fi
350
351 ###################################
352 if [ -n "$do_mpeg4thread" ] ; then
353 # mpeg4
354 file=${outfile}mpeg4-thread.avi
355 do_video_encoding "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
356
357 # mpeg4 decoding
358 do_video_decoding
359 fi
360
361 ###################################
362 if [ -n "$do_mpeg4adv" ] ; then
363 # mpeg4
364 file=${outfile}mpeg4-Q.avi
365 do_video_encoding "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
366
367 # mpeg4 decoding
368 do_video_decoding
369 fi
370
371 ###################################
372 if [ -n "$do_mp4psp" ] ; then
373 # mp4 PSP style
374 file=${outfile}mpeg4-PSP.mp4
375 do_ffmpeg $file -y -b 768k -s 320x240 -f psp -ar 24000 -ab 32 -i $raw_src $file
376 fi
377
378 ###################################
379 if [ -n "$do_error" ] ; then
380 # damaged mpeg4
381 file=${outfile}error-mpeg4-adv.avi
382 do_video_encoding "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
383
384 # damaged mpeg4 decoding
385 do_video_decoding
386 fi
387
388 ###################################
389 if [ -n "$do_mpeg4nr" ] ; then
390 # noise reduction
391 file=${outfile}mpeg4-nr.avi
392 do_video_encoding "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
393
394 # mpeg4 decoding
395 do_video_decoding
396 fi
397
398 ###################################
399 if [ -n "$do_mpeg1b" ] ; then
400 # mpeg1
401 file=${outfile}mpeg1b.mpg
402 do_video_encoding "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
403
404 # mpeg1 decoding
405 do_video_decoding
406 fi
407
408 ###################################
409 if [ -n "$do_mjpeg" ] ; then
410 # mjpeg
411 file=${outfile}mjpeg.avi
412 do_video_encoding "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
413
414 # mjpeg decoding
415 do_video_decoding -pix_fmt yuv420p
416 fi
417
418 ###################################
419 if [ -n "$do_ljpeg" ] ; then
420 # ljpeg
421 file=${outfile}ljpeg.avi
422 do_video_encoding "" "-an -vcodec ljpeg -strict -1"
423
424 # ljpeg decoding
425 do_video_decoding
426 fi
427
428 ###################################
429 if [ -n "$do_jpegls" ] ; then
430 # jpeg ls
431 file=${outfile}jpegls.avi
432 do_video_encoding "" "-an -vcodec jpegls -vtag MJPG"
433
434 # jpeg ls decoding
435 do_video_decoding -pix_fmt yuv420p
436 fi
437
438 ###################################
439 if [ -n "$do_rv10" ] ; then
440 # rv10 encoding
441 file=${outfile}rv10.rm
442 do_video_encoding "-qscale 10" "-an"
443
444 # rv10 decoding
445 do_video_decoding
446 fi
447
448 ###################################
449 if [ -n "$do_rv20" ] ; then
450 # rv20 encoding
451 file=${outfile}rv20.rm
452 do_video_encoding "-qscale 10" "-vcodec rv20 -an"
453
454 # rv20 decoding
455 do_video_decoding
456 fi
457
458 ###################################
459 if [ -n "$do_asv1" ] ; then
460 # asv1 encoding
461 file=${outfile}asv1.avi
462 do_video_encoding "-qscale 10" "-an -vcodec asv1"
463
464 # asv1 decoding
465 do_video_decoding
466 fi
467
468 ###################################
469 if [ -n "$do_asv2" ] ; then
470 # asv2 encoding
471 file=${outfile}asv2.avi
472 do_video_encoding "-qscale 10" "-an -vcodec asv2"
473
474 # asv2 decoding
475 do_video_decoding
476 fi
477
478 ###################################
479 if [ -n "$do_flv" ] ; then
480 # flv encoding
481 file=${outfile}flv.flv
482 do_video_encoding "-qscale 10" "-an -vcodec flv"
483
484 # flv decoding
485 do_video_decoding
486 fi
487
488 ###################################
489 if [ -n "$do_ffv1" ] ; then
490 # ffv1 encoding
491 file=${outfile}ffv1.avi
492 do_video_encoding "-strict -2" "-an -vcodec ffv1"
493
494 # ffv1 decoding
495 do_video_decoding
496 fi
497
498 ###################################
499 if [ -n "$do_snow" ] ; then
500 # snow encoding
501 file=${outfile}snow.avi
502 do_video_encoding "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
503
504 # snow decoding
505 do_video_decoding -s 352x288
506 fi
507
508 ###################################
509 if [ -n "$do_snowll" ] ; then
510 # snow encoding
511 file=${outfile}snow53.avi
512 do_video_encoding "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
513
514 # snow decoding
515 do_video_decoding
516 fi
517
518 ###################################
519 if [ -n "$do_dv" ] ; then
520 # dv encoding
521 file=${outfile}dv.dv
522 do_video_encoding "-dct int" "-s pal -an"
523
524 # dv decoding
525 do_video_decoding -s cif
526 fi
527
528 ###################################
529 if [ -n "$do_dv50" ] ; then
530 # dv50 encoding
531 file=${outfile}dv.dv
532 do_video_encoding "-dct int" "-s pal -pix_fmt yuv422p -an"
533
534 # dv50 decoding
535 do_video_decoding -s cif -pix_fmt yuv420p
536 fi
537
538
539 ###################################
540 if [ -n "$do_svq1" ] ; then
541 # svq1 encoding
542 file=${outfile}svq1.mov
543 do_video_encoding "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
544
545 # svq1 decoding
546 do_video_decoding -pix_fmt yuv420p
547 fi
548
549 ###################################
550 if [ -n "$do_mp2" ] ; then
551 # mp2 encoding
552 file=${outfile}mp2.mp2
553 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
554
555 # mp2 decoding
556 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
557 $tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
558 fi
559
560 ###################################
561 if [ -n "$do_ac3" ] ; then
562 # ac3 encoding
563 file=${outfile}ac3.rm
564 do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
565
566 # ac3 decoding
567 #do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
568 fi
569
570 ###################################
571 if [ -n "$do_g726" ] ; then
572 # g726 encoding
573 file=${outfile}g726.wav
574 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
575
576 # g726 decoding
577 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
578 fi
579
580 ###################################
581 if [ -n "$do_adpcm_ima_wav" ] ; then
582 # encoding
583 file=${outfile}adpcm_ima.wav
584 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
585
586 # decoding
587 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
588 fi
589
590 ###################################
591 if [ -n "$do_adpcm_ms" ] ; then
592 # encoding
593 file=${outfile}adpcm_ms.wav
594 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
595
596 # decoding
597 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
598 fi
599
600 ###################################
601 if [ -n "$do_adpcm_yam" ] ; then
602 # encoding
603 file=${outfile}adpcm_yam.wav
604 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
605
606 # decoding
607 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
608 fi
609
610 ###################################
611 if [ -n "$do_flac" ] ; then
612 # encoding
613 file=${outfile}flac.flac
614 do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec flac -compression_level 2 $file
615
616 # decoding
617 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
618 fi
619
620 ###################################
621 # libav testing
622 ###################################
623
624 if [ -n "$do_libav" ] ; then
625
626 # avi
627 file=${outfile}libav.avi
628 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
629 do_ffmpeg_crc $file -i $file
630
631 # asf
632 file=${outfile}libav.asf
633 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
634 do_ffmpeg_crc $file -i $file -r 25
635
636 # rm
637 file=${outfile}libav.rm
638 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
639 # broken
640 #do_ffmpeg_crc $file -i $file
641
642 # mpegps
643 file=${outfile}libav.mpg
644 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
645 do_ffmpeg_crc $file -i $file
646
647 # mpegts
648 file=${outfile}libav.ts
649 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
650 do_ffmpeg_crc $file -i $file
651
652 # swf (decode audio only)
653 file=${outfile}libav.swf
654 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
655 do_ffmpeg_crc $file -i $file
656
657 # ffm
658 file=${outfile}libav.ffm
659 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
660 do_ffmpeg_crc $file -i $file
661
662 # flv
663 file=${outfile}libav.flv
664 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
665 do_ffmpeg_crc $file -i $file
666
667 # mov
668 file=${outfile}libav.mov
669 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
670 do_ffmpeg_crc $file -i $file
671
672 # nut
673 file=${outfile}libav.nut
674 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
675 do_ffmpeg_crc $file -i $file
676
677 # dv
678 file=${outfile}libav.dv
679 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
680 do_ffmpeg_crc $file -i $file
681
682 # gxf
683 file=${outfile}libav.gxf
684 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 1 $file
685 do_ffmpeg_crc $file -i $file
686
687 ####################
688 # streamed images
689 # mjpeg
690 #file=${outfile}libav.mjpeg
691 #do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
692 #do_ffmpeg_crc $file -i $file
693
694 # pbmpipe
695 file=${outfile}libav.pbm
696 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
697 do_ffmpeg_crc $file -f image2pipe -i $file
698
699 # pgmpipe
700 file=${outfile}libav.pgm
701 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
702 do_ffmpeg_crc $file -f image2pipe -i $file
703
704 # ppmpipe
705 file=${outfile}libav.ppm
706 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
707 do_ffmpeg_crc $file -f image2pipe -i $file
708
709 # gif
710 file=${outfile}libav.gif
711 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
712 #do_ffmpeg_crc $file -i $file
713
714 # yuv4mpeg
715 file=${outfile}libav.y4m
716 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
717 #do_ffmpeg_crc $file -i $file
718
719 ####################
720 # image formats
721 # pgm (we do not do md5 on image files yet)
722 file=${outfile}libav%02d.pgm
723 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
724 do_ffmpeg_crc $file -i $file
725
726 # ppm (we do not do md5 on image files yet)
727 file=${outfile}libav%02d.ppm
728 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
729 do_ffmpeg_crc $file -i $file
730
731 # jpeg (we do not do md5 on image files yet)
732 file=${outfile}libav%02d.jpg
733 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src -flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p -f image2 $file
734 do_ffmpeg_crc $file -f image2 -i $file
735
736 ####################
737 # audio only
738
739 # wav
740 file=${outfile}libav.wav
741 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
742 do_ffmpeg_crc $file -i $file
743
744 # alaw
745 file=${outfile}libav.al
746 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
747 do_ffmpeg_crc $file -i $file
748
749 # mulaw
750 file=${outfile}libav.ul
751 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
752 do_ffmpeg_crc $file -i $file
753
754 # au
755 file=${outfile}libav.au
756 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
757 do_ffmpeg_crc $file -i $file
758
759 # mmf
760 file=${outfile}libav.mmf
761 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
762 do_ffmpeg_crc $file -i $file
763
764 # aiff
765 file=${outfile}libav.aif
766 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
767 do_ffmpeg_crc $file -i $file
768
769 # voc
770 file=${outfile}libav.voc
771 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
772 do_ffmpeg_crc $file -i $file
773
774 ####################
775 # pix_fmt conversions
776 conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
777 yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
778 monob pal8"
779 for pix_fmt in $conversions ; do
780 file=${outfile}libav-${pix_fmt}.yuv
781 do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
782 -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
783 do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
784 -f rawvideo -s 352x288 -pix_fmt yuv444p $file
785 done
786
787 fi
788
789
790
791 if $diff_cmd "$logfile" "$reffile" ; then
792 echo
793 echo Regression test succeeded.
794 exit 0
795 else
796 echo
797 echo Regression test: Error.
798 exit 1
799 fi