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