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