Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ 16dd93ab

History | View | Annotate | Download (17.5 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" = "libavtest" ] ; then
40
    do_libav=y
41
    logfile="$datadir/libav.regression"
42
    outfile="$datadir/b-"
43
else
44
    do_mpeg=y
45
    do_mpeg2=y
46
    do_mpeg2thread=y
47
    do_msmpeg4v2=y
48
    do_msmpeg4=y
49
    do_wmv1=y
50
    do_wmv2=y
51
    do_h261=y
52
    do_h263=y
53
    do_h263p=y
54
    do_mpeg4=y
55
    do_huffyuv=y
56
    do_mjpeg=y
57
    do_ljpeg=y
58
    do_rv10=y
59
    do_rv20=y
60
    do_mp2=y
61
    do_ac3=y
62
    do_g726=y
63
    do_adpcm_ima_wav=y
64
    do_adpcm_ms=y
65
    do_rc=y
66
    do_mpeg4adv=y
67
    do_mpeg4thread=y
68
    do_mpeg4nr=y
69
    do_mpeg1b=y
70
    do_asv1=y
71
    do_asv2=y
72
    do_flv=y
73
    do_ffv1=y
74
    do_error=y
75
    do_svq1=y
76
fi
77

    
78

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

    
98
# create the data directory if it does not exists
99
mkdir -p $datadir
100

    
101
do_ffmpeg()
102
{
103
    f="$1"
104
    shift
105
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
106
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
107
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
108
    rm -f /tmp/ffmpeg$$
109
    do_md5sum $f >> $logfile
110
    if [ $f = $raw_dst ] ; then
111
        $tiny_psnr $f $raw_ref >> $logfile
112
    elif [ $f = $pcm_dst ] ; then
113
        $tiny_psnr $f $pcm_ref >> $logfile
114
    else
115
        wc -c $f >> $logfile
116
    fi
117
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
118
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
119
}
120

    
121
do_ffmpeg_crc()
122
{
123
    f="$1"
124
    shift
125
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
126
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
127
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
128
    rm -f /tmp/ffmpeg$$ 
129
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
130
}
131

    
132
do_ffmpeg_nocheck()
133
{
134
    f="$1"
135
    shift
136
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
137
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
138
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
139
    rm -f /tmp/ffmpeg$$
140
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
141
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
142
}
143

    
144
echo "ffmpeg regression test" > $logfile
145
echo "ffmpeg benchmarks" > $benchfile
146

    
147
###################################
148
# generate reference for quality check
149
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
150
do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
151

    
152
###################################
153
if [ -n "$do_mpeg" ] ; then
154
# mpeg1 encoding
155
file=${outfile}mpeg1.mpg
156
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file 
157

    
158
# mpeg1 decoding
159
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
160
fi
161

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

    
168
# mpeg2 decoding
169
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
170

    
171
# mpeg2 encoding
172
file=${outfile}mpeg2.mpg
173
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct_algo 1 -dct_algo 2 -f mpeg1video $file 
174

    
175
# mpeg2 decoding
176
do_ffmpeg $raw_dst -y -idct_algo 1 -i $file -f rawvideo $raw_dst
177

    
178
# mpeg2 encoding interlaced
179
file=${outfile}mpeg2i.mpg
180
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -ildct -ilme $file 
181

    
182
# mpeg2 decoding
183
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
184
fi
185

    
186
###################################
187
if [ -n "$do_mpeg2thread" ] ; then
188
# mpeg2 encoding interlaced
189
file=${outfile}mpeg2thread.mpg
190
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -ildct -ilme -threads 2 $file 
191

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

    
195
# mpeg2 encoding interlaced
196
file=${outfile}mpeg2reuse.mpg
197
do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -ildct -ilme -threads 4 $file 
198

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

    
203
###################################
204
if [ -n "$do_msmpeg4v2" ] ; then
205
# msmpeg4 encoding
206
file=${outfile}msmpeg4v2.avi
207
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
208

    
209
# msmpeg4v2 decoding
210
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
211
fi
212

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

    
219
# msmpeg4 decoding
220
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
221
fi
222

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

    
229
# wmv1 decoding
230
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
231
fi
232

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

    
239
# wmv2 decoding
240
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
241
fi
242

    
243
###################################
244
if [ -n "$do_h261" ] ; then
245
# h261 encoding
246
file=${outfile}h261.avi
247
do_ffmpeg $file -y -qscale 11 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h261 $file
248

    
249
# h261 decoding
250
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
251
fi
252

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

    
259
# h263 decoding
260
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
261
fi
262

    
263
###################################
264
if [ -n "$do_h263p" ] ; then
265
# h263p encoding
266
file=${outfile}h263p.avi
267
do_ffmpeg $file -y -qscale 2 -umv -aiv -aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
268

    
269
# h263p decoding
270
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
271
fi
272

    
273
###################################
274
if [ -n "$do_mpeg4" ] ; then
275
# mpeg4
276
file=${outfile}odivx.mp4
277
do_ffmpeg $file -y -4mv -hq -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
278

    
279
# mpeg4 decoding
280
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
281
fi
282

    
283
###################################
284
if [ -n "$do_huffyuv" ] ; then
285
# huffyuv
286
file=${outfile}huffyuv.avi
287
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec huffyuv -pix_fmt yuv422p $file
288

    
289
# huffyuv decoding
290
do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
291
fi
292

    
293
###################################
294
if [ -n "$do_rc" ] ; then
295
# mpeg4 rate control
296
file=${outfile}mpeg4-rc.avi
297
do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
298

    
299
# mpeg4 rate control decoding
300
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
301
fi
302

    
303
###################################
304
if [ -n "$do_mpeg4adv" ] ; then
305
# mpeg4
306
file=${outfile}mpeg4-adv.avi
307
do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 200 -aic -trell -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
308

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

    
313
###################################
314
if [ -n "$do_mpeg4thread" ] ; then
315
# mpeg4
316
file=${outfile}mpeg4-thread.avi
317
do_ffmpeg $file -y -b 500 -4mv -hq -part -ps 200 -aic -trell -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 -threads 2 $file
318

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

    
323
###################################
324
if [ -n "$do_mpeg4adv" ] ; then
325
# mpeg4
326
file=${outfile}mpeg4-Q.avi
327
do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -qpel -bf 2 -cmp 1 -subcmp 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
328

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

    
333
###################################
334
if [ -n "$do_error" ] ; then
335
# damaged mpeg4
336
file=${outfile}error-mpeg4-adv.avi
337
do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -part -ps 250 -error 10 -aic -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
338

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

    
343
###################################
344
if [ -n "$do_mpeg4nr" ] ; then
345
# noise reduction
346
file=${outfile}mpeg4-nr.avi
347
do_ffmpeg $file -y -qscale 8 -4mv -mbd 2 -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
348

    
349
# mpeg4 decoding
350
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
351
fi
352

    
353
###################################
354
if [ -n "$do_mpeg1b" ] ; then
355
# mpeg1
356
file=${outfile}mpeg1b.mpg
357
do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
358

    
359
# mpeg1 decoding
360
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
361
fi
362

    
363
###################################
364
if [ -n "$do_mjpeg" ] ; then
365
# mjpeg
366
file=${outfile}mjpeg.avi
367
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg -pix_fmt yuvj420p $file
368

    
369
# mjpeg decoding
370
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
371
fi
372

    
373
###################################
374
if [ -n "$do_ljpeg" ] ; then
375
# ljpeg
376
file=${outfile}ljpeg.avi
377
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg -strict -1 $file
378

    
379
# ljpeg decoding
380
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
381
fi
382

    
383
###################################
384
if [ -n "$do_rv10" ] ; then
385
# rv10 encoding
386
file=${outfile}rv10.rm
387
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file 
388

    
389
# rv10 decoding
390
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
391
fi
392

    
393
###################################
394
if [ -n "$do_rv20" ] ; then
395
# rv20 encoding
396
file=${outfile}rv20.rm
397
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec rv20 -an $file 
398

    
399
# rv20 decoding
400
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
401
fi
402

    
403
###################################
404
if [ -n "$do_asv1" ] ; then
405
# asv1 encoding
406
file=${outfile}asv1.avi
407
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
408

    
409
# asv1 decoding
410
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
411
fi
412

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

    
419
# asv2 decoding
420
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
421
fi
422

    
423
###################################
424
if [ -n "$do_flv" ] ; then
425
# flv encoding
426
file=${outfile}flv.flv
427
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
428

    
429
# flv decoding
430
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
431
fi
432

    
433
###################################
434
if [ -n "$do_ffv1" ] ; then
435
# ffv1 encoding
436
file=${outfile}ffv1.avi
437
do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
438

    
439
# ffv1 decoding
440
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
441
fi
442

    
443
###################################
444
if [ -n "$do_svq1" ] ; then
445
# svq1 encoding
446
file=${outfile}svq1.mov
447
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
448

    
449
# svq1 decoding
450
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
451
fi
452

    
453
###################################
454
if [ -n "$do_mp2" ] ; then
455
# mp2 encoding
456
file=${outfile}mp2.mp2
457
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file 
458

    
459
# mp2 decoding
460
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
461
fi
462

    
463
###################################
464
if [ -n "$do_ac3" ] ; then
465
# ac3 encoding
466
file=${outfile}ac3.rm
467
do_ffmpeg $file -y -ab 128 -ac 2 -f s16le  -i $pcm_src -vn $file 
468

    
469
# ac3 decoding
470
#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
471
fi
472

    
473
###################################
474
if [ -n "$do_g726" ] ; then
475
# g726 encoding
476
file=${outfile}g726.wav
477
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file 
478

    
479
# g726 decoding
480
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
481
fi
482

    
483
###################################
484
if [ -n "$do_adpcm_ima_wav" ] ; then
485
# encoding
486
file=${outfile}adpcm_ima.wav
487
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file 
488

    
489
# decoding
490
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
491
fi
492

    
493
###################################
494
if [ -n "$do_adpcm_ms" ] ; then
495
# encoding
496
file=${outfile}adpcm_ms.wav
497
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file 
498

    
499
# decoding
500
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
501
fi
502

    
503
###################################
504
# libav testing
505
###################################
506

    
507
if [ -n "$do_libav" ] ; then
508

    
509
# avi
510
file=${outfile}libav.avi
511
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
512
do_ffmpeg_crc $file -i $file
513

    
514
# asf
515
file=${outfile}libav.asf
516
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
517
do_ffmpeg_crc $file -i $file -r 25
518

    
519
# rm
520
file=${outfile}libav.rm
521
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
522
# broken
523
#do_ffmpeg_crc $file -i $file
524

    
525
# mpegps
526
file=${outfile}libav.mpg
527
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
528
do_ffmpeg_crc $file -i $file
529

    
530
# swf (decode audio only)
531
file=${outfile}libav.swf
532
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
533
do_ffmpeg_crc $file -i $file
534

    
535
# ffm
536
file=${outfile}libav.ffm
537
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
538
do_ffmpeg_crc $file -i $file
539

    
540
# flv
541
file=${outfile}libav.flv
542
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
543
do_ffmpeg_crc $file -i $file
544

    
545
# mov
546
file=${outfile}libav.mov
547
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
548
do_ffmpeg_crc $file -i $file
549

    
550
# nut
551
file=${outfile}libav.nut
552
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
553
do_ffmpeg_crc $file -i $file
554

    
555
# dv
556
file=${outfile}libav.dv
557
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
558
do_ffmpeg_crc $file -i $file
559

    
560
# XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)
561

    
562
####################
563
# streamed images
564
# mjpeg
565
#file=${outfile}libav.mjpeg
566
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
567
#do_ffmpeg_crc $file -i $file
568

    
569
# pbmpipe
570
file=${outfile}libav.pbm
571
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
572
do_ffmpeg_crc $file -f image2pipe -i $file
573

    
574
# pgmpipe
575
file=${outfile}libav.pgm
576
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
577
do_ffmpeg_crc $file -f image2pipe -i $file
578

    
579
# ppmpipe
580
file=${outfile}libav.ppm
581
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
582
do_ffmpeg_crc $file -f image2pipe -i $file
583

    
584
# gif
585
file=${outfile}libav.gif
586
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
587
#do_ffmpeg_crc $file -i $file
588

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

    
594
####################
595
# image formats
596
# pgm (we do not do md5 on image files yet)
597
file=${outfile}libav%d.pgm
598
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
599
do_ffmpeg_crc $file -i $file
600

    
601
# ppm (we do not do md5 on image files yet)
602
file=${outfile}libav%d.ppm
603
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
604
do_ffmpeg_crc $file -i $file
605

    
606
# jpeg (we do not do md5 on image files yet)
607
file=${outfile}libav%d.jpg
608
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src -bitexact -dct_algo 1 -idct_algo 2 -pix_fmt yuvj420p -f image2 $file
609
do_ffmpeg_crc $file -f image2 -i $file
610

    
611
####################
612
# audio only
613

    
614
# wav
615
file=${outfile}libav.wav
616
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
617
do_ffmpeg_crc $file -i $file
618

    
619
# alaw
620
file=${outfile}libav.al
621
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
622
do_ffmpeg_crc $file -i $file
623

    
624
# mulaw
625
file=${outfile}libav.ul
626
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
627
do_ffmpeg_crc $file -i $file
628

    
629
# au
630
file=${outfile}libav.au
631
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
632
do_ffmpeg_crc $file -i $file
633

    
634
####################
635
# pix_fmt conversions
636
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
637
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
638
	     monob pal8"
639
for pix_fmt in $conversions ; do
640
    file=${outfile}libav-${pix_fmt}.yuv
641
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
642
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
643
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
644
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
645
done
646

    
647
fi
648

    
649

    
650

    
651
if $diff_cmd "$logfile" "$reffile" ; then
652
    echo 
653
    echo Regression test succeeded.
654
    exit 0
655
else
656
    echo 
657
    echo Regression test: Error.
658
    exit 1
659
fi