Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ d2f8f410

History | View | Annotate | Download (17.2 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="./tests/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
    do_flashsv=y
91
fi
92

    
93

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

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

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

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

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

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

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

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

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

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

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

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

    
210
}
211

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

    
219
do_image_formats()
220
{
221
    file=${outfile}libav%02d.$1
222
    $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $2 $3 -flags +bitexact $file
223
    do_ffmpeg_crc $file $3 -i $file
224
    do_md5sum ${outfile}libav02.$1 >> $logfile
225
}
226

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

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

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

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

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

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

    
258
# mpeg2 decoding
259
do_video_decoding
260

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

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

    
268
# mpeg2 decoding
269
do_video_decoding
270
fi
271

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

    
277
# mpeg2 decoding
278
do_video_decoding
279

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

    
283
# mpeg2 decoding
284
do_video_decoding
285

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

    
290
# mpeg2 decoding
291
do_video_decoding
292
fi
293

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

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

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

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

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

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

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

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

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

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

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

    
370
# mpeg4
371
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"
372
do_video_decoding
373

    
374
# mpeg4
375
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"
376
do_video_decoding
377

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

    
383
###################################
384
if [ -n "$do_mpeg4thread" ] ; then
385
# mpeg4
386
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"
387
do_video_decoding
388
fi
389

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

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

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

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

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

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

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

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

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

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

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

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

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

    
480
###################################
481
if [ -n "$do_snow" ] ; then
482
# snow
483
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"
484
do_video_decoding "" "-s 352x288"
485
fi
486

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

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

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

    
508

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

    
516
###################################
517
if [ -n "$do_flashsv" ] ; then
518
# svq1
519
do_video_encoding flashsv.flv "" pgmyuv "-an -vcodec flashsv "
520
do_video_decoding "" "-pix_fmt yuv420p"
521
fi
522

    
523
###################################
524
if [ -n "$do_mp2" ] ; then
525
# mp2
526
do_audio_encoding mp2.mp2 "-ar 44100"
527
do_audio_decoding
528
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
529
fi
530

    
531
###################################
532
if [ -n "$do_ac3" ] ; then
533
# ac3
534
do_audio_encoding ac3.rm "" -vn
535
#do_audio_decoding
536
fi
537

    
538
###################################
539
if [ -n "$do_g726" ] ; then
540
# g726
541
do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
542
do_audio_decoding
543
fi
544

    
545
###################################
546
if [ -n "$do_adpcm_ima_wav" ] ; then
547
# adpcm ima
548
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
549
do_audio_decoding
550
fi
551

    
552
###################################
553
if [ -n "$do_adpcm_ms" ] ; then
554
# adpcm ms
555
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
556
do_audio_decoding
557
fi
558

    
559
###################################
560
if [ -n "$do_adpcm_yam" ] ; then
561
# adpcm yamaha
562
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
563
do_audio_decoding
564
fi
565

    
566
###################################
567
if [ -n "$do_flac" ] ; then
568
# flac
569
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
570
do_audio_decoding
571
fi
572

    
573
###################################
574
if [ -n "$do_wma" ] ; then
575
# wmav1
576
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
577
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
578
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
579
# wmav2
580
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
581
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
582
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
583
fi
584

    
585
###################################
586
#if [ -n "$do_vorbis" ] ; then
587
# vorbis
588
#disabled because it is broken
589
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
590
#do_audio_decoding
591
#fi
592

    
593
###################################
594
# libavformat testing
595
###################################
596

    
597
if [ -n "$do_libavtest" ] ; then
598

    
599
# avi
600
do_libav avi
601

    
602
# asf
603
do_libav asf "-acodec mp2" "-r 25"
604

    
605
# rm
606
file=${outfile}libav.rm
607
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
608
# broken
609
#do_ffmpeg_crc $file -i $file
610

    
611
# mpegps
612
do_libav mpg
613

    
614
# mpegts
615
do_libav ts
616

    
617
# swf
618
do_libav swf -an
619

    
620
# ffm
621
do_libav ffm
622

    
623
# flv
624
do_libav flv -an
625

    
626
# mov
627
do_libav mov "-acodec pcm_alaw"
628

    
629
# nut
630
#do_libav nut "-acodec mp2"
631

    
632
# dv
633
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
634

    
635
# gxf
636
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
637

    
638
####################
639
# streamed images
640
# mjpeg
641
#file=${outfile}libav.mjpeg
642
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
643
#do_ffmpeg_crc $file -i $file
644

    
645
# pbmpipe
646
do_streamed_images pbm
647

    
648
# pgmpipe
649
do_streamed_images pgm
650

    
651
# ppmpipe
652
do_streamed_images ppm
653

    
654
# gif
655
file=${outfile}libav.gif
656
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
657
#do_ffmpeg_crc $file -i $file
658

    
659
# yuv4mpeg
660
file=${outfile}libav.y4m
661
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
662
#do_ffmpeg_crc $file -i $file
663

    
664
####################
665
# image formats
666
# pgm
667
do_image_formats pgm
668

    
669
# ppm
670
do_image_formats ppm
671

    
672
# bmp
673
do_image_formats bmp
674

    
675
# tga
676
do_image_formats tga
677

    
678
# tiff
679
do_image_formats tiff "-pix_fmt rgb24"
680

    
681
# sgi
682
do_image_formats sgi
683

    
684
# jpeg
685
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
686

    
687
####################
688
# audio only
689

    
690
# wav
691
do_audio_only wav
692

    
693
# alaw
694
do_audio_only al
695

    
696
# mulaw
697
do_audio_only ul
698

    
699
# au
700
do_audio_only au
701

    
702
# mmf
703
do_audio_only mmf
704

    
705
# aiff
706
do_audio_only aif
707

    
708
# voc
709
do_audio_only voc
710

    
711
####################
712
# pix_fmt conversions
713
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
714
             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
715
             monob pal8 yuv440p yuvj440p"
716
for pix_fmt in $conversions ; do
717
    file=${outfile}libav-${pix_fmt}.yuv
718
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
719
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
720
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
721
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
722
done
723

    
724
fi #  [ -n "$do_libavtest" ]
725

    
726

    
727

    
728
if $diff_cmd "$logfile" "$reffile" ; then
729
    echo
730
    echo Regression test succeeded.
731
    exit 0
732
else
733
    echo
734
    echo Regression test: Error.
735
    exit 1
736
fi