simplify library version handling
[libav.git] / tests / regression.sh
CommitLineData
51133a7d
FB
1#!/bin/sh
2#
3# automatic regression test for ffmpeg
4#
5#
6#set -x
d9d7653e 7
51133a7d
FB
8set -e
9
4fbd52f0 10datadir="./tests/data"
5bcfd1ad 11
4383ed5c
MR
12test="${1#regtest-}"
13this="$test.$2"
14logfile="$datadir/$this.regression"
2009721d 15outfile="$datadir/$4-"
89d5dfd5 16
4383ed5c
MR
17eval do_$test=y
18
51133a7d 19# various files
4fbd52f0
DB
20ffmpeg="./ffmpeg_g"
21tiny_psnr="tests/tiny_psnr"
4383ed5c
MR
22benchfile="$datadir/$this.bench"
23bench="$datadir/$this.bench.tmp"
24bench2="$datadir/$this.bench2.tmp"
528bbdde 25raw_src="$3/%02d.pgm"
4383ed5c
MR
26raw_dst="$datadir/$this.out.yuv"
27raw_ref="$datadir/$2.ref.yuv"
4fbd52f0 28pcm_src="tests/asynth1.sw"
4383ed5c
MR
29pcm_dst="$datadir/$this.out.wav"
30pcm_ref="$datadir/$2.ref.wav"
2009721d
MR
31crcfile="$datadir/$this.crc"
32
853d659d
JD
33if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
34 do_md5sum() { md5sum -b $1; }
35elif [ -x /sbin/md5 ]; then
36 do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
37else
38 do_md5sum() { echo No md5sum program found; }
39fi
5bcfd1ad 40
d9c211ee 41# create the data directory if it does not exist
5bcfd1ad 42mkdir -p $datadir
51133a7d 43
f6ac2667 44FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple"
bcea9605 45
3f027ca7 46do_ffmpeg()
51133a7d 47{
9e32e071 48 f="$1"
51133a7d 49 shift
bcea9605 50 echo $ffmpeg $FFMPEG_OPTS $*
8deb894f 51 $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
37a00782 52 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
e31c1c30 53 rm -f /tmp/ffmpeg$$
9e32e071
DB
54 do_md5sum $f >> $logfile
55 if [ $f = $raw_dst ] ; then
56 $tiny_psnr $f $raw_ref >> $logfile
57 elif [ $f = $pcm_dst ] ; then
58 $tiny_psnr $f $pcm_ref 2 >> $logfile
039e7889 59 else
9e32e071 60 wc -c $f >> $logfile
67cbe681 61 fi
8deb894f 62 expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
9e32e071 63 echo `cat $bench2` $f >> $benchfile
51133a7d
FB
64}
65
d9076fe7
MN
66do_ffmpeg_nomd5()
67{
68 f="$1"
69 shift
70 echo $ffmpeg $FFMPEG_OPTS $*
71 $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
72 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
73 rm -f /tmp/ffmpeg$$
74 if [ $f = $raw_dst ] ; then
75 $tiny_psnr $f $raw_ref >> $logfile
76 elif [ $f = $pcm_dst ] ; then
77 $tiny_psnr $f $pcm_ref 2 >> $logfile
78 else
79 wc -c $f >> $logfile
80 fi
81 expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
82 echo `cat $bench2` $f >> $benchfile
83}
84
3f027ca7 85do_ffmpeg_crc()
89d5dfd5 86{
9e32e071 87 f="$1"
89d5dfd5 88 shift
2009721d
MR
89 echo $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile"
90 $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile" > /tmp/ffmpeg$$ 2>&1
37a00782 91 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:|ffmpeg version| configuration| built)" /tmp/ffmpeg$$ || true
115329f1 92 rm -f /tmp/ffmpeg$$
2009721d
MR
93 echo "$f `cat $crcfile`" >> $logfile
94 rm -f "$crcfile"
89d5dfd5 95}
51133a7d 96
67cbe681
MN
97do_ffmpeg_nocheck()
98{
9e32e071 99 f="$1"
67cbe681 100 shift
bcea9605 101 echo $ffmpeg $FFMPEG_OPTS $*
8deb894f 102 $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
37a00782 103 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
affd55a1 104 rm -f /tmp/ffmpeg$$
8deb894f 105 expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
9e32e071 106 echo `cat $bench2` $f >> $benchfile
67cbe681
MN
107}
108
1de61a18
DB
109do_video_decoding()
110{
5e5ac8e0 111 do_ffmpeg $raw_dst -y $1 -i $file -f rawvideo $2 $raw_dst
4383ed5c 112 rm -f $raw_dst
1de61a18
DB
113}
114
115do_video_encoding()
116{
1e1b182d 117 file=${outfile}$1
a2377bb0 118 do_ffmpeg $file -y $2 -f $3 -i $raw_src $4 $file
1de61a18
DB
119}
120
fb132953
DB
121do_audio_encoding()
122{
123 file=${outfile}$1
066a81a8 124 do_ffmpeg $file -y -ab 128k -ac 2 -f s16le -i $pcm_src $3 $file
fb132953
DB
125}
126
127do_audio_decoding()
128{
129 do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
130}
131
36aed9e5
DB
132do_libav()
133{
134 file=${outfile}libav.$1
135 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
136 do_ffmpeg_crc $file -i $file $3
137
138}
139
d449d1bc
DB
140do_streamed_images()
141{
2009721d 142 file=${outfile}${1}pipe.$1
d449d1bc
DB
143 do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
144 do_ffmpeg_crc $file -f image2pipe -i $file
145}
146
f8aa7645
DB
147do_image_formats()
148{
149 file=${outfile}libav%02d.$1
c28baf06 150 $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $2 $3 -flags +bitexact $file
f8aa7645 151 do_ffmpeg_crc $file $3 -i $file
199c6e3c 152 do_md5sum ${outfile}libav02.$1 >> $logfile
f8aa7645
DB
153}
154
e587a0a5
DB
155do_audio_only()
156{
157 file=${outfile}libav.$1
158 do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
159 do_ffmpeg_crc $file -i $file
160}
161
4383ed5c
MR
162rm -f "$logfile"
163rm -f "$benchfile"
51133a7d 164
67cbe681 165# generate reference for quality check
4383ed5c 166if [ -n "$do_ref" ]; then
67cbe681 167do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
066a81a8 168do_ffmpeg_nocheck $pcm_ref -y -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
4383ed5c 169fi
67cbe681 170
51133a7d 171if [ -n "$do_mpeg" ] ; then
0fc3a831 172# mpeg1
a2377bb0 173do_video_encoding mpeg1.mpg "-qscale 10" pgmyuv "-f mpeg1video"
1de61a18 174do_video_decoding
922bc38d
MN
175fi
176
922bc38d 177if [ -n "$do_mpeg2" ] ; then
0fc3a831 178# mpeg2
a2377bb0 179do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video"
1de61a18 180do_video_decoding
83dddc4a 181
49f1ac5a 182# mpeg2 encoding intra vlc qprd
066a81a8 183do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -flags +trell+qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-vcodec mpeg2video -f mpeg2video"
307eb248
BC
184
185# mpeg2 decoding
1de61a18 186do_video_decoding
307eb248 187
0fc3a831 188# mpeg2
a2377bb0 189do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
5e5ac8e0 190do_video_decoding "-idct int"
6486ad57 191
83dddc4a 192# mpeg2 encoding interlaced
a2377bb0 193do_video_encoding mpeg2i.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
51133a7d
FB
194
195# mpeg2 decoding
1de61a18 196do_video_decoding
51133a7d
FB
197fi
198
9c3d33d6
MN
199if [ -n "$do_mpeg2thread" ] ; then
200# mpeg2 encoding interlaced
a2377bb0 201do_video_encoding mpeg2thread.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
307eb248
BC
202
203# mpeg2 decoding
1de61a18 204do_video_decoding
307eb248
BC
205
206# mpeg2 encoding interlaced using intra vlc
a2377bb0 207do_video_encoding mpeg2threadivlc.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
9c3d33d6
MN
208
209# mpeg2 decoding
1de61a18 210do_video_decoding
7f8038ce
MN
211
212# mpeg2 encoding interlaced
213file=${outfile}mpeg2reuse.mpg
115329f1 214do_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
7f8038ce
MN
215
216# mpeg2 decoding
1de61a18 217do_video_decoding
9c3d33d6
MN
218fi
219
6ebd933b 220if [ -n "$do_msmpeg4v2" ] ; then
a2377bb0 221do_video_encoding msmpeg4v2.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4v2"
1de61a18 222do_video_decoding
6ebd933b
MN
223fi
224
51133a7d 225if [ -n "$do_msmpeg4" ] ; then
a2377bb0 226do_video_encoding msmpeg4.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4"
1de61a18 227do_video_decoding
51133a7d
FB
228fi
229
6ebd933b 230if [ -n "$do_wmv1" ] ; then
a2377bb0 231do_video_encoding wmv1.avi "-qscale 10" pgmyuv "-an -vcodec wmv1"
1de61a18 232do_video_decoding
6ebd933b
MN
233fi
234
e23d5712 235if [ -n "$do_wmv2" ] ; then
a2377bb0 236do_video_encoding wmv2.avi "-qscale 10" pgmyuv "-an -vcodec wmv2"
1de61a18 237do_video_decoding
e23d5712
MN
238fi
239
61b262a9 240if [ -n "$do_h261" ] ; then
a2377bb0 241do_video_encoding h261.avi "-qscale 11" pgmyuv "-s 352x288 -an -vcodec h261"
1de61a18 242do_video_decoding
61b262a9
MN
243fi
244
51133a7d 245if [ -n "$do_h263" ] ; then
a2377bb0 246do_video_encoding h263.avi "-qscale 10" pgmyuv "-s 352x288 -an -vcodec h263"
1de61a18 247do_video_decoding
6e2d5f1a
MN
248fi
249
6e2d5f1a 250if [ -n "$do_h263p" ] ; then
a2377bb0 251do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" pgmyuv "-s 352x288 -an -vcodec h263p -ps 300"
1de61a18 252do_video_decoding
51133a7d
FB
253fi
254
51133a7d 255if [ -n "$do_mpeg4" ] ; then
aeeb0cac
DB
256do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" pgmyuv "-an -vcodec mpeg4"
257do_video_decoding
51133a7d
FB
258fi
259
e629ab68 260if [ -n "$do_huffyuv" ] ; then
a2377bb0 261do_video_encoding huffyuv.avi "" pgmyuv "-an -vcodec huffyuv -pix_fmt yuv422p"
5e5ac8e0 262do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
e629ab68
RD
263fi
264
1dbb6d90 265if [ -n "$do_rc" ] ; then
aeeb0cac
DB
266do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" pgmyuv "-an -vcodec mpeg4"
267do_video_decoding
1dbb6d90
MN
268fi
269
1dbb6d90 270if [ -n "$do_mpeg4adv" ] ; then
a2377bb0 271do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" pgmyuv "-an -vcodec mpeg4"
1de61a18 272do_video_decoding
2d1e5071 273
2d1e5071 274do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -flags +mv4+trell+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-an -vcodec mpeg4"
2d1e5071
MN
275do_video_decoding
276
2d1e5071 277do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+trell+mv0 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" pgmyuv "-an -vcodec mpeg4"
2d1e5071 278do_video_decoding
1dbb6d90 279
45ddd8b0 280do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" pgmyuv "-an -vcodec mpeg4"
1de61a18 281do_video_decoding
aab9cdcf
MN
282fi
283
45ddd8b0 284if [ -n "$do_mpeg4thread" ] ; then
45ddd8b0 285do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" pgmyuv "-an -vcodec mpeg4 -threads 2"
1de61a18 286do_video_decoding
9c3d33d6
MN
287fi
288
7ebfc0ea 289if [ -n "$do_error" ] ; then
a2377bb0 290do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" pgmyuv "-an -vcodec mpeg4"
1de61a18 291do_video_decoding
7ebfc0ea
MN
292fi
293
be408b67 294if [ -n "$do_mpeg4nr" ] ; then
a2377bb0 295do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" pgmyuv "-an -vcodec mpeg4"
1de61a18 296do_video_decoding
be408b67
MN
297fi
298
cfadadec 299if [ -n "$do_mpeg1b" ] ; then
a2377bb0 300do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" pgmyuv "-an -vcodec mpeg1video -f mpeg1video"
1de61a18 301do_video_decoding
cfadadec
MN
302fi
303
51133a7d 304if [ -n "$do_mjpeg" ] ; then
a2377bb0 305do_video_encoding mjpeg.avi "-qscale 10" pgmyuv "-an -vcodec mjpeg -pix_fmt yuvj420p"
5e5ac8e0 306do_video_decoding "" "-pix_fmt yuv420p"
51133a7d
FB
307fi
308
3b37408b 309if [ -n "$do_ljpeg" ] ; then
a2377bb0 310do_video_encoding ljpeg.avi "" pgmyuv "-an -vcodec ljpeg -strict -1"
1de61a18 311do_video_decoding
3b37408b
MN
312fi
313
b4e021e8 314if [ -n "$do_jpegls" ] ; then
a2377bb0 315do_video_encoding jpegls.avi "" pgmyuv "-an -vcodec jpegls -vtag MJPG"
5e5ac8e0 316do_video_decoding "" "-pix_fmt yuv420p"
b4e021e8
MN
317fi
318
51133a7d 319if [ -n "$do_rv10" ] ; then
a2377bb0 320do_video_encoding rv10.rm "-qscale 10" pgmyuv "-an"
1de61a18 321do_video_decoding
51133a7d
FB
322fi
323
c50cd09d 324if [ -n "$do_rv20" ] ; then
a2377bb0 325do_video_encoding rv20.rm "-qscale 10" pgmyuv "-vcodec rv20 -an"
1de61a18 326do_video_decoding
c50cd09d
MN
327fi
328
9ca9fce1 329if [ -n "$do_asv1" ] ; then
a2377bb0 330do_video_encoding asv1.avi "-qscale 10" pgmyuv "-an -vcodec asv1"
1de61a18 331do_video_decoding
9ca9fce1
MN
332fi
333
8d876a43 334if [ -n "$do_asv2" ] ; then
a2377bb0 335do_video_encoding asv2.avi "-qscale 10" pgmyuv "-an -vcodec asv2"
1de61a18 336do_video_decoding
8d876a43
MN
337fi
338
bbdd42d3 339if [ -n "$do_flv" ] ; then
a2377bb0 340do_video_encoding flv.flv "-qscale 10" pgmyuv "-an -vcodec flv"
1de61a18 341do_video_decoding
bbdd42d3
MN
342fi
343
f3203047 344if [ -n "$do_ffv1" ] ; then
a2377bb0 345do_video_encoding ffv1.avi "-strict -2" pgmyuv "-an -vcodec ffv1"
1de61a18 346do_video_decoding
d13eef3d
MN
347fi
348
d13eef3d 349if [ -n "$do_snow" ] ; then
a2377bb0 350do_video_encoding snow.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
5e5ac8e0 351do_video_decoding "" "-s 352x288"
e03c822a 352fi
d13eef3d 353
e03c822a 354if [ -n "$do_snowll" ] ; then
a2377bb0 355do_video_encoding snow53.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
1de61a18 356do_video_decoding
f3203047
MN
357fi
358
8fce2707 359if [ -n "$do_dv" ] ; then
a2377bb0 360do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -an"
5e5ac8e0 361do_video_decoding "" "-s cif"
8fce2707
MN
362fi
363
0b297700 364if [ -n "$do_dv50" ] ; then
a8fa959a 365do_video_encoding dv50.dv "-dct int" pgmyuv "-s pal -pix_fmt yuv422p -an"
5e5ac8e0 366do_video_decoding "" "-s cif -pix_fmt yuv420p"
0b297700
DM
367fi
368
b86bd1f1 369if [ -n "$do_svq1" ] ; then
a2377bb0 370do_video_encoding svq1.mov "" pgmyuv "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
5e5ac8e0 371do_video_decoding "" "-pix_fmt yuv420p"
b86bd1f1
MN
372fi
373
d2f8f410 374if [ -n "$do_flashsv" ] ; then
d2f8f410
MN
375do_video_encoding flashsv.flv "" pgmyuv "-an -vcodec flashsv "
376do_video_decoding "" "-pix_fmt yuv420p"
377fi
378
51133a7d 379if [ -n "$do_mp2" ] ; then
fb132953 380do_audio_encoding mp2.mp2 "-ar 44100"
fb132953 381do_audio_decoding
976709ee 382$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
51133a7d
FB
383fi
384
51133a7d 385if [ -n "$do_ac3" ] ; then
fb132953 386do_audio_encoding ac3.rm "" -vn
fb132953 387#do_audio_decoding
51133a7d
FB
388fi
389
311be1fb 390if [ -n "$do_g726" ] ; then
066a81a8 391do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
fb132953 392do_audio_decoding
311be1fb
MN
393fi
394
f02ab814 395if [ -n "$do_adpcm_ima_wav" ] ; then
fb132953 396do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
fb132953 397do_audio_decoding
f02ab814
MN
398fi
399
9dc92a38
KS
400if [ -n "$do_adpcm_ima_qt" ] ; then
401do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
402do_audio_decoding
403fi
404
f02ab814 405if [ -n "$do_adpcm_ms" ] ; then
fb132953 406do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
fb132953 407do_audio_decoding
f02ab814
MN
408fi
409
d8cbeba1 410if [ -n "$do_adpcm_yam" ] ; then
fb132953 411do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
fb132953 412do_audio_decoding
d8cbeba1
MN
413fi
414
b529ab37 415if [ -n "$do_adpcm_swf" ] ; then
b529ab37
BL
416do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
417do_audio_decoding
418fi
419
aeb2904e 420if [ -n "$do_flac" ] ; then
fb132953 421do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
fb132953 422do_audio_decoding
aeb2904e
MN
423fi
424
6d3d8dae
MN
425if [ -n "$do_wma" ] ; then
426# wmav1
427do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
d9076fe7 428do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
6d3d8dae
MN
429$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
430# wmav2
431do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
d9076fe7 432do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
6d3d8dae
MN
433$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
434fi
435
0786943a 436#if [ -n "$do_vorbis" ] ; then
3160138f 437# vorbis
90b5b51e 438#disabled because it is broken
0786943a
MN
439#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
440#do_audio_decoding
441#fi
6d3d8dae 442
2a048239 443# libavformat testing
89d5dfd5 444
2009721d 445if [ -n "$do_avi" ] ; then
36aed9e5 446do_libav avi
2009721d 447fi
89d5dfd5 448
2009721d 449if [ -n "$do_asf" ] ; then
36aed9e5 450do_libav asf "-acodec mp2" "-r 25"
2009721d 451fi
89d5dfd5 452
2009721d 453if [ -n "$do_rm" ] ; then
89d5dfd5
FB
454file=${outfile}libav.rm
455do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
456# broken
457#do_ffmpeg_crc $file -i $file
2009721d 458fi
89d5dfd5 459
2009721d 460if [ -n "$do_mpg" ] ; then
36aed9e5 461do_libav mpg
2009721d 462fi
89d5dfd5 463
2009721d 464if [ -n "$do_ts" ] ; then
36aed9e5 465do_libav ts
2009721d 466fi
d05c15cb 467
2009721d 468if [ -n "$do_swf" ] ; then
662fd26c 469do_libav swf -an
2009721d 470fi
89d5dfd5 471
2009721d 472if [ -n "$do_ffm" ] ; then
36aed9e5 473do_libav ffm
2009721d 474fi
89d5dfd5 475
2009721d 476if [ -n "$do_flv_fmt" ] ; then
36aed9e5 477do_libav flv -an
2009721d 478fi
bbdd42d3 479
2009721d 480if [ -n "$do_mov" ] ; then
36aed9e5 481do_libav mov "-acodec pcm_alaw"
2009721d 482fi
c280f2d7 483
2009721d 484if [ -n "$do_dv_fmt" ] ; then
36aed9e5 485do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
2009721d 486fi
a811de6e 487
2009721d 488if [ -n "$do_gxf" ] ; then
36aed9e5 489do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
2009721d 490fi
a850fd18 491
2009721d 492if [ -n "$do_nut" ] ; then
f38e2b13 493do_libav nut "-acodec mp2"
2009721d 494fi
f38e2b13 495
2009721d 496if [ -n "$do_mkv" ] ; then
46491f13 497do_libav mkv
2009721d 498fi
46491f13 499
f38e2b13 500
89d5dfd5
FB
501# streamed images
502# mjpeg
affd55a1
RS
503#file=${outfile}libav.mjpeg
504#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
505#do_ffmpeg_crc $file -i $file
89d5dfd5 506
2009721d 507if [ -n "$do_pbmpipe" ] ; then
d449d1bc 508do_streamed_images pbm
2009721d 509fi
7481e919 510
2009721d 511if [ -n "$do_pgmpipe" ] ; then
d449d1bc 512do_streamed_images pgm
2009721d 513fi
89d5dfd5 514
2009721d 515if [ -n "$do_ppmpipe" ] ; then
d449d1bc 516do_streamed_images ppm
2009721d 517fi
89d5dfd5 518
2009721d 519if [ -n "$do_gif" ] ; then
89d5dfd5 520file=${outfile}libav.gif
20dd25ad 521do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
7481e919 522#do_ffmpeg_crc $file -i $file
2009721d 523fi
7481e919 524
2009721d 525if [ -n "$do_yuv4mpeg" ] ; then
8cf71ead 526file=${outfile}libav.y4m
7481e919
FB
527do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
528#do_ffmpeg_crc $file -i $file
2009721d 529fi
89d5dfd5 530
89d5dfd5 531# image formats
2009721d
MR
532
533if [ -n "$do_pgm" ] ; then
f8aa7645 534do_image_formats pgm
2009721d 535fi
89d5dfd5 536
2009721d 537if [ -n "$do_ppm" ] ; then
f8aa7645 538do_image_formats ppm
2009721d 539fi
89d5dfd5 540
2009721d 541if [ -n "$do_bmp" ] ; then
1e358f03 542do_image_formats bmp
2009721d 543fi
1e358f03 544
2009721d 545if [ -n "$do_tga" ] ; then
1e358f03 546do_image_formats tga
2009721d 547fi
1e358f03 548
2009721d 549if [ -n "$do_tiff" ] ; then
f4d47d6b 550do_image_formats tiff "-pix_fmt rgb24"
2009721d 551fi
90b4e393 552
2009721d 553if [ -n "$do_sgi" ] ; then
90b4e393 554do_image_formats sgi
2009721d 555fi
90b4e393 556
2009721d 557if [ -n "$do_jpg" ] ; then
f8aa7645 558do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
2009721d 559fi
d0c30ca5 560
89d5dfd5
FB
561# audio only
562
2009721d 563if [ -n "$do_wav" ] ; then
e587a0a5 564do_audio_only wav
2009721d 565fi
89d5dfd5 566
2009721d 567if [ -n "$do_alaw" ] ; then
e587a0a5 568do_audio_only al
2009721d 569fi
89d5dfd5 570
2009721d 571if [ -n "$do_mulaw" ] ; then
e587a0a5 572do_audio_only ul
2009721d 573fi
89d5dfd5 574
2009721d 575if [ -n "$do_au" ] ; then
e587a0a5 576do_audio_only au
2009721d 577fi
89d5dfd5 578
2009721d 579if [ -n "$do_mmf" ] ; then
e587a0a5 580do_audio_only mmf
2009721d 581fi
d8cbeba1 582
2009721d 583if [ -n "$do_aiff" ] ; then
e587a0a5 584do_audio_only aif
2009721d 585fi
f11288da 586
2009721d 587if [ -n "$do_voc" ] ; then
e587a0a5 588do_audio_only voc
2009721d 589fi
ea395e8c 590
2009721d 591if [ -n "$do_ogg" ] ; then
5118cae6 592do_audio_only ogg
2009721d 593fi
5118cae6 594
affd55a1 595# pix_fmt conversions
2009721d
MR
596
597if [ -n "$do_pixfmt" ] ; then
dc8918ad
BC
598conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
599 yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
6b8bcd3e 600 monob pal8 yuv440p yuvj440p"
affd55a1
RS
601for pix_fmt in $conversions ; do
602 file=${outfile}libav-${pix_fmt}.yuv
603 do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
604 -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
605 do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
606 -f rawvideo -s 352x288 -pix_fmt yuv444p $file
607done
2009721d 608fi
51133a7d 609
4383ed5c 610rm -f "$bench" "$bench2"