VirtualBox

source: vbox/trunk/src/libs/ffmpeg-20060710/tests/regression.sh@ 7789

Last change on this file since 7789 was 5776, checked in by vboxsync, 17 years ago

ffmpeg: exported to OSE

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette