Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ 9a5771e9

History | View | Annotate | Download (16.7 KB)

1
#!/bin/sh
2
#
3
# automatic regression test for ffmpeg
4
#
5
#
6
#set -x
7

    
8
set -e
9

    
10
target_exec=$5
11
target_path=$6
12

    
13
datadir="./tests/data"
14
target_datadir="${target_path}/${datadir}"
15

    
16
test="${1#regtest-}"
17
this="$test.$2"
18
logfile="$datadir/$this.regression"
19
outfile="$datadir/$4-"
20

    
21
eval do_$test=y
22

    
23
# various files
24
ffmpeg="$target_exec ${target_path}/ffmpeg_g"
25
tiny_psnr="tests/tiny_psnr"
26
benchfile="$datadir/$this.bench"
27
bench="$datadir/$this.bench.tmp"
28
bench2="$datadir/$this.bench2.tmp"
29
raw_src="${target_path}/$3/%02d.pgm"
30
raw_dst="$datadir/$this.out.yuv"
31
raw_ref="$datadir/$2.ref.yuv"
32
pcm_src="${target_path}/tests/asynth1.sw"
33
pcm_dst="$datadir/$this.out.wav"
34
pcm_ref="$datadir/$2.ref.wav"
35
crcfile="$datadir/$this.crc"
36
target_crcfile="$target_datadir/$this.crc"
37

    
38
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
39
    do_md5sum() { md5sum -b $1; }
40
elif [ -x /sbin/md5 ]; then
41
    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
42
else
43
    do_md5sum() { echo No md5sum program found; }
44
fi
45

    
46
# create the data directory if it does not exist
47
mkdir -p $datadir
48

    
49
FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
50

    
51
do_ffmpeg()
52
{
53
    f="$1"
54
    shift
55
    set -- $* ${target_path}/$f
56
    echo $ffmpeg $FFMPEG_OPTS $*
57
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
58
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
59
    rm -f /tmp/ffmpeg$$
60
    do_md5sum $f >> $logfile
61
    if [ $f = $raw_dst ] ; then
62
        $tiny_psnr $f $raw_ref >> $logfile
63
    elif [ $f = $pcm_dst ] ; then
64
        $tiny_psnr $f $pcm_ref 2 >> $logfile
65
    else
66
        wc -c $f >> $logfile
67
    fi
68
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
69
    echo `cat $bench2` $f >> $benchfile
70
}
71

    
72
do_ffmpeg_nomd5()
73
{
74
    f="$1"
75
    shift
76
    set -- $* ${target_path}/$f
77
    echo $ffmpeg $FFMPEG_OPTS $*
78
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
79
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
80
    rm -f /tmp/ffmpeg$$
81
    if [ $f = $raw_dst ] ; then
82
        $tiny_psnr $f $raw_ref >> $logfile
83
    elif [ $f = $pcm_dst ] ; then
84
        $tiny_psnr $f $pcm_ref 2 >> $logfile
85
    else
86
        wc -c $f >> $logfile
87
    fi
88
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
89
    echo `cat $bench2` $f >> $benchfile
90
}
91

    
92
do_ffmpeg_crc()
93
{
94
    f="$1"
95
    shift
96
    echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
97
    $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" > /tmp/ffmpeg$$ 2>&1
98
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
99
    rm -f /tmp/ffmpeg$$
100
    echo "$f `cat $crcfile`" >> $logfile
101
    rm -f "$crcfile"
102
}
103

    
104
do_ffmpeg_nocheck()
105
{
106
    f="$1"
107
    shift
108
    echo $ffmpeg $FFMPEG_OPTS $*
109
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
110
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
111
    rm -f /tmp/ffmpeg$$
112
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
113
    echo `cat $bench2` $f >> $benchfile
114
}
115

    
116
do_video_decoding()
117
{
118
    do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
119
    rm -f $raw_dst
120
}
121

    
122
do_video_encoding()
123
{
124
    file=${outfile}$1
125
    do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3
126
}
127

    
128
do_audio_encoding()
129
{
130
    file=${outfile}$1
131
    do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3
132
}
133

    
134
do_audio_decoding()
135
{
136
    do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
137
}
138

    
139
do_libav()
140
{
141
    file=${outfile}libav.$1
142
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
143
    do_ffmpeg_crc $file -i $target_path/$file $3
144
}
145

    
146
do_streamed_images()
147
{
148
    file=${outfile}${1}pipe.$1
149
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
150
    do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
151
}
152

    
153
do_image_formats()
154
{
155
    file=${outfile}libav%02d.$1
156
    $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
157
    do_md5sum ${outfile}libav02.$1 >> $logfile
158
    do_ffmpeg_crc $file $3 -i $target_path/$file
159
    wc -c ${outfile}libav02.$1 >> $logfile
160
}
161

    
162
do_audio_only()
163
{
164
    file=${outfile}libav.$1
165
    do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
166
    do_ffmpeg_crc $file -i $target_path/$file
167
}
168

    
169
rm -f "$logfile"
170
rm -f "$benchfile"
171

    
172
# generate reference for quality check
173
if [ -n "$do_ref" ]; then
174
do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
175
do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
176
fi
177

    
178
if [ -n "$do_mpeg" ] ; then
179
# mpeg1
180
do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
181
do_video_decoding
182
fi
183

    
184
if [ -n "$do_mpeg2" ] ; then
185
# mpeg2
186
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
187
do_video_decoding
188

    
189
# mpeg2 encoding intra vlc qprd
190
do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -trellis 1 -flags +qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" "-vcodec mpeg2video -f mpeg2video"
191
do_video_decoding
192

    
193
#mpeg2 4:2:2 encoding
194
do_video_encoding mpeg2_422.mpg "-vb 1000k -bf 2 -trellis 1 -flags +qprd+mv0+ildct+ilme -flags2 +ivlc -mbd rd" "-vcodec mpeg2video -pix_fmt yuv422p -f mpeg2video"
195
do_video_decoding
196

    
197
# mpeg2
198
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
199
do_video_decoding "-idct int"
200

    
201
# mpeg2 encoding interlaced
202
do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
203
do_video_decoding
204
fi
205

    
206
if [ -n "$do_mpeg2thread" ] ; then
207
# mpeg2 encoding interlaced
208
do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
209
do_video_decoding
210

    
211
# mpeg2 encoding interlaced using intra vlc
212
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
213
do_video_decoding
214

    
215
# mpeg2 encoding interlaced
216
file=${outfile}mpeg2reuse.mpg
217
do_ffmpeg $file -sameq -me_threshold 256 -mb_threshold 1024 -i ${target_path}/${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4
218
do_video_decoding
219
fi
220

    
221
if [ -n "$do_msmpeg4v2" ] ; then
222
do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
223
do_video_decoding
224
fi
225

    
226
if [ -n "$do_msmpeg4" ] ; then
227
do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
228
do_video_decoding
229
fi
230

    
231
if [ -n "$do_wmv1" ] ; then
232
do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
233
do_video_decoding
234
fi
235

    
236
if [ -n "$do_wmv2" ] ; then
237
do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
238
do_video_decoding
239
fi
240

    
241
if [ -n "$do_h261" ] ; then
242
do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
243
do_video_decoding
244
fi
245

    
246
if [ -n "$do_h263" ] ; then
247
do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
248
do_video_decoding
249
fi
250

    
251
if [ -n "$do_h263p" ] ; then
252
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
253
do_video_decoding
254
fi
255

    
256
if [ -n "$do_mpeg4" ] ; then
257
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
258
do_video_decoding
259
fi
260

    
261
if [ -n "$do_huffyuv" ] ; then
262
do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
263
do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
264
fi
265

    
266
if [ -n "$do_rc" ] ; then
267
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
268
do_video_decoding
269
fi
270

    
271
if [ -n "$do_mpeg4adv" ] ; then
272
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4"
273
do_video_decoding
274

    
275
do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -trellis 1 -flags +mv4+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" "-an -vcodec mpeg4"
276
do_video_decoding
277

    
278
do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+mv0 -trellis 1 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" "-an -vcodec mpeg4"
279
do_video_decoding
280

    
281
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
282
do_video_decoding
283
fi
284

    
285
if [ -n "$do_mpeg4thread" ] ; then
286
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
287
do_video_decoding
288
fi
289

    
290
if [ -n "$do_error" ] ; then
291
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
292
do_video_decoding
293
fi
294

    
295
if [ -n "$do_mpeg4nr" ] ; then
296
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
297
do_video_decoding
298
fi
299

    
300
if [ -n "$do_mpeg1b" ] ; then
301
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
302
do_video_decoding
303
fi
304

    
305
if [ -n "$do_mjpeg" ] ; then
306
do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
307
do_video_decoding "" "-pix_fmt yuv420p"
308
fi
309

    
310
if [ -n "$do_ljpeg" ] ; then
311
do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
312
do_video_decoding
313
fi
314

    
315
if [ -n "$do_jpegls" ] ; then
316
do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
317
do_video_decoding "" "-pix_fmt yuv420p  -sws_flags area+bitexact"
318
fi
319

    
320
if [ -n "$do_rv10" ] ; then
321
do_video_encoding rv10.rm "-qscale 10" "-an"
322
do_video_decoding
323
fi
324

    
325
if [ -n "$do_rv20" ] ; then
326
do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
327
do_video_decoding
328
fi
329

    
330
if [ -n "$do_asv1" ] ; then
331
do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
332
do_video_decoding
333
fi
334

    
335
if [ -n "$do_asv2" ] ; then
336
do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
337
do_video_decoding
338
fi
339

    
340
if [ -n "$do_flv" ] ; then
341
do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
342
do_video_decoding
343
fi
344

    
345
if [ -n "$do_ffv1" ] ; then
346
do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
347
do_video_decoding
348
fi
349

    
350
if [ -n "$do_snow" ] ; then
351
do_video_encoding snow.avi "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me_method iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
352
do_video_decoding "" "-s 352x288"
353
fi
354

    
355
if [ -n "$do_snowll" ] ; then
356
do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
357
do_video_decoding
358
fi
359

    
360
if [ -n "$do_dv" ] ; then
361
do_video_encoding dv.dv "-dct int" "-s pal -an"
362
do_video_decoding "" "-s cif"
363

    
364
do_video_encoding dv411.dv "-dct int" "-s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
365
do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
366
fi
367

    
368
if [ -n "$do_dv50" ] ; then
369
do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
370
do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
371
fi
372

    
373
if [ -n "$do_svq1" ] ; then
374
do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
375
do_video_decoding "" "-pix_fmt yuv420p"
376
fi
377

    
378
if [ -n "$do_flashsv" ] ; then
379
do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
380
do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
381
fi
382

    
383
if [ -n "$do_mp2" ] ; then
384
do_audio_encoding mp2.mp2 "-ar 44100"
385
do_audio_decoding
386
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
387
fi
388

    
389
if [ -n "$do_ac3" ] ; then
390
do_audio_encoding ac3.rm "" -vn
391
# gcc 2.95.3 compiled binaries decode ac3 differently because of missing SSE support
392
#do_audio_decoding
393
#$tiny_psnr $pcm_dst $pcm_ref 2 1024 >> $logfile
394
fi
395

    
396
if [ -n "$do_g726" ] ; then
397
do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
398
do_audio_decoding
399
fi
400

    
401
if [ -n "$do_adpcm_ima_wav" ] ; then
402
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
403
do_audio_decoding
404
fi
405

    
406
if [ -n "$do_adpcm_ima_qt" ] ; then
407
do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
408
do_audio_decoding
409
fi
410

    
411
if [ -n "$do_adpcm_ms" ] ; then
412
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
413
do_audio_decoding
414
fi
415

    
416
if [ -n "$do_adpcm_yam" ] ; then
417
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
418
do_audio_decoding
419
fi
420

    
421
if [ -n "$do_adpcm_swf" ] ; then
422
do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
423
do_audio_decoding
424
fi
425

    
426
if [ -n "$do_flac" ] ; then
427
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
428
do_audio_decoding
429
fi
430

    
431
if [ -n "$do_wma" ] ; then
432
# wmav1
433
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
434
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
435
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
436
# wmav2
437
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
438
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
439
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
440
fi
441

    
442
#if [ -n "$do_vorbis" ] ; then
443
# vorbis
444
#disabled because it is broken
445
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
446
#do_audio_decoding
447
#fi
448

    
449
do_audio_enc_dec() {
450
    do_audio_encoding $3.$1 "" "$4 -sample_fmt $2 -acodec $3"
451
    do_audio_decoding
452
}
453

    
454
if [ -n "$do_pcm" ] ; then
455
do_audio_enc_dec wav s16 pcm_alaw
456
do_audio_enc_dec wav s16 pcm_mulaw
457
do_audio_enc_dec mov u8 pcm_s8
458
do_audio_enc_dec wav u8 pcm_u8
459
do_audio_enc_dec mov s16 pcm_s16be
460
do_audio_enc_dec wav s16 pcm_s16le
461
do_audio_enc_dec mkv s16 pcm_s16be
462
do_audio_enc_dec mkv s16 pcm_s16le
463
do_audio_enc_dec mov s32 pcm_s24be
464
do_audio_enc_dec wav s32 pcm_s24le
465
#do_audio_enc_dec ??? s32 pcm_u24be #no compatible muxer or demuxer
466
#do_audio_enc_dec ??? s32 pcm_u24le #no compatible muxer or demuxer
467
do_audio_enc_dec mov s32 pcm_s32be
468
do_audio_enc_dec wav s32 pcm_s32le
469
#do_audio_enc_dec ??? s32 pcm_u32be #no compatible muxer or demuxer
470
#do_audio_enc_dec ??? s32 pcm_u32le #no compatible muxer or demuxer
471
do_audio_enc_dec au  flt pcm_f32be
472
do_audio_enc_dec wav flt pcm_f32le
473
do_audio_enc_dec au  dbl pcm_f64be
474
do_audio_enc_dec wav dbl pcm_f64le
475
do_audio_enc_dec wav s16 pcm_zork
476
do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
477
fi
478

    
479
# libavformat testing
480

    
481
if [ -n "$do_avi" ] ; then
482
do_libav avi
483
fi
484

    
485
if [ -n "$do_asf" ] ; then
486
do_libav asf "-acodec mp2" "-r 25"
487
fi
488

    
489
if [ -n "$do_rm" ] ; then
490
file=${outfile}libav.rm
491
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
492
# broken
493
#do_ffmpeg_crc $file -i $target_path/$file
494
fi
495

    
496
if [ -n "$do_mpg" ] ; then
497
do_libav mpg
498
fi
499

    
500
if [ -n "$do_ts" ] ; then
501
do_libav ts
502
fi
503

    
504
if [ -n "$do_swf" ] ; then
505
do_libav swf -an
506
fi
507

    
508
if [ -n "$do_ffm" ] ; then
509
do_libav ffm
510
fi
511

    
512
if [ -n "$do_flv_fmt" ] ; then
513
do_libav flv -an
514
fi
515

    
516
if [ -n "$do_mov" ] ; then
517
do_libav mov "-acodec pcm_alaw"
518
fi
519

    
520
if [ -n "$do_dv_fmt" ] ; then
521
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
522
fi
523

    
524
if [ -n "$do_gxf" ] ; then
525
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
526
fi
527

    
528
if [ -n "$do_nut" ] ; then
529
do_libav nut "-acodec mp2"
530
fi
531

    
532
if [ -n "$do_mkv" ] ; then
533
do_libav mkv
534
fi
535

    
536

    
537
# streamed images
538
# mjpeg
539
#file=${outfile}libav.mjpeg
540
#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
541
#do_ffmpeg_crc $file -i $target_path/$file
542

    
543
if [ -n "$do_pbmpipe" ] ; then
544
do_streamed_images pbm
545
fi
546

    
547
if [ -n "$do_pgmpipe" ] ; then
548
do_streamed_images pgm
549
fi
550

    
551
if [ -n "$do_ppmpipe" ] ; then
552
do_streamed_images ppm
553
fi
554

    
555
if [ -n "$do_gif" ] ; then
556
file=${outfile}libav.gif
557
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
558
#do_ffmpeg_crc $file -i $target_path/$file
559
fi
560

    
561
if [ -n "$do_yuv4mpeg" ] ; then
562
file=${outfile}libav.y4m
563
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
564
#do_ffmpeg_crc $file -i $target_path/$file
565
fi
566

    
567
# image formats
568

    
569
if [ -n "$do_pgm" ] ; then
570
do_image_formats pgm
571
fi
572

    
573
if [ -n "$do_ppm" ] ; then
574
do_image_formats ppm
575
fi
576

    
577
if [ -n "$do_bmp" ] ; then
578
do_image_formats bmp
579
fi
580

    
581
if [ -n "$do_tga" ] ; then
582
do_image_formats tga
583
fi
584

    
585
if [ -n "$do_tiff" ] ; then
586
do_image_formats tiff "-pix_fmt rgb24"
587
fi
588

    
589
if [ -n "$do_sgi" ] ; then
590
do_image_formats sgi
591
fi
592

    
593
if [ -n "$do_jpg" ] ; then
594
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
595
fi
596

    
597
# audio only
598

    
599
if [ -n "$do_wav" ] ; then
600
do_audio_only wav
601
fi
602

    
603
if [ -n "$do_alaw" ] ; then
604
do_audio_only al
605
fi
606

    
607
if [ -n "$do_mulaw" ] ; then
608
do_audio_only ul
609
fi
610

    
611
if [ -n "$do_au" ] ; then
612
do_audio_only au
613
fi
614

    
615
if [ -n "$do_mmf" ] ; then
616
do_audio_only mmf
617
fi
618

    
619
if [ -n "$do_aiff" ] ; then
620
do_audio_only aif
621
fi
622

    
623
if [ -n "$do_voc" ] ; then
624
do_audio_only voc
625
fi
626

    
627
if [ -n "$do_ogg" ] ; then
628
do_audio_only ogg
629
fi
630

    
631
# pix_fmt conversions
632

    
633
if [ -n "$do_pixfmt" ] ; then
634
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
635
             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
636
             monob yuv440p yuvj440p"
637
for pix_fmt in $conversions ; do
638
    file=${outfile}libav-${pix_fmt}.yuv
639
    do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
640
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
641
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
642
                    -f rawvideo -s 352x288 -pix_fmt yuv444p
643
done
644
fi
645

    
646
rm -f "$bench" "$bench2"