Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ 36aed9e5

History | View | Annotate | Download (17 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_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_rc=y
73
    do_mpeg4adv=y
74
    do_mpeg4thread=y
75
    do_mpeg4nr=y
76
    do_mpeg1b=y
77
    do_asv1=y
78
    do_asv2=y
79
    do_flv=y
80
    do_ffv1=y
81
    do_error=y
82
    do_svq1=y
83
    do_snow=y
84
    do_snowll=y
85
    do_adpcm_yam=y
86
    do_dv=y
87
    do_dv50=y
88
fi
89

    
90

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

    
110
# create the data directory if it does not exists
111
mkdir -p $datadir
112

    
113
FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple"
114

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

    
135
do_ffmpeg_crc()
136
{
137
    f="$1"
138
    shift
139
    echo $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc
140
    $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
141
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
142
    rm -f /tmp/ffmpeg$$
143
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
144
}
145

    
146
do_ffmpeg_nocheck()
147
{
148
    f="$1"
149
    shift
150
    echo $ffmpeg $FFMPEG_OPTS $*
151
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
152
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
153
    rm -f /tmp/ffmpeg$$
154
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
155
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
156
}
157

    
158
do_video_decoding()
159
{
160
    do_ffmpeg $raw_dst -y -i $file -f rawvideo $@ $raw_dst
161
}
162

    
163
do_video_encoding()
164
{
165
    do_ffmpeg $file -y $1 -f pgmyuv -i $raw_src $2 $file
166
}
167

    
168
do_libav()
169
{
170
    file=${outfile}libav.$1
171
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
172
    do_ffmpeg_crc $file -i $file $3
173

    
174
}
175

    
176
do_streamed_images()
177
{
178
    file=${outfile}libav.$1
179
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
180
    do_ffmpeg_crc $file -f image2pipe -i $file
181
}
182

    
183
do_image_formats()
184
{
185
    file=${outfile}libav%02d.$1
186
    $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $2 $3 $file
187
    do_ffmpeg_crc $file $3 -i $file
188

    
189
}
190

    
191
do_audio_only()
192
{
193
    file=${outfile}libav.$1
194
    do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
195
    do_ffmpeg_crc $file -i $file
196
}
197

    
198
echo "ffmpeg regression test" > $logfile
199
echo "ffmpeg benchmarks" > $benchfile
200

    
201
###################################
202
# generate reference for quality check
203
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
204
do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
205

    
206
###################################
207
if [ -n "$do_mpeg" ] ; then
208
# mpeg1 encoding
209
file=${outfile}mpeg1.mpg
210
do_video_encoding "-qscale 10" "-f mpeg1video"
211

    
212
# mpeg1 decoding
213
do_video_decoding
214
fi
215

    
216
###################################
217
if [ -n "$do_mpeg2" ] ; then
218
# mpeg2 encoding
219
file=${outfile}mpeg2.mpg
220
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
221

    
222
# mpeg2 decoding
223
do_video_decoding
224

    
225
# mpeg2 encoding using intra vlc
226
file=${outfile}mpeg2ivlc.mpg
227
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags2 +ivlc"
228

    
229
# mpeg2 decoding
230
do_video_decoding
231

    
232
# mpeg2 encoding
233
file=${outfile}mpeg2.mpg
234
do_video_encoding "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
235

    
236
# mpeg2 decoding
237
do_ffmpeg $raw_dst -y -idct int -i $file -f rawvideo $raw_dst
238

    
239
# mpeg2 encoding interlaced
240
file=${outfile}mpeg2i.mpg
241
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
242

    
243
# mpeg2 decoding
244
do_video_decoding
245
fi
246

    
247
###################################
248
if [ -n "$do_mpeg2thread" ] ; then
249
# mpeg2 encoding interlaced
250
file=${outfile}mpeg2thread.mpg
251
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
252

    
253
# mpeg2 decoding
254
do_video_decoding
255

    
256
# mpeg2 encoding interlaced using intra vlc
257
file=${outfile}mpeg2threadivlc.mpg
258
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
259

    
260
# mpeg2 decoding
261
do_video_decoding
262

    
263
# mpeg2 encoding interlaced
264
file=${outfile}mpeg2reuse.mpg
265
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
266

    
267
# mpeg2 decoding
268
do_video_decoding
269
fi
270

    
271
###################################
272
if [ -n "$do_msmpeg4v2" ] ; then
273
# msmpeg4 encoding
274
file=${outfile}msmpeg4v2.avi
275
do_video_encoding "-qscale 10" "-an -vcodec msmpeg4v2"
276

    
277
# msmpeg4v2 decoding
278
do_video_decoding
279
fi
280

    
281
###################################
282
if [ -n "$do_msmpeg4" ] ; then
283
# msmpeg4 encoding
284
file=${outfile}msmpeg4.avi
285
do_video_encoding "-qscale 10" "-an -vcodec msmpeg4"
286

    
287
# msmpeg4 decoding
288
do_video_decoding
289
fi
290

    
291
###################################
292
if [ -n "$do_wmv1" ] ; then
293
# wmv1 encoding
294
file=${outfile}wmv1.avi
295
do_video_encoding "-qscale 10" "-an -vcodec wmv1"
296

    
297
# wmv1 decoding
298
do_video_decoding
299
fi
300

    
301
###################################
302
if [ -n "$do_wmv2" ] ; then
303
# wmv2 encoding
304
file=${outfile}wmv2.avi
305
do_video_encoding "-qscale 10" "-an -vcodec wmv2"
306

    
307
# wmv2 decoding
308
do_video_decoding
309
fi
310

    
311
###################################
312
if [ -n "$do_h261" ] ; then
313
# h261 encoding
314
file=${outfile}h261.avi
315
do_video_encoding "-qscale 11" "-s 352x288 -an -vcodec h261"
316

    
317
# h261 decoding
318
do_video_decoding
319
fi
320

    
321
###################################
322
if [ -n "$do_h263" ] ; then
323
# h263 encoding
324
file=${outfile}h263.avi
325
do_video_encoding "-qscale 10" "-s 352x288 -an -vcodec h263"
326

    
327
# h263 decoding
328
do_video_decoding
329
fi
330

    
331
###################################
332
if [ -n "$do_h263p" ] ; then
333
# h263p encoding
334
file=${outfile}h263p.avi
335
do_video_encoding "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
336

    
337
# h263p decoding
338
do_video_decoding
339
fi
340

    
341
###################################
342
if [ -n "$do_mpeg4" ] ; then
343
# mpeg4
344
file=${outfile}odivx.mp4
345
do_video_encoding "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
346

    
347
# mpeg4 decoding
348
do_video_decoding
349
fi
350

    
351
###################################
352
if [ -n "$do_huffyuv" ] ; then
353
# huffyuv
354
file=${outfile}huffyuv.avi
355
do_video_encoding "" "-an -vcodec huffyuv -pix_fmt yuv422p"
356

    
357
# huffyuv decoding
358
do_video_decoding -strict -2 -pix_fmt yuv420p
359
fi
360

    
361
###################################
362
if [ -n "$do_rc" ] ; then
363
# mpeg4 rate control
364
file=${outfile}mpeg4-rc.avi
365
do_video_encoding "-b 400k -bf 2" "-an -vcodec mpeg4"
366

    
367
# mpeg4 rate control decoding
368
do_video_decoding
369
fi
370

    
371
###################################
372
if [ -n "$do_mpeg4adv" ] ; then
373
# mpeg4
374
file=${outfile}mpeg4-adv.avi
375
do_video_encoding "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" "-an -vcodec mpeg4"
376

    
377
# mpeg4 decoding
378
do_video_decoding
379
fi
380

    
381
###################################
382
if [ -n "$do_mpeg4thread" ] ; then
383
# mpeg4
384
file=${outfile}mpeg4-thread.avi
385
do_video_encoding "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
386

    
387
# mpeg4 decoding
388
do_video_decoding
389
fi
390

    
391
###################################
392
if [ -n "$do_mpeg4adv" ] ; then
393
# mpeg4
394
file=${outfile}mpeg4-Q.avi
395
do_video_encoding "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
396

    
397
# mpeg4 decoding
398
do_video_decoding
399
fi
400

    
401
###################################
402
if [ -n "$do_mp4psp" ] ; then
403
# mp4 PSP style
404
file=${outfile}mpeg4-PSP.mp4
405
do_ffmpeg $file -y -b 768k -s 320x240 -f psp -ar 24000 -ab 32 -i $raw_src $file
406
fi
407

    
408
###################################
409
if [ -n "$do_error" ] ; then
410
# damaged mpeg4
411
file=${outfile}error-mpeg4-adv.avi
412
do_video_encoding "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
413

    
414
# damaged mpeg4 decoding
415
do_video_decoding
416
fi
417

    
418
###################################
419
if [ -n "$do_mpeg4nr" ] ; then
420
# noise reduction
421
file=${outfile}mpeg4-nr.avi
422
do_video_encoding "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
423

    
424
# mpeg4 decoding
425
do_video_decoding
426
fi
427

    
428
###################################
429
if [ -n "$do_mpeg1b" ] ; then
430
# mpeg1
431
file=${outfile}mpeg1b.mpg
432
do_video_encoding "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
433

    
434
# mpeg1 decoding
435
do_video_decoding
436
fi
437

    
438
###################################
439
if [ -n "$do_mjpeg" ] ; then
440
# mjpeg
441
file=${outfile}mjpeg.avi
442
do_video_encoding "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
443

    
444
# mjpeg decoding
445
do_video_decoding -pix_fmt yuv420p
446
fi
447

    
448
###################################
449
if [ -n "$do_ljpeg" ] ; then
450
# ljpeg
451
file=${outfile}ljpeg.avi
452
do_video_encoding "" "-an -vcodec ljpeg -strict -1"
453

    
454
# ljpeg decoding
455
do_video_decoding
456
fi
457

    
458
###################################
459
if [ -n "$do_jpegls" ] ; then
460
# jpeg ls
461
file=${outfile}jpegls.avi
462
do_video_encoding "" "-an -vcodec jpegls -vtag MJPG"
463

    
464
# jpeg ls decoding
465
do_video_decoding -pix_fmt yuv420p
466
fi
467

    
468
###################################
469
if [ -n "$do_rv10" ] ; then
470
# rv10 encoding
471
file=${outfile}rv10.rm
472
do_video_encoding "-qscale 10" "-an"
473

    
474
# rv10 decoding
475
do_video_decoding
476
fi
477

    
478
###################################
479
if [ -n "$do_rv20" ] ; then
480
# rv20 encoding
481
file=${outfile}rv20.rm
482
do_video_encoding "-qscale 10" "-vcodec rv20 -an"
483

    
484
# rv20 decoding
485
do_video_decoding
486
fi
487

    
488
###################################
489
if [ -n "$do_asv1" ] ; then
490
# asv1 encoding
491
file=${outfile}asv1.avi
492
do_video_encoding "-qscale 10" "-an -vcodec asv1"
493

    
494
# asv1 decoding
495
do_video_decoding
496
fi
497

    
498
###################################
499
if [ -n "$do_asv2" ] ; then
500
# asv2 encoding
501
file=${outfile}asv2.avi
502
do_video_encoding "-qscale 10" "-an -vcodec asv2"
503

    
504
# asv2 decoding
505
do_video_decoding
506
fi
507

    
508
###################################
509
if [ -n "$do_flv" ] ; then
510
# flv encoding
511
file=${outfile}flv.flv
512
do_video_encoding "-qscale 10" "-an -vcodec flv"
513

    
514
# flv decoding
515
do_video_decoding
516
fi
517

    
518
###################################
519
if [ -n "$do_ffv1" ] ; then
520
# ffv1 encoding
521
file=${outfile}ffv1.avi
522
do_video_encoding "-strict -2" "-an -vcodec ffv1"
523

    
524
# ffv1 decoding
525
do_video_decoding
526
fi
527

    
528
###################################
529
if [ -n "$do_snow" ] ; then
530
# snow encoding
531
file=${outfile}snow.avi
532
do_video_encoding "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
533

    
534
# snow decoding
535
do_video_decoding -s 352x288
536
fi
537

    
538
###################################
539
if [ -n "$do_snowll" ] ; then
540
# snow encoding
541
file=${outfile}snow53.avi
542
do_video_encoding "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
543

    
544
# snow decoding
545
do_video_decoding
546
fi
547

    
548
###################################
549
if [ -n "$do_dv" ] ; then
550
# dv encoding
551
file=${outfile}dv.dv
552
do_video_encoding "-dct int" "-s pal -an"
553

    
554
# dv decoding
555
do_video_decoding -s cif
556
fi
557

    
558
###################################
559
if [ -n "$do_dv50" ] ; then
560
# dv50 encoding
561
file=${outfile}dv.dv
562
do_video_encoding "-dct int" "-s pal -pix_fmt yuv422p -an"
563

    
564
# dv50 decoding
565
do_video_decoding -s cif -pix_fmt yuv420p
566
fi
567

    
568

    
569
###################################
570
if [ -n "$do_svq1" ] ; then
571
# svq1 encoding
572
file=${outfile}svq1.mov
573
do_video_encoding "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
574

    
575
# svq1 decoding
576
do_video_decoding -pix_fmt yuv420p
577
fi
578

    
579
###################################
580
if [ -n "$do_mp2" ] ; then
581
# mp2 encoding
582
file=${outfile}mp2.mp2
583
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
584

    
585
# mp2 decoding
586
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
587
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
588
fi
589

    
590
###################################
591
if [ -n "$do_ac3" ] ; then
592
# ac3 encoding
593
file=${outfile}ac3.rm
594
do_ffmpeg $file -y -ab 128 -ac 2 -f s16le  -i $pcm_src -vn $file
595

    
596
# ac3 decoding
597
#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
598
fi
599

    
600
###################################
601
if [ -n "$do_g726" ] ; then
602
# g726 encoding
603
file=${outfile}g726.wav
604
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
605

    
606
# g726 decoding
607
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
608
fi
609

    
610
###################################
611
if [ -n "$do_adpcm_ima_wav" ] ; then
612
# encoding
613
file=${outfile}adpcm_ima.wav
614
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
615

    
616
# decoding
617
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
618
fi
619

    
620
###################################
621
if [ -n "$do_adpcm_ms" ] ; then
622
# encoding
623
file=${outfile}adpcm_ms.wav
624
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
625

    
626
# decoding
627
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
628
fi
629

    
630
###################################
631
if [ -n "$do_adpcm_yam" ] ; then
632
# encoding
633
file=${outfile}adpcm_yam.wav
634
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
635

    
636
# decoding
637
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
638
fi
639

    
640
###################################
641
if [ -n "$do_flac" ] ; then
642
# encoding
643
file=${outfile}flac.flac
644
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec flac -compression_level 2 $file
645

    
646
# decoding
647
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
648
fi
649

    
650
###################################
651
# libav testing
652
###################################
653

    
654
if [ -n "$do_libav" ] ; then
655

    
656
# avi
657
do_libav avi
658

    
659
# asf
660
do_libav asf "-acodec mp2" "-r 25"
661

    
662
# rm
663
file=${outfile}libav.rm
664
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
665
# broken
666
#do_ffmpeg_crc $file -i $file
667

    
668
# mpegps
669
do_libav mpg
670

    
671
# mpegts
672
do_libav ts
673

    
674
# swf (decode audio only)
675
do_libav swf "-acodec mp2"
676

    
677
# ffm
678
do_libav ffm
679

    
680
# flv
681
do_libav flv -an
682

    
683
# mov
684
do_libav mov "-acodec pcm_alaw"
685

    
686
# nut
687
#do_libav nut "-acodec mp2"
688

    
689
# dv
690
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
691

    
692
# gxf
693
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
694

    
695
####################
696
# streamed images
697
# mjpeg
698
#file=${outfile}libav.mjpeg
699
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
700
#do_ffmpeg_crc $file -i $file
701

    
702
# pbmpipe
703
do_streamed_images pbm
704

    
705
# pgmpipe
706
do_streamed_images pgm
707

    
708
# ppmpipe
709
do_streamed_images ppm
710

    
711
# gif
712
file=${outfile}libav.gif
713
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
714
#do_ffmpeg_crc $file -i $file
715

    
716
# yuv4mpeg
717
file=${outfile}libav.y4m
718
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
719
#do_ffmpeg_crc $file -i $file
720

    
721
####################
722
# image formats
723
# pgm (we do not do md5 on image files yet)
724
do_image_formats pgm
725

    
726
# ppm (we do not do md5 on image files yet)
727
do_image_formats ppm
728

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

    
732
####################
733
# audio only
734

    
735
# wav
736
do_audio_only wav
737

    
738
# alaw
739
do_audio_only al
740

    
741
# mulaw
742
do_audio_only ul
743

    
744
# au
745
do_audio_only au
746

    
747
# mmf
748
do_audio_only mmf
749

    
750
# aiff
751
do_audio_only aif
752

    
753
# voc
754
do_audio_only voc
755

    
756
####################
757
# pix_fmt conversions
758
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
759
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
760
             monob pal8"
761
for pix_fmt in $conversions ; do
762
    file=${outfile}libav-${pix_fmt}.yuv
763
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
764
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
765
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
766
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
767
done
768

    
769
fi
770

    
771

    
772

    
773
if $diff_cmd "$logfile" "$reffile" ; then
774
    echo
775
    echo Regression test succeeded.
776
    exit 0
777
else
778
    echo
779
    echo Regression test: Error.
780
    exit 1
781
fi