Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ ca6ecf50

History | View | Annotate | Download (16.2 KB)

1 51133a7d Fabrice Bellard
#!/bin/sh
2
#
3
# automatic regression test for ffmpeg
4
#
5
#
6
#set -x
7 6e023978 Roman Shaposhnik
# 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 d9d7653e Michael Niedermayer
diff -w $0 $0 > /dev/null 2>&1
16
if [ $? -eq 0 ]; then
17
  diff_cmd="$diff_cmd -w"
18
fi
19
20 51133a7d Fabrice Bellard
set -e
21
22 5bcfd1ad Fabrice Bellard
datadir="./data"
23
24
logfile="$datadir/ffmpeg.regression"
25 a12eea30 Fabrice Bellard
outfile="$datadir/a-"
26 89d5dfd5 Fabrice Bellard
27 51133a7d Fabrice Bellard
# tests to do
28
if [ "$1" = "mpeg4" ] ; then
29
    do_mpeg4=y
30
elif [ "$1" = "mpeg" ] ; then
31
    do_mpeg=y
32 853d659d John Dalgliesh
    do_mpeg2=y
33 7481e919 Fabrice Bellard
elif [ "$1" = "ac3" ] ; then
34
    do_ac3=y
35 89d5dfd5 Fabrice Bellard
elif [ "$1" = "libavtest" ] ; then
36
    do_libav=y
37 5bcfd1ad Fabrice Bellard
    logfile="$datadir/libav.regression"
38 a12eea30 Fabrice Bellard
    outfile="$datadir/b-"
39 51133a7d Fabrice Bellard
else
40
    do_mpeg=y
41 922bc38d Michael Niedermayer
    do_mpeg2=y
42 9c3d33d6 Michael Niedermayer
    do_mpeg2thread=y
43 6ebd933b Michael Niedermayer
    do_msmpeg4v2=y
44 51133a7d Fabrice Bellard
    do_msmpeg4=y
45 6ebd933b Michael Niedermayer
    do_wmv1=y
46 e23d5712 Michael Niedermayer
    do_wmv2=y
47 51133a7d Fabrice Bellard
    do_h263=y
48 6e2d5f1a Michael Niedermayer
    do_h263p=y
49 51133a7d Fabrice Bellard
    do_mpeg4=y
50 e23d5712 Michael Niedermayer
    do_huffyuv=y
51 51133a7d Fabrice Bellard
    do_mjpeg=y
52 3b37408b Michael Niedermayer
    do_ljpeg=y
53 64a7a8af Michael Niedermayer
    do_rv10=y
54 51133a7d Fabrice Bellard
    do_mp2=y
55
    do_ac3=y
56 311be1fb Michael Niedermayer
    do_g726=y
57 f02ab814 Michael Niedermayer
    do_adpcm_ima_wav=y
58
    do_adpcm_ms=y
59 1dbb6d90 Michael Niedermayer
    do_rc=y
60
    do_mpeg4adv=y
61 9c3d33d6 Michael Niedermayer
    do_mpeg4thread=y
62 be408b67 Michael Niedermayer
    do_mpeg4nr=y
63 cfadadec Michael Niedermayer
    do_mpeg1b=y
64 9ca9fce1 Michael Niedermayer
    do_asv1=y
65 8d876a43 Michael Niedermayer
    do_asv2=y
66 bbdd42d3 Michael Niedermayer
    do_flv=y
67 f3203047 Michael Niedermayer
    do_ffv1=y
68 7ebfc0ea Michael Niedermayer
    do_error=y
69 b86bd1f1 Michael Niedermayer
    do_svq1=y
70 51133a7d Fabrice Bellard
fi
71
72
73
# various files
74 3aca208a Mark Hills
ffmpeg="../ffmpeg_g"
75 67cbe681 Michael Niedermayer
tiny_psnr="./tiny_psnr"
76 51133a7d Fabrice Bellard
reffile="$2"
77 5bcfd1ad Fabrice Bellard
benchfile="$datadir/ffmpeg.bench"
78 6afd3b92 Michael Niedermayer
raw_src="$3/%d.pgm"
79 5bcfd1ad Fabrice Bellard
raw_dst="$datadir/out.yuv"
80 67cbe681 Michael Niedermayer
raw_ref="$datadir/ref.yuv"
81 51133a7d Fabrice Bellard
pcm_src="asynth1.sw"
82 5bcfd1ad Fabrice Bellard
pcm_dst="$datadir/out.wav"
83 853d659d John Dalgliesh
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
84
    do_md5sum() { md5sum -b $1; }
85
elif [ -x /sbin/md5 ]; then
86
    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
87
else
88
    do_md5sum() { echo No md5sum program found; }
89
fi
90 5bcfd1ad Fabrice Bellard
91
# create the data directory if it does not exists
92
mkdir -p $datadir
93 51133a7d Fabrice Bellard
94 3f027ca7 Felix B√ľnemann
do_ffmpeg()
95 51133a7d Fabrice Bellard
{
96
    f="$1"
97
    shift
98 affd55a1 Roman Shaposhnik
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
99
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
100 19a11db2 Fabrice Bellard
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration)" /tmp/ffmpeg$$ || true
101 e31c1c30 Philip Gladstone
    rm -f /tmp/ffmpeg$$
102 853d659d John Dalgliesh
    do_md5sum $f >> $logfile
103 67cbe681 Michael Niedermayer
    if [ $f = $raw_dst ] ; then
104
        $tiny_psnr $f $raw_ref >> $logfile
105 039e7889 Michael Niedermayer
    else
106
        wc -c $f >> $logfile
107 67cbe681 Michael Niedermayer
    fi
108 90cee0c3 Michael Niedermayer
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
109 5bcfd1ad Fabrice Bellard
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
110 51133a7d Fabrice Bellard
}
111
112 3f027ca7 Felix B√ľnemann
do_ffmpeg_crc()
113 89d5dfd5 Fabrice Bellard
{
114
    f="$1"
115
    shift
116 2ad1516a Michael Niedermayer
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
117 affd55a1 Roman Shaposhnik
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
118 19a11db2 Fabrice Bellard
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration)" /tmp/ffmpeg$$ || true
119 affd55a1 Roman Shaposhnik
    rm -f /tmp/ffmpeg$$ 
120
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
121 89d5dfd5 Fabrice Bellard
}
122 51133a7d Fabrice Bellard
123 67cbe681 Michael Niedermayer
do_ffmpeg_nocheck()
124
{
125
    f="$1"
126
    shift
127 affd55a1 Roman Shaposhnik
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
128
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
129 19a11db2 Fabrice Bellard
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration)" /tmp/ffmpeg$$ || true
130 affd55a1 Roman Shaposhnik
    rm -f /tmp/ffmpeg$$
131 67cbe681 Michael Niedermayer
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
132
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
133
}
134
135 51133a7d Fabrice Bellard
echo "ffmpeg regression test" > $logfile
136
echo "ffmpeg benchmarks" > $benchfile
137
138
###################################
139 67cbe681 Michael Niedermayer
# generate reference for quality check
140
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
141
142
###################################
143 51133a7d Fabrice Bellard
if [ -n "$do_mpeg" ] ; then
144
# mpeg1 encoding
145
file=${outfile}mpeg1.mpg
146 89d5dfd5 Fabrice Bellard
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file 
147 51133a7d Fabrice Bellard
148
# mpeg1 decoding
149 89d5dfd5 Fabrice Bellard
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
150 922bc38d Michael Niedermayer
fi
151
152
###################################
153
if [ -n "$do_mpeg2" ] ; then
154
# mpeg2 encoding
155 83dddc4a Fabrice Bellard
file=${outfile}mpeg2.mpg
156
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file 
157
158
# mpeg2 decoding
159
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
160
161 6486ad57 Michael Niedermayer
# mpeg2 encoding
162
file=${outfile}mpeg2.mpg
163
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct_algo 1 -dct_algo 2 -f mpeg1video $file 
164
165
# mpeg2 decoding
166
do_ffmpeg $raw_dst -y -idct_algo 1 -i $file -f rawvideo $raw_dst
167
168 83dddc4a Fabrice Bellard
# mpeg2 encoding interlaced
169
file=${outfile}mpeg2i.mpg
170 69768b77 Michael Niedermayer
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -ildct -ilme $file 
171 51133a7d Fabrice Bellard
172
# mpeg2 decoding
173 922bc38d Michael Niedermayer
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
174 51133a7d Fabrice Bellard
fi
175
176
###################################
177 9c3d33d6 Michael Niedermayer
if [ -n "$do_mpeg2thread" ] ; then
178
# mpeg2 encoding interlaced
179
file=${outfile}mpeg2thread.mpg
180
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -ildct -ilme -threads 2 $file 
181
182
# mpeg2 decoding
183
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
184
fi
185
186
###################################
187 6ebd933b Michael Niedermayer
if [ -n "$do_msmpeg4v2" ] ; then
188
# msmpeg4 encoding
189
file=${outfile}msmpeg4v2.avi
190
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
191
192
# msmpeg4v2 decoding
193
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
194
fi
195
196
###################################
197 51133a7d Fabrice Bellard
if [ -n "$do_msmpeg4" ] ; then
198
# msmpeg4 encoding
199
file=${outfile}msmpeg4.avi
200
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
201
202
# msmpeg4 decoding
203
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
204
fi
205
206
###################################
207 6ebd933b Michael Niedermayer
if [ -n "$do_wmv1" ] ; then
208
# wmv1 encoding
209
file=${outfile}wmv1.avi
210
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
211
212
# wmv1 decoding
213
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
214
fi
215
216
###################################
217 e23d5712 Michael Niedermayer
if [ -n "$do_wmv2" ] ; then
218
# wmv2 encoding
219
file=${outfile}wmv2.avi
220
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
221
222
# wmv2 decoding
223
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
224
fi
225
226
###################################
227 51133a7d Fabrice Bellard
if [ -n "$do_h263" ] ; then
228
# h263 encoding
229
file=${outfile}h263.avi
230
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
231
232 6e2d5f1a Michael Niedermayer
# h263 decoding
233
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
234
fi
235
236
###################################
237
if [ -n "$do_h263p" ] ; then
238
# h263p encoding
239
file=${outfile}h263p.avi
240 d7d24282 Michael Niedermayer
do_ffmpeg $file -y -qscale 2 -umv -aiv -aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
241 6e2d5f1a Michael Niedermayer
242 51133a7d Fabrice Bellard
# h263p decoding
243
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
244
fi
245
246
###################################
247
if [ -n "$do_mpeg4" ] ; then
248
# mpeg4
249 28c70622 Michael Niedermayer
file=${outfile}odivx.mp4
250 d3985de7 Michael Niedermayer
do_ffmpeg $file -y -4mv -hq -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
251 51133a7d Fabrice Bellard
252
# mpeg4 decoding
253
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
254
fi
255
256
###################################
257 e629ab68 Romain Dolbeau
if [ -n "$do_huffyuv" ] ; then
258
# huffyuv
259
file=${outfile}huffyuv.avi
260
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec huffyuv -strict -1 $file
261
262
# huffyuv decoding
263
do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
264
fi
265
266
###################################
267 1dbb6d90 Michael Niedermayer
if [ -n "$do_rc" ] ; then
268
# mpeg4 rate control
269
file=${outfile}mpeg4-rc.avi
270
do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
271
272
# mpeg4 rate control decoding
273
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
274
fi
275
276
###################################
277
if [ -n "$do_mpeg4adv" ] ; then
278
# mpeg4
279
file=${outfile}mpeg4-adv.avi
280 c0baa56a Michael Niedermayer
do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 200 -aic -trell -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
281 1dbb6d90 Michael Niedermayer
282
# mpeg4 decoding
283
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
284
fi
285
286
###################################
287 9c3d33d6 Michael Niedermayer
if [ -n "$do_mpeg4thread" ] ; then
288
# mpeg4
289
file=${outfile}mpeg4-thread.avi
290
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
291
292
# mpeg4 decoding
293
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
294 aab9cdcf Michael Niedermayer
fi
295
296
###################################
297
if [ -n "$do_mpeg4adv" ] ; then
298
# mpeg4
299
file=${outfile}mpeg4-Q.avi
300
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
301
302
# mpeg4 decoding
303
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
304 9c3d33d6 Michael Niedermayer
fi
305
306
###################################
307 7ebfc0ea Michael Niedermayer
if [ -n "$do_error" ] ; then
308
# damaged mpeg4
309
file=${outfile}error-mpeg4-adv.avi
310
do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -part -ps 250 -error 10 -aic -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
311
312
# damaged mpeg4 decoding
313
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
314
fi
315
316
###################################
317 be408b67 Michael Niedermayer
if [ -n "$do_mpeg4nr" ] ; then
318
# noise reduction
319 9c3d33d6 Michael Niedermayer
file=${outfile}mpeg4-nr.avi
320 be408b67 Michael Niedermayer
do_ffmpeg $file -y -qscale 8 -4mv -mbd 2 -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
321
322
# mpeg4 decoding
323
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
324
fi
325
326
###################################
327 cfadadec Michael Niedermayer
if [ -n "$do_mpeg1b" ] ; then
328
# mpeg1
329
file=${outfile}mpeg1b.mpg
330 83dddc4a Fabrice Bellard
do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
331 cfadadec Michael Niedermayer
332
# mpeg1 decoding
333
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
334
fi
335
336
###################################
337 51133a7d Fabrice Bellard
if [ -n "$do_mjpeg" ] ; then
338
# mjpeg
339
file=${outfile}mjpeg.avi
340
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg $file
341
342
# mjpeg decoding
343
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
344
fi
345
346
###################################
347 3b37408b Michael Niedermayer
if [ -n "$do_ljpeg" ] ; then
348
# ljpeg
349
file=${outfile}ljpeg.avi
350
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg $file
351
352
# ljpeg decoding
353
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
354
fi
355
356
###################################
357 51133a7d Fabrice Bellard
if [ -n "$do_rv10" ] ; then
358
# rv10 encoding
359
file=${outfile}rv10.rm
360
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file 
361
362
# rv10 decoding
363
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
364
fi
365
366
###################################
367 9ca9fce1 Michael Niedermayer
if [ -n "$do_asv1" ] ; then
368
# asv1 encoding
369
file=${outfile}asv1.avi
370
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
371
372
# asv1 decoding
373
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
374
fi
375
376
###################################
377 8d876a43 Michael Niedermayer
if [ -n "$do_asv2" ] ; then
378
# asv2 encoding
379
file=${outfile}asv2.avi
380
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
381
382
# asv2 decoding
383
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
384
fi
385
386
###################################
387 bbdd42d3 Michael Niedermayer
if [ -n "$do_flv" ] ; then
388
# flv encoding
389
file=${outfile}flv.flv
390
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
391
392
# flv decoding
393
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
394
fi
395
396
###################################
397 f3203047 Michael Niedermayer
if [ -n "$do_ffv1" ] ; then
398
# ffv1 encoding
399
file=${outfile}ffv1.avi
400
do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
401
402
# ffv1 decoding
403
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
404
fi
405
406
###################################
407 b86bd1f1 Michael Niedermayer
if [ -n "$do_svq1" ] ; then
408
# svq1 encoding
409
file=${outfile}svq1.mov
410
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -pix_fmt yuv410p $file
411
412
# svq1 decoding
413
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
414
fi
415
416
###################################
417 51133a7d Fabrice Bellard
if [ -n "$do_mp2" ] ; then
418
# mp2 encoding
419
file=${outfile}mp2.mp2
420
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file 
421
422
# mp2 decoding
423
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
424
fi
425
426
###################################
427
if [ -n "$do_ac3" ] ; then
428
# ac3 encoding
429
file=${outfile}ac3.rm
430
do_ffmpeg $file -y -ab 128 -ac 2 -f s16le  -i $pcm_src -vn $file 
431
432
# ac3 decoding
433 3c300082 Michael Niedermayer
#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
434 51133a7d Fabrice Bellard
fi
435
436 89d5dfd5 Fabrice Bellard
###################################
437 311be1fb Michael Niedermayer
if [ -n "$do_g726" ] ; then
438
# g726 encoding
439
file=${outfile}g726.wav
440
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file 
441
442
# g726 decoding
443
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
444
fi
445
446
###################################
447 f02ab814 Michael Niedermayer
if [ -n "$do_adpcm_ima_wav" ] ; then
448
# encoding
449
file=${outfile}adpcm_ima.wav
450
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file 
451
452
# decoding
453
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
454
fi
455
456
###################################
457
if [ -n "$do_adpcm_ms" ] ; then
458
# encoding
459
file=${outfile}adpcm_ms.wav
460
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file 
461
462
# decoding
463
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
464
fi
465
466
###################################
467 89d5dfd5 Fabrice Bellard
# libav testing
468
###################################
469
470
if [ -n "$do_libav" ] ; then
471
472
# avi
473
file=${outfile}libav.avi
474
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
475
do_ffmpeg_crc $file -i $file
476
477
# asf
478
file=${outfile}libav.asf
479 ba30abcb Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
480 e928649b Michael Niedermayer
do_ffmpeg_crc $file -i $file -r 25
481 89d5dfd5 Fabrice Bellard
482
# rm
483
file=${outfile}libav.rm
484
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
485
# broken
486
#do_ffmpeg_crc $file -i $file
487
488
# mpegps
489
file=${outfile}libav.mpg
490
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
491
do_ffmpeg_crc $file -i $file
492
493
# swf (decode audio only)
494
file=${outfile}libav.swf
495 2dd59ebd Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
496 d0c30ca5 Fabrice Bellard
do_ffmpeg_crc $file -i $file
497 89d5dfd5 Fabrice Bellard
498
# ffm
499 74d69c07 Michael Niedermayer
file=${outfile}libav.ffm
500
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
501
do_ffmpeg_crc $file -i $file
502 89d5dfd5 Fabrice Bellard
503 bbdd42d3 Michael Niedermayer
# flv
504
file=${outfile}libav.flv
505 ba30abcb Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
506 bbdd42d3 Michael Niedermayer
do_ffmpeg_crc $file -i $file
507
508 c280f2d7 Michael Niedermayer
# mov
509 2dd59ebd Michael Niedermayer
file=${outfile}libav.mov
510
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
511
do_ffmpeg_crc $file -i $file
512 c280f2d7 Michael Niedermayer
513
# nut
514
file=${outfile}libav.nut
515 ba30abcb Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
516 c280f2d7 Michael Niedermayer
do_ffmpeg_crc $file -i $file
517
518 a811de6e Michael Niedermayer
# dv
519 ca6ecf50 Michael Niedermayer
#file=${outfile}libav.dv
520
#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
521
#do_ffmpeg_crc $file -i $file
522 a811de6e Michael Niedermayer
523 c280f2d7 Michael Niedermayer
# XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)
524 89d5dfd5 Fabrice Bellard
525
####################
526
# streamed images
527
# mjpeg
528 affd55a1 Roman Shaposhnik
#file=${outfile}libav.mjpeg
529
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
530
#do_ffmpeg_crc $file -i $file
531 89d5dfd5 Fabrice Bellard
532 7481e919 Fabrice Bellard
# pbmpipe
533
file=${outfile}libav.pbm
534
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
535
do_ffmpeg_crc $file -f imagepipe -i $file
536
537 89d5dfd5 Fabrice Bellard
# pgmpipe
538 7481e919 Fabrice Bellard
file=${outfile}libav.pgm
539
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
540
do_ffmpeg_crc $file -f imagepipe -i $file
541 89d5dfd5 Fabrice Bellard
542
# ppmpipe
543 7481e919 Fabrice Bellard
file=${outfile}libav.ppm
544
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f imagepipe $file
545
do_ffmpeg_crc $file -f imagepipe -i $file
546 89d5dfd5 Fabrice Bellard
547
# gif
548
file=${outfile}libav.gif
549 7481e919 Fabrice Bellard
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
550
#do_ffmpeg_crc $file -i $file
551
552
# yuv4mpeg
553
file=${outfile}libav.yuv4mpeg
554
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
555
#do_ffmpeg_crc $file -i $file
556 89d5dfd5 Fabrice Bellard
557
####################
558
# image formats
559
# pgm (we do not do md5 on image files yet)
560
file=${outfile}libav%d.pgm
561
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
562
do_ffmpeg_crc $file -i $file
563
564
# ppm (we do not do md5 on image files yet)
565
file=${outfile}libav%d.ppm
566
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
567
do_ffmpeg_crc $file -i $file
568
569 d0c30ca5 Fabrice Bellard
# jpeg (we do not do md5 on image files yet)
570 affd55a1 Roman Shaposhnik
#file=${outfile}libav%d.jpg
571
#$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
572
#do_ffmpeg_crc $file -i $file
573 d0c30ca5 Fabrice Bellard
574 89d5dfd5 Fabrice Bellard
####################
575
# audio only
576
577
# wav
578
file=${outfile}libav.wav
579
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
580
do_ffmpeg_crc $file -i $file
581
582
# alaw
583
file=${outfile}libav.al
584
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
585
do_ffmpeg_crc $file -i $file
586
587
# mulaw
588
file=${outfile}libav.ul
589
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
590
do_ffmpeg_crc $file -i $file
591
592
# au
593
file=${outfile}libav.au
594
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
595
do_ffmpeg_crc $file -i $file
596
597 affd55a1 Roman Shaposhnik
####################
598
# pix_fmt conversions
599
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
600
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
601
	     monob pal8"
602
for pix_fmt in $conversions ; do
603
    file=${outfile}libav-${pix_fmt}.yuv
604
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
605
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
606
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
607
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
608
done
609
610 89d5dfd5 Fabrice Bellard
fi
611
612
613 51133a7d Fabrice Bellard
614 6e023978 Roman Shaposhnik
if $diff_cmd $logfile $reffile ; then
615 51133a7d Fabrice Bellard
    echo 
616
    echo Regression test succeeded.
617
    exit 0
618
else
619
    echo 
620
    echo Regression test: Error.
621
    exit 1
622
fi