Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ 29f7ae79

History | View | Annotate | Download (19.1 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_huffyuv=y
60
    do_mjpeg=y
61
    do_ljpeg=y
62
    do_rv10=y
63
    do_rv20=y
64
    do_mp2=y
65
    do_ac3=y
66
    do_g726=y
67
    do_adpcm_ima_wav=y
68
    do_adpcm_ms=y
69
    do_rc=y
70
    do_mpeg4adv=y
71
    do_mpeg4thread=y
72
    do_mpeg4nr=y
73
    do_mpeg1b=y
74
    do_asv1=y
75
    do_asv2=y
76
    do_flv=y
77
    do_ffv1=y
78
    do_error=y
79
    do_svq1=y
80
    do_snow=y
81
    do_snowll=y
82
    do_adpcm_yam=y
83
    do_dv=y
84
fi
85

    
86

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
341
###################################
342
if [ -n "$do_error" ] ; then
343
# damaged mpeg4
344
file=${outfile}error-mpeg4-adv.avi
345
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
346

    
347
# damaged mpeg4 decoding
348
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
349
fi
350

    
351
###################################
352
if [ -n "$do_mpeg4nr" ] ; then
353
# noise reduction
354
file=${outfile}mpeg4-nr.avi
355
do_ffmpeg $file -y -qscale 8 -flags +mv4 -mbd rd -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
356

    
357
# mpeg4 decoding
358
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
359
fi
360

    
361
###################################
362
if [ -n "$do_mpeg1b" ] ; then
363
# mpeg1
364
file=${outfile}mpeg1b.mpg
365
do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
366

    
367
# mpeg1 decoding
368
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
369
fi
370

    
371
###################################
372
if [ -n "$do_mjpeg" ] ; then
373
# mjpeg
374
file=${outfile}mjpeg.avi
375
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg -pix_fmt yuvj420p $file
376

    
377
# mjpeg decoding
378
do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
379
fi
380

    
381
###################################
382
if [ -n "$do_ljpeg" ] ; then
383
# ljpeg
384
file=${outfile}ljpeg.avi
385
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg -strict -1 $file
386

    
387
# ljpeg decoding
388
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
389
fi
390

    
391
###################################
392
if [ -n "$do_rv10" ] ; then
393
# rv10 encoding
394
file=${outfile}rv10.rm
395
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
396

    
397
# rv10 decoding
398
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
399
fi
400

    
401
###################################
402
if [ -n "$do_rv20" ] ; then
403
# rv20 encoding
404
file=${outfile}rv20.rm
405
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec rv20 -an $file
406

    
407
# rv20 decoding
408
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
409
fi
410

    
411
###################################
412
if [ -n "$do_asv1" ] ; then
413
# asv1 encoding
414
file=${outfile}asv1.avi
415
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
416

    
417
# asv1 decoding
418
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
419
fi
420

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

    
427
# asv2 decoding
428
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
429
fi
430

    
431
###################################
432
if [ -n "$do_flv" ] ; then
433
# flv encoding
434
file=${outfile}flv.flv
435
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
436

    
437
# flv decoding
438
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
439
fi
440

    
441
###################################
442
if [ -n "$do_ffv1" ] ; then
443
# ffv1 encoding
444
file=${outfile}ffv1.avi
445
do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
446

    
447
# ffv1 decoding
448
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
449
fi
450

    
451
###################################
452
if [ -n "$do_snow" ] ; then
453
# snow encoding
454
file=${outfile}snow.avi
455
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
456

    
457
# snow decoding
458
do_ffmpeg $raw_dst -y -i $file -f rawvideo -s 352x288 $raw_dst
459
fi
460

    
461
###################################
462
if [ -n "$do_snowll" ] ; then
463
# snow encoding
464
file=${outfile}snow53.avi
465
do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec snow -pred 1 -flags +mv4+qpel $file
466

    
467
# snow decoding
468
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
469
fi
470

    
471
###################################
472
if [ -n "$do_dv" ] ; then
473
# dv encoding
474
file=${outfile}dv.dv
475
do_ffmpeg $file -dct int -y -f pgmyuv -i $raw_src -s pal -an $file
476

    
477
# dv decoding
478
do_ffmpeg $raw_dst -y -i $file -f rawvideo -s cif $raw_dst
479
fi
480

    
481
###################################
482
if [ -n "$do_svq1" ] ; then
483
# svq1 encoding
484
file=${outfile}svq1.mov
485
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
486

    
487
# svq1 decoding
488
do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
489
fi
490

    
491
###################################
492
if [ -n "$do_mp2" ] ; then
493
# mp2 encoding
494
file=${outfile}mp2.mp2
495
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
496

    
497
# mp2 decoding
498
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
499
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
500
fi
501

    
502
###################################
503
if [ -n "$do_ac3" ] ; then
504
# ac3 encoding
505
file=${outfile}ac3.rm
506
do_ffmpeg $file -y -ab 128 -ac 2 -f s16le  -i $pcm_src -vn $file
507

    
508
# ac3 decoding
509
#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
510
fi
511

    
512
###################################
513
if [ -n "$do_g726" ] ; then
514
# g726 encoding
515
file=${outfile}g726.wav
516
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
517

    
518
# g726 decoding
519
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
520
fi
521

    
522
###################################
523
if [ -n "$do_adpcm_ima_wav" ] ; then
524
# encoding
525
file=${outfile}adpcm_ima.wav
526
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
527

    
528
# decoding
529
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
530
fi
531

    
532
###################################
533
if [ -n "$do_adpcm_ms" ] ; then
534
# encoding
535
file=${outfile}adpcm_ms.wav
536
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
537

    
538
# decoding
539
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
540
fi
541

    
542
###################################
543
if [ -n "$do_adpcm_yam" ] ; then
544
# encoding
545
file=${outfile}adpcm_yam.wav
546
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
547

    
548
# decoding
549
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
550
fi
551

    
552
###################################
553
# libav testing
554
###################################
555

    
556
if [ -n "$do_libav" ] ; then
557

    
558
# avi
559
file=${outfile}libav.avi
560
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
561
do_ffmpeg_crc $file -i $file
562

    
563
# asf
564
file=${outfile}libav.asf
565
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
566
do_ffmpeg_crc $file -i $file -r 25
567

    
568
# rm
569
file=${outfile}libav.rm
570
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
571
# broken
572
#do_ffmpeg_crc $file -i $file
573

    
574
# mpegps
575
file=${outfile}libav.mpg
576
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
577
do_ffmpeg_crc $file -i $file
578

    
579
# mpegts
580
file=${outfile}libav.ts
581
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
582
do_ffmpeg_crc $file -i $file
583

    
584
# swf (decode audio only)
585
file=${outfile}libav.swf
586
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
587
do_ffmpeg_crc $file -i $file
588

    
589
# ffm
590
file=${outfile}libav.ffm
591
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
592
do_ffmpeg_crc $file -i $file
593

    
594
# flv
595
file=${outfile}libav.flv
596
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
597
do_ffmpeg_crc $file -i $file
598

    
599
# mov
600
file=${outfile}libav.mov
601
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
602
do_ffmpeg_crc $file -i $file
603

    
604
# nut
605
file=${outfile}libav.nut
606
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
607
do_ffmpeg_crc $file -i $file
608

    
609
# dv
610
file=${outfile}libav.dv
611
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
612
do_ffmpeg_crc $file -i $file
613

    
614
####################
615
# streamed images
616
# mjpeg
617
#file=${outfile}libav.mjpeg
618
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
619
#do_ffmpeg_crc $file -i $file
620

    
621
# pbmpipe
622
file=${outfile}libav.pbm
623
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
624
do_ffmpeg_crc $file -f image2pipe -i $file
625

    
626
# pgmpipe
627
file=${outfile}libav.pgm
628
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
629
do_ffmpeg_crc $file -f image2pipe -i $file
630

    
631
# ppmpipe
632
file=${outfile}libav.ppm
633
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
634
do_ffmpeg_crc $file -f image2pipe -i $file
635

    
636
# gif
637
file=${outfile}libav.gif
638
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
639
#do_ffmpeg_crc $file -i $file
640

    
641
# yuv4mpeg
642
file=${outfile}libav.y4m
643
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
644
#do_ffmpeg_crc $file -i $file
645

    
646
####################
647
# image formats
648
# pgm (we do not do md5 on image files yet)
649
file=${outfile}libav%02d.pgm
650
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
651
do_ffmpeg_crc $file -i $file
652

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

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

    
663
####################
664
# audio only
665

    
666
# wav
667
file=${outfile}libav.wav
668
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
669
do_ffmpeg_crc $file -i $file
670

    
671
# alaw
672
file=${outfile}libav.al
673
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
674
do_ffmpeg_crc $file -i $file
675

    
676
# mulaw
677
file=${outfile}libav.ul
678
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
679
do_ffmpeg_crc $file -i $file
680

    
681
# au
682
file=${outfile}libav.au
683
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
684
do_ffmpeg_crc $file -i $file
685

    
686
# mmf
687
file=${outfile}libav.mmf
688
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
689
do_ffmpeg_crc $file -i $file
690

    
691
####################
692
# pix_fmt conversions
693
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
694
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
695
             monob pal8"
696
for pix_fmt in $conversions ; do
697
    file=${outfile}libav-${pix_fmt}.yuv
698
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
699
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
700
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
701
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
702
done
703

    
704
fi
705

    
706

    
707

    
708
if $diff_cmd "$logfile" "$reffile" ; then
709
    echo
710
    echo Regression test succeeded.
711
    exit 0
712
else
713
    echo
714
    echo Regression test: Error.
715
    exit 1
716
fi