Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ 2e00584e

History | View | Annotate | Download (16.2 KB)

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

    
8
set -e
9

    
10
datadir="./tests/data"
11

    
12
test="${1#regtest-}"
13
this="$test.$2"
14
logfile="$datadir/$this.regression"
15
outfile="$datadir/$4-"
16

    
17
eval do_$test=y
18

    
19
# various files
20
ffmpeg="./ffmpeg_g"
21
tiny_psnr="tests/tiny_psnr"
22
benchfile="$datadir/$this.bench"
23
bench="$datadir/$this.bench.tmp"
24
bench2="$datadir/$this.bench2.tmp"
25
raw_src="$3/%02d.pgm"
26
raw_dst="$datadir/$this.out.yuv"
27
raw_ref="$datadir/$2.ref.yuv"
28
pcm_src="tests/asynth1.sw"
29
pcm_dst="$datadir/$this.out.wav"
30
pcm_ref="$datadir/$2.ref.wav"
31
crcfile="$datadir/$this.crc"
32

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

    
41
# create the data directory if it does not exist
42
mkdir -p $datadir
43

    
44
FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
45

    
46
do_ffmpeg()
47
{
48
    f="$1"
49
    shift
50
    echo $ffmpeg $FFMPEG_OPTS $*
51
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
52
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
53
    rm -f /tmp/ffmpeg$$
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
59
    else
60
        wc -c $f >> $logfile
61
    fi
62
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
63
    echo `cat $bench2` $f >> $benchfile
64
}
65

    
66
do_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

    
85
do_ffmpeg_crc()
86
{
87
    f="$1"
88
    shift
89
    echo $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile"
90
    $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile" > /tmp/ffmpeg$$ 2>&1
91
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
92
    rm -f /tmp/ffmpeg$$
93
    echo "$f `cat $crcfile`" >> $logfile
94
    rm -f "$crcfile"
95
}
96

    
97
do_ffmpeg_nocheck()
98
{
99
    f="$1"
100
    shift
101
    echo $ffmpeg $FFMPEG_OPTS $*
102
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
103
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
104
    rm -f /tmp/ffmpeg$$
105
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
106
    echo `cat $bench2` $f >> $benchfile
107
}
108

    
109
do_video_decoding()
110
{
111
    do_ffmpeg $raw_dst $1 -i $file -f rawvideo $2 $raw_dst
112
    rm -f $raw_dst
113
}
114

    
115
do_video_encoding()
116
{
117
    file=${outfile}$1
118
    do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3 $file
119
}
120

    
121
do_audio_encoding()
122
{
123
    file=${outfile}$1
124
    do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3 $file
125
}
126

    
127
do_audio_decoding()
128
{
129
    do_ffmpeg $pcm_dst -i $file -sample_fmt s16 -f wav $pcm_dst
130
}
131

    
132
do_libav()
133
{
134
    file=${outfile}libav.$1
135
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
136
    do_ffmpeg_crc $file -i $file $3
137
}
138

    
139
do_streamed_images()
140
{
141
    file=${outfile}${1}pipe.$1
142
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe $file
143
    do_ffmpeg_crc $file -f image2pipe -i $file
144
}
145

    
146
do_image_formats()
147
{
148
    file=${outfile}libav%02d.$1
149
    $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $file
150
    do_md5sum ${outfile}libav02.$1 >> $logfile
151
    do_ffmpeg_crc $file $3 -i $file
152
    wc -c ${outfile}libav02.$1 >> $logfile
153
}
154

    
155
do_audio_only()
156
{
157
    file=${outfile}libav.$1
158
    do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src $file
159
    do_ffmpeg_crc $file -i $file
160
}
161

    
162
rm -f "$logfile"
163
rm -f "$benchfile"
164

    
165
# generate reference for quality check
166
if [ -n "$do_ref" ]; then
167
do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $raw_ref
168
do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
169
fi
170

    
171
if [ -n "$do_mpeg" ] ; then
172
# mpeg1
173
do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
174
do_video_decoding
175
fi
176

    
177
if [ -n "$do_mpeg2" ] ; then
178
# mpeg2
179
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
180
do_video_decoding
181

    
182
# mpeg2 encoding intra vlc qprd
183
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"
184
do_video_decoding
185

    
186
#mpeg2 4:2:2 encoding
187
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"
188
do_video_decoding
189

    
190
# mpeg2
191
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
192
do_video_decoding "-idct int"
193

    
194
# mpeg2 encoding interlaced
195
do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
196
do_video_decoding
197
fi
198

    
199
if [ -n "$do_mpeg2thread" ] ; then
200
# mpeg2 encoding interlaced
201
do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
202
do_video_decoding
203

    
204
# mpeg2 encoding interlaced using intra vlc
205
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
206
do_video_decoding
207

    
208
# mpeg2 encoding interlaced
209
file=${outfile}mpeg2reuse.mpg
210
do_ffmpeg $file -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
211
do_video_decoding
212
fi
213

    
214
if [ -n "$do_msmpeg4v2" ] ; then
215
do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
216
do_video_decoding
217
fi
218

    
219
if [ -n "$do_msmpeg4" ] ; then
220
do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
221
do_video_decoding
222
fi
223

    
224
if [ -n "$do_wmv1" ] ; then
225
do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
226
do_video_decoding
227
fi
228

    
229
if [ -n "$do_wmv2" ] ; then
230
do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
231
do_video_decoding
232
fi
233

    
234
if [ -n "$do_h261" ] ; then
235
do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
236
do_video_decoding
237
fi
238

    
239
if [ -n "$do_h263" ] ; then
240
do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
241
do_video_decoding
242
fi
243

    
244
if [ -n "$do_h263p" ] ; then
245
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
246
do_video_decoding
247
fi
248

    
249
if [ -n "$do_mpeg4" ] ; then
250
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
251
do_video_decoding
252
fi
253

    
254
if [ -n "$do_huffyuv" ] ; then
255
do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
256
do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
257
fi
258

    
259
if [ -n "$do_rc" ] ; then
260
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
261
do_video_decoding
262
fi
263

    
264
if [ -n "$do_mpeg4adv" ] ; then
265
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4"
266
do_video_decoding
267

    
268
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"
269
do_video_decoding
270

    
271
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"
272
do_video_decoding
273

    
274
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
275
do_video_decoding
276
fi
277

    
278
if [ -n "$do_mpeg4thread" ] ; then
279
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"
280
do_video_decoding
281
fi
282

    
283
if [ -n "$do_error" ] ; then
284
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
285
do_video_decoding
286
fi
287

    
288
if [ -n "$do_mpeg4nr" ] ; then
289
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
290
do_video_decoding
291
fi
292

    
293
if [ -n "$do_mpeg1b" ] ; then
294
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
295
do_video_decoding
296
fi
297

    
298
if [ -n "$do_mjpeg" ] ; then
299
do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
300
do_video_decoding "" "-pix_fmt yuv420p"
301
fi
302

    
303
if [ -n "$do_ljpeg" ] ; then
304
do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
305
do_video_decoding
306
fi
307

    
308
if [ -n "$do_jpegls" ] ; then
309
do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
310
do_video_decoding "" "-pix_fmt yuv420p  -sws_flags area+bitexact"
311
fi
312

    
313
if [ -n "$do_rv10" ] ; then
314
do_video_encoding rv10.rm "-qscale 10" "-an"
315
do_video_decoding
316
fi
317

    
318
if [ -n "$do_rv20" ] ; then
319
do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
320
do_video_decoding
321
fi
322

    
323
if [ -n "$do_asv1" ] ; then
324
do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
325
do_video_decoding
326
fi
327

    
328
if [ -n "$do_asv2" ] ; then
329
do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
330
do_video_decoding
331
fi
332

    
333
if [ -n "$do_flv" ] ; then
334
do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
335
do_video_decoding
336
fi
337

    
338
if [ -n "$do_ffv1" ] ; then
339
do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
340
do_video_decoding
341
fi
342

    
343
if [ -n "$do_snow" ] ; then
344
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"
345
do_video_decoding "" "-s 352x288"
346
fi
347

    
348
if [ -n "$do_snowll" ] ; then
349
do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
350
do_video_decoding
351
fi
352

    
353
if [ -n "$do_dv" ] ; then
354
do_video_encoding dv.dv "-dct int" "-s pal -an"
355
do_video_decoding "" "-s cif"
356

    
357
do_video_encoding dv411.dv "-dct int" "-s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
358
do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
359
fi
360

    
361
if [ -n "$do_dv50" ] ; then
362
do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
363
do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
364
fi
365

    
366
if [ -n "$do_svq1" ] ; then
367
do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
368
do_video_decoding "" "-pix_fmt yuv420p"
369
fi
370

    
371
if [ -n "$do_flashsv" ] ; then
372
do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
373
do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
374
fi
375

    
376
if [ -n "$do_mp2" ] ; then
377
do_audio_encoding mp2.mp2 "-ar 44100"
378
do_audio_decoding
379
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
380
fi
381

    
382
if [ -n "$do_ac3" ] ; then
383
do_audio_encoding ac3.rm "" -vn
384
do_audio_decoding
385
$tiny_psnr $pcm_dst $pcm_ref 2 1024 >> $logfile
386
fi
387

    
388
if [ -n "$do_g726" ] ; then
389
do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
390
do_audio_decoding
391
fi
392

    
393
if [ -n "$do_adpcm_ima_wav" ] ; then
394
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
395
do_audio_decoding
396
fi
397

    
398
if [ -n "$do_adpcm_ima_qt" ] ; then
399
do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
400
do_audio_decoding
401
fi
402

    
403
if [ -n "$do_adpcm_ms" ] ; then
404
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
405
do_audio_decoding
406
fi
407

    
408
if [ -n "$do_adpcm_yam" ] ; then
409
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
410
do_audio_decoding
411
fi
412

    
413
if [ -n "$do_adpcm_swf" ] ; then
414
do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
415
do_audio_decoding
416
fi
417

    
418
if [ -n "$do_flac" ] ; then
419
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
420
do_audio_decoding
421
fi
422

    
423
if [ -n "$do_wma" ] ; then
424
# wmav1
425
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
426
do_ffmpeg_nomd5 $pcm_dst -i $file -f wav $pcm_dst
427
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
428
# wmav2
429
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
430
do_ffmpeg_nomd5 $pcm_dst -i $file -f wav $pcm_dst
431
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
432
fi
433

    
434
#if [ -n "$do_vorbis" ] ; then
435
# vorbis
436
#disabled because it is broken
437
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
438
#do_audio_decoding
439
#fi
440

    
441
do_audio_enc_dec() {
442
    do_audio_encoding $3.$1 "" "$4 -sample_fmt $2 -acodec $3"
443
    do_audio_decoding
444
}
445

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

    
471
# libavformat testing
472

    
473
if [ -n "$do_avi" ] ; then
474
do_libav avi
475
fi
476

    
477
if [ -n "$do_asf" ] ; then
478
do_libav asf "-acodec mp2" "-r 25"
479
fi
480

    
481
if [ -n "$do_rm" ] ; then
482
file=${outfile}libav.rm
483
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $file
484
# broken
485
#do_ffmpeg_crc $file -i $file
486
fi
487

    
488
if [ -n "$do_mpg" ] ; then
489
do_libav mpg
490
fi
491

    
492
if [ -n "$do_ts" ] ; then
493
do_libav ts
494
fi
495

    
496
if [ -n "$do_swf" ] ; then
497
do_libav swf -an
498
fi
499

    
500
if [ -n "$do_ffm" ] ; then
501
do_libav ffm
502
fi
503

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

    
508
if [ -n "$do_mov" ] ; then
509
do_libav mov "-acodec pcm_alaw"
510
fi
511

    
512
if [ -n "$do_dv_fmt" ] ; then
513
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
514
fi
515

    
516
if [ -n "$do_gxf" ] ; then
517
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
518
fi
519

    
520
if [ -n "$do_nut" ] ; then
521
do_libav nut "-acodec mp2"
522
fi
523

    
524
if [ -n "$do_mkv" ] ; then
525
do_libav mkv
526
fi
527

    
528

    
529
# streamed images
530
# mjpeg
531
#file=${outfile}libav.mjpeg
532
#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $file
533
#do_ffmpeg_crc $file -i $file
534

    
535
if [ -n "$do_pbmpipe" ] ; then
536
do_streamed_images pbm
537
fi
538

    
539
if [ -n "$do_pgmpipe" ] ; then
540
do_streamed_images pgm
541
fi
542

    
543
if [ -n "$do_ppmpipe" ] ; then
544
do_streamed_images ppm
545
fi
546

    
547
if [ -n "$do_gif" ] ; then
548
file=${outfile}libav.gif
549
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24 $file
550
#do_ffmpeg_crc $file -i $file
551
fi
552

    
553
if [ -n "$do_yuv4mpeg" ] ; then
554
file=${outfile}libav.y4m
555
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $file
556
#do_ffmpeg_crc $file -i $file
557
fi
558

    
559
# image formats
560

    
561
if [ -n "$do_pgm" ] ; then
562
do_image_formats pgm
563
fi
564

    
565
if [ -n "$do_ppm" ] ; then
566
do_image_formats ppm
567
fi
568

    
569
if [ -n "$do_bmp" ] ; then
570
do_image_formats bmp
571
fi
572

    
573
if [ -n "$do_tga" ] ; then
574
do_image_formats tga
575
fi
576

    
577
if [ -n "$do_tiff" ] ; then
578
do_image_formats tiff "-pix_fmt rgb24"
579
fi
580

    
581
if [ -n "$do_sgi" ] ; then
582
do_image_formats sgi
583
fi
584

    
585
if [ -n "$do_jpg" ] ; then
586
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
587
fi
588

    
589
# audio only
590

    
591
if [ -n "$do_wav" ] ; then
592
do_audio_only wav
593
fi
594

    
595
if [ -n "$do_alaw" ] ; then
596
do_audio_only al
597
fi
598

    
599
if [ -n "$do_mulaw" ] ; then
600
do_audio_only ul
601
fi
602

    
603
if [ -n "$do_au" ] ; then
604
do_audio_only au
605
fi
606

    
607
if [ -n "$do_mmf" ] ; then
608
do_audio_only mmf
609
fi
610

    
611
if [ -n "$do_aiff" ] ; then
612
do_audio_only aif
613
fi
614

    
615
if [ -n "$do_voc" ] ; then
616
do_audio_only voc
617
fi
618

    
619
if [ -n "$do_ogg" ] ; then
620
do_audio_only ogg
621
fi
622

    
623
# pix_fmt conversions
624

    
625
if [ -n "$do_pixfmt" ] ; then
626
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
627
             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
628
             monob yuv440p yuvj440p"
629
for pix_fmt in $conversions ; do
630
    file=${outfile}libav-${pix_fmt}.yuv
631
    do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
632
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
633
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
634
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
635
done
636
fi
637

    
638
rm -f "$bench" "$bench2"