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