Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ dcfdb046

History | View | Annotate | Download (19.3 KB)

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.
8
diff -u "$0" "$0" > /dev/null 2>&1
9
if [ $? -eq 0 ]; then
10
  diff_cmd="diff -u"
11
else
12
  diff_cmd="diff"
13
fi
14

    
15
diff -w "$0" "$0" > /dev/null 2>&1
16
if [ $? -eq 0 ]; then
17
  diff_cmd="$diff_cmd -w"
18
fi
19

    
20
set -e
21

    
22
datadir="./data"
23

    
24
logfile="$datadir/ffmpeg.regression"
25
outfile="$datadir/a-"
26

    
27
# tests to do
28
if [ "$1" = "mpeg4" ] ; then
29
    do_mpeg4=y
30
elif [ "$1" = "mpeg" ] ; then
31
    do_mpeg=y
32
    do_mpeg2=y
33
elif [ "$1" = "ac3" ] ; then
34
    do_ac3=y
35
elif [ "$1" = "huffyuv" ] ; then
36
    do_huffyuv=y
37
elif [ "$1" = "mpeg2thread" ] ; then
38
    do_mpeg2thread=y
39
elif [ "$1" = "snow" ] ; then
40
    do_snow=y
41
elif [ "$1" = "snowll" ] ; then
42
    do_snowll=y
43
elif [ "$1" = "libavtest" ] ; then
44
    do_libav=y
45
    logfile="$datadir/libav.regression"
46
    outfile="$datadir/b-"
47
else
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_rv10=y
64
    do_rv20=y
65
    do_mp2=y
66
    do_ac3=y
67
    do_g726=y
68
    do_adpcm_ima_wav=y
69
    do_adpcm_ms=y
70
    do_rc=y
71
    do_mpeg4adv=y
72
    do_mpeg4thread=y
73
    do_mpeg4nr=y
74
    do_mpeg1b=y
75
    do_asv1=y
76
    do_asv2=y
77
    do_flv=y
78
    do_ffv1=y
79
    do_error=y
80
    do_svq1=y
81
    do_snow=y
82
    do_snowll=y
83
    do_adpcm_yam=y
84
    do_dv=y
85
fi
86

    
87

    
88
# various files
89
ffmpeg="../ffmpeg_g"
90
tiny_psnr="./tiny_psnr"
91
reffile="$2"
92
benchfile="$datadir/ffmpeg.bench"
93
raw_src="$3/%02d.pgm"
94
raw_dst="$datadir/out.yuv"
95
raw_ref="$datadir/ref.yuv"
96
pcm_src="asynth1.sw"
97
pcm_dst="$datadir/out.wav"
98
pcm_ref="$datadir/ref.wav"
99
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
100
    do_md5sum() { md5sum -b $1; }
101
elif [ -x /sbin/md5 ]; then
102
    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
103
else
104
    do_md5sum() { echo No md5sum program found; }
105
fi
106

    
107
# create the data directory if it does not exists
108
mkdir -p $datadir
109

    
110
do_ffmpeg()
111
{
112
    f="$1"
113
    shift
114
    echo $ffmpeg -y -flags +bitexact -dct fastint -idct simple $*
115
    $ffmpeg -y -flags +bitexact -dct fastint -idct simple -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
116
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
117
    rm -f /tmp/ffmpeg$$
118
    do_md5sum $f >> $logfile
119
    if [ $f = $raw_dst ] ; then
120
        $tiny_psnr $f $raw_ref >> $logfile
121
    elif [ $f = $pcm_dst ] ; then
122
        $tiny_psnr $f $pcm_ref 2 >> $logfile
123
    else
124
        wc -c $f >> $logfile
125
    fi
126
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
127
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
128
}
129

    
130
do_ffmpeg_crc()
131
{
132
    f="$1"
133
    shift
134
    echo $ffmpeg -y -flags +bitexact -dct fastint -idct simple $* -f crc $datadir/ffmpeg.crc
135
    $ffmpeg -y -flags +bitexact -dct fastint -idct simple $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
136
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
137
    rm -f /tmp/ffmpeg$$
138
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
139
}
140

    
141
do_ffmpeg_nocheck()
142
{
143
    f="$1"
144
    shift
145
    echo $ffmpeg -y -flags +bitexact -dct fastint -idct simple $*
146
    $ffmpeg -y -flags +bitexact -dct fastint -idct simple -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
147
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
148
    rm -f /tmp/ffmpeg$$
149
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
150
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
151
}
152

    
153
echo "ffmpeg regression test" > $logfile
154
echo "ffmpeg benchmarks" > $benchfile
155

    
156
###################################
157
# generate reference for quality check
158
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
159
do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
160

    
161
###################################
162
if [ -n "$do_mpeg" ] ; then
163
# mpeg1 encoding
164
file=${outfile}mpeg1.mpg
165
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
166

    
167
# mpeg1 decoding
168
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
169
fi
170

    
171
###################################
172
if [ -n "$do_mpeg2" ] ; then
173
# mpeg2 encoding
174
file=${outfile}mpeg2.mpg
175
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file
176

    
177
# mpeg2 decoding
178
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
179

    
180
# mpeg2 encoding
181
file=${outfile}mpeg2.mpg
182
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct int -dct int -f mpeg1video $file
183

    
184
# mpeg2 decoding
185
do_ffmpeg $raw_dst -y -idct int -i $file -f rawvideo $raw_dst
186

    
187
# mpeg2 encoding interlaced
188
file=${outfile}mpeg2i.mpg
189
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -flags +ildct+ilme $file
190

    
191
# mpeg2 decoding
192
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
193
fi
194

    
195
###################################
196
if [ -n "$do_mpeg2thread" ] ; then
197
# mpeg2 encoding interlaced
198
file=${outfile}mpeg2thread.mpg
199
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2 $file
200

    
201
# mpeg2 decoding
202
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
203

    
204
# mpeg2 encoding interlaced
205
file=${outfile}mpeg2reuse.mpg
206
do_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
207

    
208
# mpeg2 decoding
209
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
210
fi
211

    
212
###################################
213
if [ -n "$do_msmpeg4v2" ] ; then
214
# msmpeg4 encoding
215
file=${outfile}msmpeg4v2.avi
216
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
217

    
218
# msmpeg4v2 decoding
219
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
220
fi
221

    
222
###################################
223
if [ -n "$do_msmpeg4" ] ; then
224
# msmpeg4 encoding
225
file=${outfile}msmpeg4.avi
226
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
227

    
228
# msmpeg4 decoding
229
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
230
fi
231

    
232
###################################
233
if [ -n "$do_wmv1" ] ; then
234
# wmv1 encoding
235
file=${outfile}wmv1.avi
236
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
237

    
238
# wmv1 decoding
239
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
240
fi
241

    
242
###################################
243
if [ -n "$do_wmv2" ] ; then
244
# wmv2 encoding
245
file=${outfile}wmv2.avi
246
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
247

    
248
# wmv2 decoding
249
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
250
fi
251

    
252
###################################
253
if [ -n "$do_h261" ] ; then
254
# h261 encoding
255
file=${outfile}h261.avi
256
do_ffmpeg $file -y -qscale 11 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h261 $file
257

    
258
# h261 decoding
259
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
260
fi
261

    
262
###################################
263
if [ -n "$do_h263" ] ; then
264
# h263 encoding
265
file=${outfile}h263.avi
266
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
267

    
268
# h263 decoding
269
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
270
fi
271

    
272
###################################
273
if [ -n "$do_h263p" ] ; then
274
# h263p encoding
275
file=${outfile}h263p.avi
276
do_ffmpeg $file -y -qscale 2 -flags +umv+aiv+aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
277

    
278
# h263p decoding
279
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
280
fi
281

    
282
###################################
283
if [ -n "$do_mpeg4" ] ; then
284
# mpeg4
285
file=${outfile}odivx.mp4
286
do_ffmpeg $file -y -flags +mv4 -mbd bits -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
287

    
288
# mpeg4 decoding
289
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
290
fi
291

    
292
###################################
293
if [ -n "$do_huffyuv" ] ; then
294
# huffyuv
295
file=${outfile}huffyuv.avi
296
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec huffyuv -pix_fmt yuv422p $file
297

    
298
# huffyuv decoding
299
do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -2 -pix_fmt yuv420p $raw_dst
300
fi
301

    
302
###################################
303
if [ -n "$do_rc" ] ; then
304
# mpeg4 rate control
305
file=${outfile}mpeg4-rc.avi
306
do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
307

    
308
# mpeg4 rate control decoding
309
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
310
fi
311

    
312
###################################
313
if [ -n "$do_mpeg4adv" ] ; then
314
# mpeg4
315
file=${outfile}mpeg4-adv.avi
316
do_ffmpeg $file -y -qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
317

    
318
# mpeg4 decoding
319
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
320
fi
321

    
322
###################################
323
if [ -n "$do_mpeg4thread" ] ; then
324
# mpeg4
325
file=${outfile}mpeg4-thread.avi
326
do_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
327

    
328
# mpeg4 decoding
329
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
330
fi
331

    
332
###################################
333
if [ -n "$do_mpeg4adv" ] ; then
334
# mpeg4
335
file=${outfile}mpeg4-Q.avi
336
do_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
337

    
338
# mpeg4 decoding
339
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
340
fi
341

    
342
###################################
343
if [ -n "$do_mp4psp" ] ; then
344
# mp4 PSP style
345
file=${outfile}mpeg4-PSP.mp4
346
do_ffmpeg $file -y -b 768 -s 320x240 -f psp -ar 24000 -ab 32 -i $raw_src $file
347
fi
348

    
349
###################################
350
if [ -n "$do_error" ] ; then
351
# damaged mpeg4
352
file=${outfile}error-mpeg4-adv.avi
353
do_ffmpeg $file -y -qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
354

    
355
# damaged mpeg4 decoding
356
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
357
fi
358

    
359
###################################
360
if [ -n "$do_mpeg4nr" ] ; then
361
# noise reduction
362
file=${outfile}mpeg4-nr.avi
363
do_ffmpeg $file -y -qscale 8 -flags +mv4 -mbd rd -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
364

    
365
# mpeg4 decoding
366
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
367
fi
368

    
369
###################################
370
if [ -n "$do_mpeg1b" ] ; then
371
# mpeg1
372
file=${outfile}mpeg1b.mpg
373
do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
374

    
375
# mpeg1 decoding
376
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
377
fi
378

    
379
###################################
380
if [ -n "$do_mjpeg" ] ; then
381
# mjpeg
382
file=${outfile}mjpeg.avi
383
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg -pix_fmt yuvj420p $file
384

    
385
# mjpeg decoding
386
do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
387
fi
388

    
389
###################################
390
if [ -n "$do_ljpeg" ] ; then
391
# ljpeg
392
file=${outfile}ljpeg.avi
393
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg -strict -1 $file
394

    
395
# ljpeg decoding
396
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
397
fi
398

    
399
###################################
400
if [ -n "$do_rv10" ] ; then
401
# rv10 encoding
402
file=${outfile}rv10.rm
403
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
404

    
405
# rv10 decoding
406
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
407
fi
408

    
409
###################################
410
if [ -n "$do_rv20" ] ; then
411
# rv20 encoding
412
file=${outfile}rv20.rm
413
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec rv20 -an $file
414

    
415
# rv20 decoding
416
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
417
fi
418

    
419
###################################
420
if [ -n "$do_asv1" ] ; then
421
# asv1 encoding
422
file=${outfile}asv1.avi
423
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
424

    
425
# asv1 decoding
426
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
427
fi
428

    
429
###################################
430
if [ -n "$do_asv2" ] ; then
431
# asv2 encoding
432
file=${outfile}asv2.avi
433
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
434

    
435
# asv2 decoding
436
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
437
fi
438

    
439
###################################
440
if [ -n "$do_flv" ] ; then
441
# flv encoding
442
file=${outfile}flv.flv
443
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
444

    
445
# flv decoding
446
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
447
fi
448

    
449
###################################
450
if [ -n "$do_ffv1" ] ; then
451
# ffv1 encoding
452
file=${outfile}ffv1.avi
453
do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
454

    
455
# ffv1 decoding
456
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
457
fi
458

    
459
###################################
460
if [ -n "$do_snow" ] ; then
461
# snow encoding
462
file=${outfile}snow.avi
463
do_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
464

    
465
# snow decoding
466
do_ffmpeg $raw_dst -y -i $file -f rawvideo -s 352x288 $raw_dst
467
fi
468

    
469
###################################
470
if [ -n "$do_snowll" ] ; then
471
# snow encoding
472
file=${outfile}snow53.avi
473
do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec snow -pred 1 -flags +mv4+qpel $file
474

    
475
# snow decoding
476
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
477
fi
478

    
479
###################################
480
if [ -n "$do_dv" ] ; then
481
# dv encoding
482
file=${outfile}dv.dv
483
do_ffmpeg $file -dct int -y -f pgmyuv -i $raw_src -s pal -an $file
484

    
485
# dv decoding
486
do_ffmpeg $raw_dst -y -i $file -f rawvideo -s cif $raw_dst
487
fi
488

    
489
###################################
490
if [ -n "$do_svq1" ] ; then
491
# svq1 encoding
492
file=${outfile}svq1.mov
493
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
494

    
495
# svq1 decoding
496
do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
497
fi
498

    
499
###################################
500
if [ -n "$do_mp2" ] ; then
501
# mp2 encoding
502
file=${outfile}mp2.mp2
503
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
504

    
505
# mp2 decoding
506
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
507
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
508
fi
509

    
510
###################################
511
if [ -n "$do_ac3" ] ; then
512
# ac3 encoding
513
file=${outfile}ac3.rm
514
do_ffmpeg $file -y -ab 128 -ac 2 -f s16le  -i $pcm_src -vn $file
515

    
516
# ac3 decoding
517
#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
518
fi
519

    
520
###################################
521
if [ -n "$do_g726" ] ; then
522
# g726 encoding
523
file=${outfile}g726.wav
524
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
525

    
526
# g726 decoding
527
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
528
fi
529

    
530
###################################
531
if [ -n "$do_adpcm_ima_wav" ] ; then
532
# encoding
533
file=${outfile}adpcm_ima.wav
534
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
535

    
536
# decoding
537
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
538
fi
539

    
540
###################################
541
if [ -n "$do_adpcm_ms" ] ; then
542
# encoding
543
file=${outfile}adpcm_ms.wav
544
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
545

    
546
# decoding
547
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
548
fi
549

    
550
###################################
551
if [ -n "$do_adpcm_yam" ] ; then
552
# encoding
553
file=${outfile}adpcm_yam.wav
554
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
555

    
556
# decoding
557
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
558
fi
559

    
560
###################################
561
# libav testing
562
###################################
563

    
564
if [ -n "$do_libav" ] ; then
565

    
566
# avi
567
file=${outfile}libav.avi
568
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
569
do_ffmpeg_crc $file -i $file
570

    
571
# asf
572
file=${outfile}libav.asf
573
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
574
do_ffmpeg_crc $file -i $file -r 25
575

    
576
# rm
577
file=${outfile}libav.rm
578
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
579
# broken
580
#do_ffmpeg_crc $file -i $file
581

    
582
# mpegps
583
file=${outfile}libav.mpg
584
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
585
do_ffmpeg_crc $file -i $file
586

    
587
# mpegts
588
file=${outfile}libav.ts
589
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
590
do_ffmpeg_crc $file -i $file
591

    
592
# swf (decode audio only)
593
file=${outfile}libav.swf
594
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
595
do_ffmpeg_crc $file -i $file
596

    
597
# ffm
598
file=${outfile}libav.ffm
599
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
600
do_ffmpeg_crc $file -i $file
601

    
602
# flv
603
file=${outfile}libav.flv
604
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
605
do_ffmpeg_crc $file -i $file
606

    
607
# mov
608
file=${outfile}libav.mov
609
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
610
do_ffmpeg_crc $file -i $file
611

    
612
# nut
613
file=${outfile}libav.nut
614
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
615
do_ffmpeg_crc $file -i $file
616

    
617
# dv
618
file=${outfile}libav.dv
619
do_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
620
do_ffmpeg_crc $file -i $file
621

    
622
####################
623
# streamed images
624
# mjpeg
625
#file=${outfile}libav.mjpeg
626
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
627
#do_ffmpeg_crc $file -i $file
628

    
629
# pbmpipe
630
file=${outfile}libav.pbm
631
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
632
do_ffmpeg_crc $file -f image2pipe -i $file
633

    
634
# pgmpipe
635
file=${outfile}libav.pgm
636
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
637
do_ffmpeg_crc $file -f image2pipe -i $file
638

    
639
# ppmpipe
640
file=${outfile}libav.ppm
641
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
642
do_ffmpeg_crc $file -f image2pipe -i $file
643

    
644
# gif
645
file=${outfile}libav.gif
646
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
647
#do_ffmpeg_crc $file -i $file
648

    
649
# yuv4mpeg
650
file=${outfile}libav.y4m
651
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
652
#do_ffmpeg_crc $file -i $file
653

    
654
####################
655
# image formats
656
# pgm (we do not do md5 on image files yet)
657
file=${outfile}libav%02d.pgm
658
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
659
do_ffmpeg_crc $file -i $file
660

    
661
# ppm (we do not do md5 on image files yet)
662
file=${outfile}libav%02d.ppm
663
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
664
do_ffmpeg_crc $file -i $file
665

    
666
# jpeg (we do not do md5 on image files yet)
667
file=${outfile}libav%02d.jpg
668
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src -flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p -f image2 $file
669
do_ffmpeg_crc $file -f image2 -i $file
670

    
671
####################
672
# audio only
673

    
674
# wav
675
file=${outfile}libav.wav
676
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
677
do_ffmpeg_crc $file -i $file
678

    
679
# alaw
680
file=${outfile}libav.al
681
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
682
do_ffmpeg_crc $file -i $file
683

    
684
# mulaw
685
file=${outfile}libav.ul
686
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
687
do_ffmpeg_crc $file -i $file
688

    
689
# au
690
file=${outfile}libav.au
691
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
692
do_ffmpeg_crc $file -i $file
693

    
694
# mmf
695
file=${outfile}libav.mmf
696
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
697
do_ffmpeg_crc $file -i $file
698

    
699
####################
700
# pix_fmt conversions
701
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
702
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
703
             monob pal8"
704
for pix_fmt in $conversions ; do
705
    file=${outfile}libav-${pix_fmt}.yuv
706
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
707
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
708
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
709
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
710
done
711

    
712
fi
713

    
714

    
715

    
716
if $diff_cmd "$logfile" "$reffile" ; then
717
    echo
718
    echo Regression test succeeded.
719
    exit 0
720
else
721
    echo
722
    echo Regression test: Error.
723
    exit 1
724
fi