Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ a98d3e82

History | View | Annotate | Download (16.9 KB)

1
#!/bin/sh
2
#
3
# automatic regression test for ffmpeg
4
#
5
#
6
#set -x
7
# Even in the 21st century some diffs do not support -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 run
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_libavtest=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_jpegls=y
64
    do_rv10=y
65
    do_rv20=y
66
    do_mp2=y
67
    do_ac3=y
68
    do_g726=y
69
    do_adpcm_ima_wav=y
70
    do_adpcm_ms=y
71
    do_flac=y
72
    do_wma=y
73
    do_vorbis=y
74
    do_rc=y
75
    do_mpeg4adv=y
76
    do_mpeg4thread=y
77
    do_mpeg4nr=y
78
    do_mpeg1b=y
79
    do_asv1=y
80
    do_asv2=y
81
    do_flv=y
82
    do_ffv1=y
83
    do_error=y
84
    do_svq1=y
85
    do_snow=y
86
    do_snowll=y
87
    do_adpcm_yam=y
88
    do_dv=y
89
    do_dv50=y
90
fi
91

    
92

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

    
114
# create the data directory if it does not exist
115
mkdir -p $datadir
116

    
117
FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple"
118

    
119
do_ffmpeg()
120
{
121
    f="$1"
122
    shift
123
    echo $ffmpeg $FFMPEG_OPTS $*
124
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
125
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
126
    rm -f /tmp/ffmpeg$$
127
    do_md5sum $f >> $logfile
128
    if [ $f = $raw_dst ] ; then
129
        $tiny_psnr $f $raw_ref >> $logfile
130
    elif [ $f = $pcm_dst ] ; then
131
        $tiny_psnr $f $pcm_ref 2 >> $logfile
132
    else
133
        wc -c $f >> $logfile
134
    fi
135
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
136
    echo `cat $bench2` $f >> $benchfile
137
}
138

    
139
do_ffmpeg_nomd5()
140
{
141
    f="$1"
142
    shift
143
    echo $ffmpeg $FFMPEG_OPTS $*
144
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
145
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
146
    rm -f /tmp/ffmpeg$$
147
    if [ $f = $raw_dst ] ; then
148
        $tiny_psnr $f $raw_ref >> $logfile
149
    elif [ $f = $pcm_dst ] ; then
150
        $tiny_psnr $f $pcm_ref 2 >> $logfile
151
    else
152
        wc -c $f >> $logfile
153
    fi
154
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
155
    echo `cat $bench2` $f >> $benchfile
156
}
157

    
158
do_ffmpeg_crc()
159
{
160
    f="$1"
161
    shift
162
    echo $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc
163
    $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
164
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
165
    rm -f /tmp/ffmpeg$$
166
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
167
}
168

    
169
do_ffmpeg_nocheck()
170
{
171
    f="$1"
172
    shift
173
    echo $ffmpeg $FFMPEG_OPTS $*
174
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
175
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
176
    rm -f /tmp/ffmpeg$$
177
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
178
    echo `cat $bench2` $f >> $benchfile
179
}
180

    
181
do_video_decoding()
182
{
183
    do_ffmpeg $raw_dst -y $1 -i $file -f rawvideo $2 $raw_dst
184
}
185

    
186
do_video_encoding()
187
{
188
    file=${outfile}$1
189
    do_ffmpeg $file -y $2 -f $3 -i $raw_src $4 $file
190
}
191

    
192
do_audio_encoding()
193
{
194
    file=${outfile}$1
195
    do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src $3 $file
196
}
197

    
198
do_audio_decoding()
199
{
200
    do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
201
}
202

    
203
do_libav()
204
{
205
    file=${outfile}libav.$1
206
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
207
    do_ffmpeg_crc $file -i $file $3
208

    
209
}
210

    
211
do_streamed_images()
212
{
213
    file=${outfile}libav.$1
214
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
215
    do_ffmpeg_crc $file -f image2pipe -i $file
216
}
217

    
218
do_image_formats()
219
{
220
    file=${outfile}libav%02d.$1
221
    $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $2 $3 $file
222
    do_ffmpeg_crc $file $3 -i $file
223

    
224
}
225

    
226
do_audio_only()
227
{
228
    file=${outfile}libav.$1
229
    do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
230
    do_ffmpeg_crc $file -i $file
231
}
232

    
233
echo "ffmpeg regression test" > $logfile
234
echo "ffmpeg benchmarks" > $benchfile
235

    
236
###################################
237
# generate reference for quality check
238
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
239
do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
240

    
241
###################################
242
if [ -n "$do_mpeg" ] ; then
243
# mpeg1
244
do_video_encoding mpeg1.mpg "-qscale 10" pgmyuv "-f mpeg1video"
245
do_video_decoding
246
fi
247

    
248
###################################
249
if [ -n "$do_mpeg2" ] ; then
250
# mpeg2
251
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video"
252
do_video_decoding
253

    
254
# mpeg2 encoding intra vlc qprd
255
do_video_encoding mpeg2ivlc-qprd.mpg "-b 500k -bf 2 -flags +trell+qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-vcodec mpeg2video -f mpeg2video"
256

    
257
# mpeg2 decoding
258
do_video_decoding
259

    
260
# mpeg2
261
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
262
do_video_decoding "-idct int"
263

    
264
# mpeg2 encoding interlaced
265
do_video_encoding mpeg2i.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
266

    
267
# mpeg2 decoding
268
do_video_decoding
269
fi
270

    
271
###################################
272
if [ -n "$do_mpeg2thread" ] ; then
273
# mpeg2 encoding interlaced
274
do_video_encoding mpeg2thread.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
275

    
276
# mpeg2 decoding
277
do_video_decoding
278

    
279
# mpeg2 encoding interlaced using intra vlc
280
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
281

    
282
# mpeg2 decoding
283
do_video_decoding
284

    
285
# mpeg2 encoding interlaced
286
file=${outfile}mpeg2reuse.mpg
287
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
288

    
289
# mpeg2 decoding
290
do_video_decoding
291
fi
292

    
293
###################################
294
if [ -n "$do_msmpeg4v2" ] ; then
295
# msmpeg4
296
do_video_encoding msmpeg4v2.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4v2"
297
do_video_decoding
298
fi
299

    
300
###################################
301
if [ -n "$do_msmpeg4" ] ; then
302
# msmpeg4
303
do_video_encoding msmpeg4.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4"
304
do_video_decoding
305
fi
306

    
307
###################################
308
if [ -n "$do_wmv1" ] ; then
309
# wmv1
310
do_video_encoding wmv1.avi "-qscale 10" pgmyuv "-an -vcodec wmv1"
311
do_video_decoding
312
fi
313

    
314
###################################
315
if [ -n "$do_wmv2" ] ; then
316
# wmv2
317
do_video_encoding wmv2.avi "-qscale 10" pgmyuv "-an -vcodec wmv2"
318
do_video_decoding
319
fi
320

    
321
###################################
322
if [ -n "$do_h261" ] ; then
323
# h261
324
do_video_encoding h261.avi "-qscale 11" pgmyuv "-s 352x288 -an -vcodec h261"
325
do_video_decoding
326
fi
327

    
328
###################################
329
if [ -n "$do_h263" ] ; then
330
# h263
331
do_video_encoding h263.avi "-qscale 10" pgmyuv "-s 352x288 -an -vcodec h263"
332
do_video_decoding
333
fi
334

    
335
###################################
336
if [ -n "$do_h263p" ] ; then
337
# h263p
338
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" pgmyuv "-s 352x288 -an -vcodec h263p -ps 300"
339
do_video_decoding
340
fi
341

    
342
###################################
343
if [ -n "$do_mpeg4" ] ; then
344
# mpeg4
345
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" pgmyuv "-an -vcodec mpeg4"
346
do_video_decoding
347
fi
348

    
349
###################################
350
if [ -n "$do_huffyuv" ] ; then
351
# huffyuv
352
do_video_encoding huffyuv.avi "" pgmyuv "-an -vcodec huffyuv -pix_fmt yuv422p"
353
do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
354
fi
355

    
356
###################################
357
if [ -n "$do_rc" ] ; then
358
# mpeg4 rate control
359
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" pgmyuv "-an -vcodec mpeg4"
360
do_video_decoding
361
fi
362

    
363
###################################
364
if [ -n "$do_mpeg4adv" ] ; then
365
# mpeg4
366
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" pgmyuv "-an -vcodec mpeg4"
367
do_video_decoding
368

    
369
# mpeg4
370
do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -flags +mv4+trell+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-an -vcodec mpeg4"
371
do_video_decoding
372

    
373
# mpeg4
374
do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+trell+mv0 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" pgmyuv "-an -vcodec mpeg4"
375
do_video_decoding
376

    
377
# mpeg4
378
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" pgmyuv "-an -vcodec mpeg4"
379
do_video_decoding
380
fi
381

    
382
###################################
383
if [ -n "$do_mpeg4thread" ] ; then
384
# mpeg4
385
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" pgmyuv "-an -vcodec mpeg4 -threads 2"
386
do_video_decoding
387
fi
388

    
389
###################################
390
if [ -n "$do_mp4psp" ] ; then
391
# mp4 PSP style
392
do_video_encoding mpeg4-PSP.mp4 "-b 768k -s 320x240" psp "-ar 24000 -ab 32 -i $raw_src"
393
fi
394

    
395
###################################
396
if [ -n "$do_error" ] ; then
397
# damaged mpeg4
398
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" pgmyuv "-an -vcodec mpeg4"
399
do_video_decoding
400
fi
401

    
402
###################################
403
if [ -n "$do_mpeg4nr" ] ; then
404
# noise reduction
405
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" pgmyuv "-an -vcodec mpeg4"
406
do_video_decoding
407
fi
408

    
409
###################################
410
if [ -n "$do_mpeg1b" ] ; then
411
# mpeg1
412
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" pgmyuv "-an -vcodec mpeg1video -f mpeg1video"
413
do_video_decoding
414
fi
415

    
416
###################################
417
if [ -n "$do_mjpeg" ] ; then
418
# mjpeg
419
do_video_encoding mjpeg.avi "-qscale 10" pgmyuv "-an -vcodec mjpeg -pix_fmt yuvj420p"
420
do_video_decoding "" "-pix_fmt yuv420p"
421
fi
422

    
423
###################################
424
if [ -n "$do_ljpeg" ] ; then
425
# ljpeg
426
do_video_encoding ljpeg.avi "" pgmyuv "-an -vcodec ljpeg -strict -1"
427
do_video_decoding
428
fi
429

    
430
###################################
431
if [ -n "$do_jpegls" ] ; then
432
# jpeg ls
433
do_video_encoding jpegls.avi "" pgmyuv "-an -vcodec jpegls -vtag MJPG"
434
do_video_decoding "" "-pix_fmt yuv420p"
435
fi
436

    
437
###################################
438
if [ -n "$do_rv10" ] ; then
439
# rv10 encoding
440
do_video_encoding rv10.rm "-qscale 10" pgmyuv "-an"
441
do_video_decoding
442
fi
443

    
444
###################################
445
if [ -n "$do_rv20" ] ; then
446
# rv20 encoding
447
do_video_encoding rv20.rm "-qscale 10" pgmyuv "-vcodec rv20 -an"
448
do_video_decoding
449
fi
450

    
451
###################################
452
if [ -n "$do_asv1" ] ; then
453
# asv1 encoding
454
do_video_encoding asv1.avi "-qscale 10" pgmyuv "-an -vcodec asv1"
455
do_video_decoding
456
fi
457

    
458
###################################
459
if [ -n "$do_asv2" ] ; then
460
# asv2 encoding
461
do_video_encoding asv2.avi "-qscale 10" pgmyuv "-an -vcodec asv2"
462
do_video_decoding
463
fi
464

    
465
###################################
466
if [ -n "$do_flv" ] ; then
467
# flv encoding
468
do_video_encoding flv.flv "-qscale 10" pgmyuv "-an -vcodec flv"
469
do_video_decoding
470
fi
471

    
472
###################################
473
if [ -n "$do_ffv1" ] ; then
474
# ffv1 encoding
475
do_video_encoding ffv1.avi "-strict -2" pgmyuv "-an -vcodec ffv1"
476
do_video_decoding
477
fi
478

    
479
###################################
480
if [ -n "$do_snow" ] ; then
481
# snow
482
do_video_encoding snow.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
483
do_video_decoding "" "-s 352x288"
484
fi
485

    
486
###################################
487
if [ -n "$do_snowll" ] ; then
488
# snow
489
do_video_encoding snow53.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
490
do_video_decoding
491
fi
492

    
493
###################################
494
if [ -n "$do_dv" ] ; then
495
# dv
496
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -an"
497
do_video_decoding "" "-s cif"
498
fi
499

    
500
###################################
501
if [ -n "$do_dv50" ] ; then
502
# dv50
503
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -pix_fmt yuv422p -an"
504
do_video_decoding "" "-s cif -pix_fmt yuv420p"
505
fi
506

    
507

    
508
###################################
509
if [ -n "$do_svq1" ] ; then
510
# svq1
511
do_video_encoding svq1.mov "" pgmyuv "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
512
do_video_decoding "" "-pix_fmt yuv420p"
513
fi
514

    
515
###################################
516
if [ -n "$do_mp2" ] ; then
517
# mp2
518
do_audio_encoding mp2.mp2 "-ar 44100"
519
do_audio_decoding
520
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
521
fi
522

    
523
###################################
524
if [ -n "$do_ac3" ] ; then
525
# ac3
526
do_audio_encoding ac3.rm "" -vn
527
#do_audio_decoding
528
fi
529

    
530
###################################
531
if [ -n "$do_g726" ] ; then
532
# g726
533
do_audio_encoding g726.wav "-ar 44100" "-ab 32 -ac 1 -ar 8000 -acodec g726"
534
do_audio_decoding
535
fi
536

    
537
###################################
538
if [ -n "$do_adpcm_ima_wav" ] ; then
539
# adpcm ima
540
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
541
do_audio_decoding
542
fi
543

    
544
###################################
545
if [ -n "$do_adpcm_ms" ] ; then
546
# adpcm ms
547
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
548
do_audio_decoding
549
fi
550

    
551
###################################
552
if [ -n "$do_adpcm_yam" ] ; then
553
# adpcm yamaha
554
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
555
do_audio_decoding
556
fi
557

    
558
###################################
559
if [ -n "$do_flac" ] ; then
560
# flac
561
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
562
do_audio_decoding
563
fi
564

    
565
###################################
566
if [ -n "$do_wma" ] ; then
567
# wmav1
568
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
569
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
570
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
571
# wmav2
572
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
573
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
574
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
575
fi
576

    
577
###################################
578
#if [ -n "$do_vorbis" ] ; then
579
# vorbis
580
#disabled because its broken
581
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
582
#do_audio_decoding
583
#fi
584

    
585
###################################
586
# libavformat testing
587
###################################
588

    
589
if [ -n "$do_libavtest" ] ; then
590

    
591
# avi
592
do_libav avi
593

    
594
# asf
595
do_libav asf "-acodec mp2" "-r 25"
596

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

    
603
# mpegps
604
do_libav mpg
605

    
606
# mpegts
607
do_libav ts
608

    
609
# swf
610
do_libav swf -an
611

    
612
# ffm
613
do_libav ffm
614

    
615
# flv
616
do_libav flv -an
617

    
618
# mov
619
do_libav mov "-acodec pcm_alaw"
620

    
621
# nut
622
#do_libav nut "-acodec mp2"
623

    
624
# dv
625
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
626

    
627
# gxf
628
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
629

    
630
####################
631
# streamed images
632
# mjpeg
633
#file=${outfile}libav.mjpeg
634
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
635
#do_ffmpeg_crc $file -i $file
636

    
637
# pbmpipe
638
do_streamed_images pbm
639

    
640
# pgmpipe
641
do_streamed_images pgm
642

    
643
# ppmpipe
644
do_streamed_images ppm
645

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

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

    
656
####################
657
# image formats
658
# pgm (we do not do md5 on image files yet)
659
do_image_formats pgm
660

    
661
# ppm (we do not do md5 on image files yet)
662
do_image_formats ppm
663

    
664
# jpeg (we do not do md5 on image files yet)
665
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
666

    
667
####################
668
# audio only
669

    
670
# wav
671
do_audio_only wav
672

    
673
# alaw
674
do_audio_only al
675

    
676
# mulaw
677
do_audio_only ul
678

    
679
# au
680
do_audio_only au
681

    
682
# mmf
683
do_audio_only mmf
684

    
685
# aiff
686
do_audio_only aif
687

    
688
# voc
689
do_audio_only voc
690

    
691
####################
692
# pix_fmt conversions
693
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
694
             yuvj422p yuvj444p rgb24 bgr24 rgb32 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 #  [ -n "$do_libavtest" ]
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