Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ dc032f33

History | View | Annotate | Download (17.5 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 281a74da Michael Niedermayer
diff -u "$0" "$0" > /dev/null 2>&1
9 6e023978 Roman Shaposhnik
if [ $? -eq 0 ]; then
10
  diff_cmd="diff -u"
11
else
12
  diff_cmd="diff"
13
fi
14
15 281a74da Michael Niedermayer
diff -w "$0" "$0" > /dev/null 2>&1
16 d9d7653e Michael Niedermayer
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 87c5fbc3 Michael Niedermayer
elif [ "$1" = "huffyuv" ] ; then
36
    do_huffyuv=y
37 7f8038ce Michael Niedermayer
elif [ "$1" = "mpeg2thread" ] ; then
38
    do_mpeg2thread=y
39 89d5dfd5 Fabrice Bellard
elif [ "$1" = "libavtest" ] ; then
40
    do_libav=y
41 5bcfd1ad Fabrice Bellard
    logfile="$datadir/libav.regression"
42 a12eea30 Fabrice Bellard
    outfile="$datadir/b-"
43 51133a7d Fabrice Bellard
else
44
    do_mpeg=y
45 922bc38d Michael Niedermayer
    do_mpeg2=y
46 9c3d33d6 Michael Niedermayer
    do_mpeg2thread=y
47 6ebd933b Michael Niedermayer
    do_msmpeg4v2=y
48 51133a7d Fabrice Bellard
    do_msmpeg4=y
49 6ebd933b Michael Niedermayer
    do_wmv1=y
50 e23d5712 Michael Niedermayer
    do_wmv2=y
51 61b262a9 Michael Niedermayer
    do_h261=y
52 51133a7d Fabrice Bellard
    do_h263=y
53 6e2d5f1a Michael Niedermayer
    do_h263p=y
54 51133a7d Fabrice Bellard
    do_mpeg4=y
55 e23d5712 Michael Niedermayer
    do_huffyuv=y
56 51133a7d Fabrice Bellard
    do_mjpeg=y
57 3b37408b Michael Niedermayer
    do_ljpeg=y
58 64a7a8af Michael Niedermayer
    do_rv10=y
59 c50cd09d Michael Niedermayer
    do_rv20=y
60 51133a7d Fabrice Bellard
    do_mp2=y
61
    do_ac3=y
62 311be1fb Michael Niedermayer
    do_g726=y
63 f02ab814 Michael Niedermayer
    do_adpcm_ima_wav=y
64
    do_adpcm_ms=y
65 1dbb6d90 Michael Niedermayer
    do_rc=y
66
    do_mpeg4adv=y
67 9c3d33d6 Michael Niedermayer
    do_mpeg4thread=y
68 be408b67 Michael Niedermayer
    do_mpeg4nr=y
69 cfadadec Michael Niedermayer
    do_mpeg1b=y
70 9ca9fce1 Michael Niedermayer
    do_asv1=y
71 8d876a43 Michael Niedermayer
    do_asv2=y
72 bbdd42d3 Michael Niedermayer
    do_flv=y
73 f3203047 Michael Niedermayer
    do_ffv1=y
74 7ebfc0ea Michael Niedermayer
    do_error=y
75 b86bd1f1 Michael Niedermayer
    do_svq1=y
76 51133a7d Fabrice Bellard
fi
77
78
79
# various files
80 3aca208a Mark Hills
ffmpeg="../ffmpeg_g"
81 67cbe681 Michael Niedermayer
tiny_psnr="./tiny_psnr"
82 51133a7d Fabrice Bellard
reffile="$2"
83 5bcfd1ad Fabrice Bellard
benchfile="$datadir/ffmpeg.bench"
84 6afd3b92 Michael Niedermayer
raw_src="$3/%d.pgm"
85 5bcfd1ad Fabrice Bellard
raw_dst="$datadir/out.yuv"
86 67cbe681 Michael Niedermayer
raw_ref="$datadir/ref.yuv"
87 51133a7d Fabrice Bellard
pcm_src="asynth1.sw"
88 5bcfd1ad Fabrice Bellard
pcm_dst="$datadir/out.wav"
89 16dd93ab Michael Niedermayer
pcm_ref="$datadir/ref.wav"
90 853d659d John Dalgliesh
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 5bcfd1ad Fabrice Bellard
98
# create the data directory if it does not exists
99
mkdir -p $datadir
100 51133a7d Fabrice Bellard
101 3f027ca7 Felix B√ľnemann
do_ffmpeg()
102 51133a7d Fabrice Bellard
{
103
    f="$1"
104
    shift
105 affd55a1 Roman Shaposhnik
    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 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
108 e31c1c30 Philip Gladstone
    rm -f /tmp/ffmpeg$$
109 853d659d John Dalgliesh
    do_md5sum $f >> $logfile
110 67cbe681 Michael Niedermayer
    if [ $f = $raw_dst ] ; then
111
        $tiny_psnr $f $raw_ref >> $logfile
112 16dd93ab Michael Niedermayer
    elif [ $f = $pcm_dst ] ; then
113
        $tiny_psnr $f $pcm_ref >> $logfile
114 039e7889 Michael Niedermayer
    else
115
        wc -c $f >> $logfile
116 67cbe681 Michael Niedermayer
    fi
117 90cee0c3 Michael Niedermayer
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
118 5bcfd1ad Fabrice Bellard
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
119 51133a7d Fabrice Bellard
}
120
121 3f027ca7 Felix B√ľnemann
do_ffmpeg_crc()
122 89d5dfd5 Fabrice Bellard
{
123
    f="$1"
124
    shift
125 2ad1516a Michael Niedermayer
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
126 affd55a1 Roman Shaposhnik
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
127 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
128 affd55a1 Roman Shaposhnik
    rm -f /tmp/ffmpeg$$ 
129
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
130 89d5dfd5 Fabrice Bellard
}
131 51133a7d Fabrice Bellard
132 67cbe681 Michael Niedermayer
do_ffmpeg_nocheck()
133
{
134
    f="$1"
135
    shift
136 affd55a1 Roman Shaposhnik
    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 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
139 affd55a1 Roman Shaposhnik
    rm -f /tmp/ffmpeg$$
140 67cbe681 Michael Niedermayer
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
141
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
142
}
143
144 51133a7d Fabrice Bellard
echo "ffmpeg regression test" > $logfile
145
echo "ffmpeg benchmarks" > $benchfile
146
147
###################################
148 67cbe681 Michael Niedermayer
# generate reference for quality check
149
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
150 16dd93ab Michael Niedermayer
do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
151 67cbe681 Michael Niedermayer
152
###################################
153 51133a7d Fabrice Bellard
if [ -n "$do_mpeg" ] ; then
154
# mpeg1 encoding
155
file=${outfile}mpeg1.mpg
156 89d5dfd5 Fabrice Bellard
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file 
157 51133a7d Fabrice Bellard
158
# mpeg1 decoding
159 89d5dfd5 Fabrice Bellard
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
160 922bc38d Michael Niedermayer
fi
161
162
###################################
163
if [ -n "$do_mpeg2" ] ; then
164
# mpeg2 encoding
165 83dddc4a Fabrice Bellard
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 6486ad57 Michael Niedermayer
# 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 83dddc4a Fabrice Bellard
# mpeg2 encoding interlaced
179
file=${outfile}mpeg2i.mpg
180 69768b77 Michael Niedermayer
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -ildct -ilme $file 
181 51133a7d Fabrice Bellard
182
# mpeg2 decoding
183 922bc38d Michael Niedermayer
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
184 51133a7d Fabrice Bellard
fi
185
186
###################################
187 9c3d33d6 Michael Niedermayer
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 7f8038ce Michael Niedermayer
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 9c3d33d6 Michael Niedermayer
fi
202
203
###################################
204 6ebd933b Michael Niedermayer
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 51133a7d Fabrice Bellard
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 6ebd933b Michael Niedermayer
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 e23d5712 Michael Niedermayer
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 61b262a9 Michael Niedermayer
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 51133a7d Fabrice Bellard
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 6e2d5f1a Michael Niedermayer
# 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 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
268 6e2d5f1a Michael Niedermayer
269 51133a7d Fabrice Bellard
# 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 28c70622 Michael Niedermayer
file=${outfile}odivx.mp4
277 d3985de7 Michael Niedermayer
do_ffmpeg $file -y -4mv -hq -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
278 51133a7d Fabrice Bellard
279
# mpeg4 decoding
280
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
281
fi
282
283
###################################
284 e629ab68 Romain Dolbeau
if [ -n "$do_huffyuv" ] ; then
285
# huffyuv
286
file=${outfile}huffyuv.avi
287 f37b9768 Loren Merritt
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec huffyuv -pix_fmt yuv422p $file
288 e629ab68 Romain Dolbeau
289
# huffyuv decoding
290
do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
291
fi
292
293
###################################
294 1dbb6d90 Michael Niedermayer
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 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
308 1dbb6d90 Michael Niedermayer
309
# mpeg4 decoding
310
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
311
fi
312
313
###################################
314 9c3d33d6 Michael Niedermayer
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 aab9cdcf Michael Niedermayer
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 9c3d33d6 Michael Niedermayer
fi
332
333
###################################
334 7ebfc0ea Michael Niedermayer
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 be408b67 Michael Niedermayer
if [ -n "$do_mpeg4nr" ] ; then
345
# noise reduction
346 9c3d33d6 Michael Niedermayer
file=${outfile}mpeg4-nr.avi
347 be408b67 Michael Niedermayer
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 cfadadec Michael Niedermayer
if [ -n "$do_mpeg1b" ] ; then
355
# mpeg1
356
file=${outfile}mpeg1b.mpg
357 83dddc4a Fabrice Bellard
do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
358 cfadadec Michael Niedermayer
359
# mpeg1 decoding
360
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
361
fi
362
363
###################################
364 51133a7d Fabrice Bellard
if [ -n "$do_mjpeg" ] ; then
365
# mjpeg
366
file=${outfile}mjpeg.avi
367 dd4f8a04 Michael Niedermayer
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg -pix_fmt yuvj420p $file
368 51133a7d Fabrice Bellard
369
# mjpeg decoding
370
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
371
fi
372
373
###################################
374 3b37408b Michael Niedermayer
if [ -n "$do_ljpeg" ] ; then
375
# ljpeg
376
file=${outfile}ljpeg.avi
377 dd4f8a04 Michael Niedermayer
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg -strict -1 $file
378 3b37408b Michael Niedermayer
379
# ljpeg decoding
380
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
381
fi
382
383
###################################
384 51133a7d Fabrice Bellard
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 c50cd09d Michael Niedermayer
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 9ca9fce1 Michael Niedermayer
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 8d876a43 Michael Niedermayer
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 bbdd42d3 Michael Niedermayer
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 f3203047 Michael Niedermayer
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 b86bd1f1 Michael Niedermayer
if [ -n "$do_svq1" ] ; then
445
# svq1 encoding
446
file=${outfile}svq1.mov
447 e6cf9be5 Michael Niedermayer
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
448 b86bd1f1 Michael Niedermayer
449
# svq1 decoding
450
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
451
fi
452
453
###################################
454 51133a7d Fabrice Bellard
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 3c300082 Michael Niedermayer
#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
471 51133a7d Fabrice Bellard
fi
472
473 89d5dfd5 Fabrice Bellard
###################################
474 311be1fb Michael Niedermayer
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 f02ab814 Michael Niedermayer
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 89d5dfd5 Fabrice Bellard
# 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 ba30abcb Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
517 e928649b Michael Niedermayer
do_ffmpeg_crc $file -i $file -r 25
518 89d5dfd5 Fabrice Bellard
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 2dd59ebd Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
533 d0c30ca5 Fabrice Bellard
do_ffmpeg_crc $file -i $file
534 89d5dfd5 Fabrice Bellard
535
# ffm
536 74d69c07 Michael Niedermayer
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 89d5dfd5 Fabrice Bellard
540 bbdd42d3 Michael Niedermayer
# flv
541
file=${outfile}libav.flv
542 ba30abcb Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
543 bbdd42d3 Michael Niedermayer
do_ffmpeg_crc $file -i $file
544
545 c280f2d7 Michael Niedermayer
# mov
546 2dd59ebd Michael Niedermayer
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 c280f2d7 Michael Niedermayer
550
# nut
551
file=${outfile}libav.nut
552 ba30abcb Michael Niedermayer
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
553 c280f2d7 Michael Niedermayer
do_ffmpeg_crc $file -i $file
554
555 a811de6e Michael Niedermayer
# dv
556 3ea1ce21 Roman Shaposhnik
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 a811de6e Michael Niedermayer
560 c280f2d7 Michael Niedermayer
# XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)
561 89d5dfd5 Fabrice Bellard
562
####################
563
# streamed images
564
# mjpeg
565 affd55a1 Roman Shaposhnik
#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 89d5dfd5 Fabrice Bellard
569 7481e919 Fabrice Bellard
# pbmpipe
570
file=${outfile}libav.pbm
571 87c5fbc3 Michael Niedermayer
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 7481e919 Fabrice Bellard
574 89d5dfd5 Fabrice Bellard
# pgmpipe
575 7481e919 Fabrice Bellard
file=${outfile}libav.pgm
576 87c5fbc3 Michael Niedermayer
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 89d5dfd5 Fabrice Bellard
579
# ppmpipe
580 7481e919 Fabrice Bellard
file=${outfile}libav.ppm
581 87c5fbc3 Michael Niedermayer
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 89d5dfd5 Fabrice Bellard
584
# gif
585
file=${outfile}libav.gif
586 7481e919 Fabrice Bellard
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 89d5dfd5 Fabrice Bellard
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 d0c30ca5 Fabrice Bellard
# jpeg (we do not do md5 on image files yet)
607 72f89c4c Michael Niedermayer
file=${outfile}libav%d.jpg
608 dd4f8a04 Michael Niedermayer
$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 72f89c4c Michael Niedermayer
do_ffmpeg_crc $file -f image2 -i $file
610 d0c30ca5 Fabrice Bellard
611 89d5dfd5 Fabrice Bellard
####################
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 affd55a1 Roman Shaposhnik
####################
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 89d5dfd5 Fabrice Bellard
fi
648
649
650 51133a7d Fabrice Bellard
651 281a74da Michael Niedermayer
if $diff_cmd "$logfile" "$reffile" ; then
652 51133a7d Fabrice Bellard
    echo 
653
    echo Regression test succeeded.
654
    exit 0
655
else
656
    echo 
657
    echo Regression test: Error.
658
    exit 1
659
fi