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