Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ a98d3e82

History | View | Annotate | Download (16.9 KB)

1 51133a7d Fabrice Bellard
#!/bin/sh
2
#
3
# automatic regression test for ffmpeg
4
#
5
#
6
#set -x
7 d9c211ee Diego Biurrun
# Even in the 21st century some diffs do not support -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 d9c211ee Diego Biurrun
# tests to run
28 51133a7d Fabrice Bellard
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 d13eef3d Michael Niedermayer
elif [ "$1" = "snow" ] ; then
40
    do_snow=y
41 e03c822a Michael Niedermayer
elif [ "$1" = "snowll" ] ; then
42
    do_snowll=y
43 89d5dfd5 Fabrice Bellard
elif [ "$1" = "libavtest" ] ; then
44 7dc0c991 Diego Biurrun
    do_libavtest=y
45 5bcfd1ad Fabrice Bellard
    logfile="$datadir/libav.regression"
46 a12eea30 Fabrice Bellard
    outfile="$datadir/b-"
47 51133a7d Fabrice Bellard
else
48
    do_mpeg=y
49 922bc38d Michael Niedermayer
    do_mpeg2=y
50 9c3d33d6 Michael Niedermayer
    do_mpeg2thread=y
51 6ebd933b Michael Niedermayer
    do_msmpeg4v2=y
52 51133a7d Fabrice Bellard
    do_msmpeg4=y
53 6ebd933b Michael Niedermayer
    do_wmv1=y
54 e23d5712 Michael Niedermayer
    do_wmv2=y
55 61b262a9 Michael Niedermayer
    do_h261=y
56 51133a7d Fabrice Bellard
    do_h263=y
57 6e2d5f1a Michael Niedermayer
    do_h263p=y
58 51133a7d Fabrice Bellard
    do_mpeg4=y
59 dcfdb046 Benjamin Larsson
    do_mp4psp=y
60 e23d5712 Michael Niedermayer
    do_huffyuv=y
61 51133a7d Fabrice Bellard
    do_mjpeg=y
62 3b37408b Michael Niedermayer
    do_ljpeg=y
63 b4e021e8 Michael Niedermayer
    do_jpegls=y
64 64a7a8af Michael Niedermayer
    do_rv10=y
65 c50cd09d Michael Niedermayer
    do_rv20=y
66 51133a7d Fabrice Bellard
    do_mp2=y
67
    do_ac3=y
68 311be1fb Michael Niedermayer
    do_g726=y
69 f02ab814 Michael Niedermayer
    do_adpcm_ima_wav=y
70
    do_adpcm_ms=y
71 aeb2904e Michael Niedermayer
    do_flac=y
72 6d3d8dae Michael Niedermayer
    do_wma=y
73 3160138f Michael Niedermayer
    do_vorbis=y
74 1dbb6d90 Michael Niedermayer
    do_rc=y
75
    do_mpeg4adv=y
76 9c3d33d6 Michael Niedermayer
    do_mpeg4thread=y
77 be408b67 Michael Niedermayer
    do_mpeg4nr=y
78 cfadadec Michael Niedermayer
    do_mpeg1b=y
79 9ca9fce1 Michael Niedermayer
    do_asv1=y
80 8d876a43 Michael Niedermayer
    do_asv2=y
81 bbdd42d3 Michael Niedermayer
    do_flv=y
82 f3203047 Michael Niedermayer
    do_ffv1=y
83 7ebfc0ea Michael Niedermayer
    do_error=y
84 b86bd1f1 Michael Niedermayer
    do_svq1=y
85 d13eef3d Michael Niedermayer
    do_snow=y
86 e03c822a Michael Niedermayer
    do_snowll=y
87 d8cbeba1 Michael Niedermayer
    do_adpcm_yam=y
88 8fce2707 Michael Niedermayer
    do_dv=y
89 0b297700 Daniel Maas
    do_dv50=y
90 51133a7d Fabrice Bellard
fi
91
92
93
# various files
94 3aca208a Mark Hills
ffmpeg="../ffmpeg_g"
95 67cbe681 Michael Niedermayer
tiny_psnr="./tiny_psnr"
96 51133a7d Fabrice Bellard
reffile="$2"
97 5bcfd1ad Fabrice Bellard
benchfile="$datadir/ffmpeg.bench"
98 8deb894f Diego Biurrun
bench="$datadir/bench.tmp"
99
bench2="$datadir/bench2.tmp"
100 528bbdde Sam Hocevar
raw_src="$3/%02d.pgm"
101 5bcfd1ad Fabrice Bellard
raw_dst="$datadir/out.yuv"
102 67cbe681 Michael Niedermayer
raw_ref="$datadir/ref.yuv"
103 51133a7d Fabrice Bellard
pcm_src="asynth1.sw"
104 5bcfd1ad Fabrice Bellard
pcm_dst="$datadir/out.wav"
105 16dd93ab Michael Niedermayer
pcm_ref="$datadir/ref.wav"
106 853d659d John Dalgliesh
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 5bcfd1ad Fabrice Bellard
114 d9c211ee Diego Biurrun
# create the data directory if it does not exist
115 5bcfd1ad Fabrice Bellard
mkdir -p $datadir
116 51133a7d Fabrice Bellard
117 bcea9605 Diego Biurrun
FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple"
118
119 3f027ca7 Felix Bünemann
do_ffmpeg()
120 51133a7d Fabrice Bellard
{
121 9e32e071 Diego Biurrun
    f="$1"
122 51133a7d Fabrice Bellard
    shift
123 bcea9605 Diego Biurrun
    echo $ffmpeg $FFMPEG_OPTS $*
124 8deb894f Diego Biurrun
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
125 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
126 e31c1c30 Philip Gladstone
    rm -f /tmp/ffmpeg$$
127 9e32e071 Diego Biurrun
    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 039e7889 Michael Niedermayer
    else
133 9e32e071 Diego Biurrun
        wc -c $f >> $logfile
134 67cbe681 Michael Niedermayer
    fi
135 8deb894f Diego Biurrun
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
136 9e32e071 Diego Biurrun
    echo `cat $bench2` $f >> $benchfile
137 51133a7d Fabrice Bellard
}
138
139 d9076fe7 Michael Niedermayer
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 3f027ca7 Felix Bünemann
do_ffmpeg_crc()
159 89d5dfd5 Fabrice Bellard
{
160 9e32e071 Diego Biurrun
    f="$1"
161 89d5dfd5 Fabrice Bellard
    shift
162 bcea9605 Diego Biurrun
    echo $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc
163
    $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
164 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
165 115329f1 Diego Biurrun
    rm -f /tmp/ffmpeg$$
166 9e32e071 Diego Biurrun
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
167 89d5dfd5 Fabrice Bellard
}
168 51133a7d Fabrice Bellard
169 67cbe681 Michael Niedermayer
do_ffmpeg_nocheck()
170
{
171 9e32e071 Diego Biurrun
    f="$1"
172 67cbe681 Michael Niedermayer
    shift
173 bcea9605 Diego Biurrun
    echo $ffmpeg $FFMPEG_OPTS $*
174 8deb894f Diego Biurrun
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
175 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
176 affd55a1 Roman Shaposhnik
    rm -f /tmp/ffmpeg$$
177 8deb894f Diego Biurrun
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
178 9e32e071 Diego Biurrun
    echo `cat $bench2` $f >> $benchfile
179 67cbe681 Michael Niedermayer
}
180
181 1de61a18 Diego Biurrun
do_video_decoding()
182
{
183 5e5ac8e0 Diego Biurrun
    do_ffmpeg $raw_dst -y $1 -i $file -f rawvideo $2 $raw_dst
184 1de61a18 Diego Biurrun
}
185
186
do_video_encoding()
187
{
188 1e1b182d Diego Biurrun
    file=${outfile}$1
189 a2377bb0 Diego Biurrun
    do_ffmpeg $file -y $2 -f $3 -i $raw_src $4 $file
190 1de61a18 Diego Biurrun
}
191
192 fb132953 Diego Biurrun
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 36aed9e5 Diego Biurrun
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 d449d1bc Diego Biurrun
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 f8aa7645 Diego Biurrun
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 e587a0a5 Diego Biurrun
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 51133a7d Fabrice Bellard
echo "ffmpeg regression test" > $logfile
234
echo "ffmpeg benchmarks" > $benchfile
235
236
###################################
237 67cbe681 Michael Niedermayer
# generate reference for quality check
238
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
239 16dd93ab Michael Niedermayer
do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
240 67cbe681 Michael Niedermayer
241
###################################
242 51133a7d Fabrice Bellard
if [ -n "$do_mpeg" ] ; then
243 0fc3a831 Diego Biurrun
# mpeg1
244 a2377bb0 Diego Biurrun
do_video_encoding mpeg1.mpg "-qscale 10" pgmyuv "-f mpeg1video"
245 1de61a18 Diego Biurrun
do_video_decoding
246 922bc38d Michael Niedermayer
fi
247
248
###################################
249
if [ -n "$do_mpeg2" ] ; then
250 0fc3a831 Diego Biurrun
# mpeg2
251 a2377bb0 Diego Biurrun
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video"
252 1de61a18 Diego Biurrun
do_video_decoding
253 83dddc4a Fabrice Bellard
254 49f1ac5a Baptiste Coudurier
# 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 307eb248 Baptiste Coudurier
257
# mpeg2 decoding
258 1de61a18 Diego Biurrun
do_video_decoding
259 307eb248 Baptiste Coudurier
260 0fc3a831 Diego Biurrun
# mpeg2
261 a2377bb0 Diego Biurrun
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
262 5e5ac8e0 Diego Biurrun
do_video_decoding "-idct int"
263 6486ad57 Michael Niedermayer
264 83dddc4a Fabrice Bellard
# mpeg2 encoding interlaced
265 a2377bb0 Diego Biurrun
do_video_encoding mpeg2i.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
266 51133a7d Fabrice Bellard
267
# mpeg2 decoding
268 1de61a18 Diego Biurrun
do_video_decoding
269 51133a7d Fabrice Bellard
fi
270
271
###################################
272 9c3d33d6 Michael Niedermayer
if [ -n "$do_mpeg2thread" ] ; then
273
# mpeg2 encoding interlaced
274 a2377bb0 Diego Biurrun
do_video_encoding mpeg2thread.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
275 307eb248 Baptiste Coudurier
276
# mpeg2 decoding
277 1de61a18 Diego Biurrun
do_video_decoding
278 307eb248 Baptiste Coudurier
279
# mpeg2 encoding interlaced using intra vlc
280 a2377bb0 Diego Biurrun
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
281 9c3d33d6 Michael Niedermayer
282
# mpeg2 decoding
283 1de61a18 Diego Biurrun
do_video_decoding
284 7f8038ce Michael Niedermayer
285
# mpeg2 encoding interlaced
286
file=${outfile}mpeg2reuse.mpg
287 115329f1 Diego Biurrun
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 7f8038ce Michael Niedermayer
289
# mpeg2 decoding
290 1de61a18 Diego Biurrun
do_video_decoding
291 9c3d33d6 Michael Niedermayer
fi
292
293
###################################
294 6ebd933b Michael Niedermayer
if [ -n "$do_msmpeg4v2" ] ; then
295 0fc3a831 Diego Biurrun
# msmpeg4
296 a2377bb0 Diego Biurrun
do_video_encoding msmpeg4v2.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4v2"
297 1de61a18 Diego Biurrun
do_video_decoding
298 6ebd933b Michael Niedermayer
fi
299
300
###################################
301 51133a7d Fabrice Bellard
if [ -n "$do_msmpeg4" ] ; then
302 0fc3a831 Diego Biurrun
# msmpeg4
303 a2377bb0 Diego Biurrun
do_video_encoding msmpeg4.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4"
304 1de61a18 Diego Biurrun
do_video_decoding
305 51133a7d Fabrice Bellard
fi
306
307
###################################
308 6ebd933b Michael Niedermayer
if [ -n "$do_wmv1" ] ; then
309 0fc3a831 Diego Biurrun
# wmv1
310 a2377bb0 Diego Biurrun
do_video_encoding wmv1.avi "-qscale 10" pgmyuv "-an -vcodec wmv1"
311 1de61a18 Diego Biurrun
do_video_decoding
312 6ebd933b Michael Niedermayer
fi
313
314
###################################
315 e23d5712 Michael Niedermayer
if [ -n "$do_wmv2" ] ; then
316 0fc3a831 Diego Biurrun
# wmv2
317 a2377bb0 Diego Biurrun
do_video_encoding wmv2.avi "-qscale 10" pgmyuv "-an -vcodec wmv2"
318 1de61a18 Diego Biurrun
do_video_decoding
319 e23d5712 Michael Niedermayer
fi
320
321
###################################
322 61b262a9 Michael Niedermayer
if [ -n "$do_h261" ] ; then
323 0fc3a831 Diego Biurrun
# h261
324 a2377bb0 Diego Biurrun
do_video_encoding h261.avi "-qscale 11" pgmyuv "-s 352x288 -an -vcodec h261"
325 1de61a18 Diego Biurrun
do_video_decoding
326 61b262a9 Michael Niedermayer
fi
327
328
###################################
329 51133a7d Fabrice Bellard
if [ -n "$do_h263" ] ; then
330 0fc3a831 Diego Biurrun
# h263
331 a2377bb0 Diego Biurrun
do_video_encoding h263.avi "-qscale 10" pgmyuv "-s 352x288 -an -vcodec h263"
332 1de61a18 Diego Biurrun
do_video_decoding
333 6e2d5f1a Michael Niedermayer
fi
334
335
###################################
336
if [ -n "$do_h263p" ] ; then
337 0fc3a831 Diego Biurrun
# h263p
338 a2377bb0 Diego Biurrun
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" pgmyuv "-s 352x288 -an -vcodec h263p -ps 300"
339 1de61a18 Diego Biurrun
do_video_decoding
340 51133a7d Fabrice Bellard
fi
341
342
###################################
343
if [ -n "$do_mpeg4" ] ; then
344
# mpeg4
345 aeeb0cac Diego Biurrun
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" pgmyuv "-an -vcodec mpeg4"
346
do_video_decoding
347 51133a7d Fabrice Bellard
fi
348
349
###################################
350 e629ab68 Romain Dolbeau
if [ -n "$do_huffyuv" ] ; then
351
# huffyuv
352 a2377bb0 Diego Biurrun
do_video_encoding huffyuv.avi "" pgmyuv "-an -vcodec huffyuv -pix_fmt yuv422p"
353 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
354 e629ab68 Romain Dolbeau
fi
355
356
###################################
357 1dbb6d90 Michael Niedermayer
if [ -n "$do_rc" ] ; then
358
# mpeg4 rate control
359 aeeb0cac Diego Biurrun
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" pgmyuv "-an -vcodec mpeg4"
360
do_video_decoding
361 1dbb6d90 Michael Niedermayer
fi
362
363
###################################
364
if [ -n "$do_mpeg4adv" ] ; then
365
# mpeg4
366 a2377bb0 Diego Biurrun
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" pgmyuv "-an -vcodec mpeg4"
367 1de61a18 Diego Biurrun
do_video_decoding
368 2d1e5071 Michael Niedermayer
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 1dbb6d90 Michael Niedermayer
377 9c3d33d6 Michael Niedermayer
# mpeg4
378 45ddd8b0 Måns Rullgård
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" pgmyuv "-an -vcodec mpeg4"
379 1de61a18 Diego Biurrun
do_video_decoding
380 aab9cdcf Michael Niedermayer
fi
381
382
###################################
383 45ddd8b0 Måns Rullgård
if [ -n "$do_mpeg4thread" ] ; then
384 aab9cdcf Michael Niedermayer
# mpeg4
385 45ddd8b0 Måns Rullgård
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 1de61a18 Diego Biurrun
do_video_decoding
387 9c3d33d6 Michael Niedermayer
fi
388
389
###################################
390 dcfdb046 Benjamin Larsson
if [ -n "$do_mp4psp" ] ; then
391
# mp4 PSP style
392 a2377bb0 Diego Biurrun
do_video_encoding mpeg4-PSP.mp4 "-b 768k -s 320x240" psp "-ar 24000 -ab 32 -i $raw_src"
393 dcfdb046 Benjamin Larsson
fi
394
395
###################################
396 7ebfc0ea Michael Niedermayer
if [ -n "$do_error" ] ; then
397
# damaged mpeg4
398 a2377bb0 Diego Biurrun
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" pgmyuv "-an -vcodec mpeg4"
399 1de61a18 Diego Biurrun
do_video_decoding
400 7ebfc0ea Michael Niedermayer
fi
401
402
###################################
403 be408b67 Michael Niedermayer
if [ -n "$do_mpeg4nr" ] ; then
404
# noise reduction
405 a2377bb0 Diego Biurrun
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" pgmyuv "-an -vcodec mpeg4"
406 1de61a18 Diego Biurrun
do_video_decoding
407 be408b67 Michael Niedermayer
fi
408
409
###################################
410 cfadadec Michael Niedermayer
if [ -n "$do_mpeg1b" ] ; then
411
# mpeg1
412 a2377bb0 Diego Biurrun
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" pgmyuv "-an -vcodec mpeg1video -f mpeg1video"
413 1de61a18 Diego Biurrun
do_video_decoding
414 cfadadec Michael Niedermayer
fi
415
416
###################################
417 51133a7d Fabrice Bellard
if [ -n "$do_mjpeg" ] ; then
418
# mjpeg
419 a2377bb0 Diego Biurrun
do_video_encoding mjpeg.avi "-qscale 10" pgmyuv "-an -vcodec mjpeg -pix_fmt yuvj420p"
420 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
421 51133a7d Fabrice Bellard
fi
422
423
###################################
424 3b37408b Michael Niedermayer
if [ -n "$do_ljpeg" ] ; then
425
# ljpeg
426 a2377bb0 Diego Biurrun
do_video_encoding ljpeg.avi "" pgmyuv "-an -vcodec ljpeg -strict -1"
427 1de61a18 Diego Biurrun
do_video_decoding
428 3b37408b Michael Niedermayer
fi
429
430
###################################
431 b4e021e8 Michael Niedermayer
if [ -n "$do_jpegls" ] ; then
432
# jpeg ls
433 a2377bb0 Diego Biurrun
do_video_encoding jpegls.avi "" pgmyuv "-an -vcodec jpegls -vtag MJPG"
434 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
435 b4e021e8 Michael Niedermayer
fi
436
437
###################################
438 51133a7d Fabrice Bellard
if [ -n "$do_rv10" ] ; then
439
# rv10 encoding
440 a2377bb0 Diego Biurrun
do_video_encoding rv10.rm "-qscale 10" pgmyuv "-an"
441 1de61a18 Diego Biurrun
do_video_decoding
442 51133a7d Fabrice Bellard
fi
443
444
###################################
445 c50cd09d Michael Niedermayer
if [ -n "$do_rv20" ] ; then
446
# rv20 encoding
447 a2377bb0 Diego Biurrun
do_video_encoding rv20.rm "-qscale 10" pgmyuv "-vcodec rv20 -an"
448 1de61a18 Diego Biurrun
do_video_decoding
449 c50cd09d Michael Niedermayer
fi
450
451
###################################
452 9ca9fce1 Michael Niedermayer
if [ -n "$do_asv1" ] ; then
453
# asv1 encoding
454 a2377bb0 Diego Biurrun
do_video_encoding asv1.avi "-qscale 10" pgmyuv "-an -vcodec asv1"
455 1de61a18 Diego Biurrun
do_video_decoding
456 9ca9fce1 Michael Niedermayer
fi
457
458
###################################
459 8d876a43 Michael Niedermayer
if [ -n "$do_asv2" ] ; then
460
# asv2 encoding
461 a2377bb0 Diego Biurrun
do_video_encoding asv2.avi "-qscale 10" pgmyuv "-an -vcodec asv2"
462 1de61a18 Diego Biurrun
do_video_decoding
463 8d876a43 Michael Niedermayer
fi
464
465
###################################
466 bbdd42d3 Michael Niedermayer
if [ -n "$do_flv" ] ; then
467
# flv encoding
468 a2377bb0 Diego Biurrun
do_video_encoding flv.flv "-qscale 10" pgmyuv "-an -vcodec flv"
469 1de61a18 Diego Biurrun
do_video_decoding
470 bbdd42d3 Michael Niedermayer
fi
471
472
###################################
473 f3203047 Michael Niedermayer
if [ -n "$do_ffv1" ] ; then
474
# ffv1 encoding
475 a2377bb0 Diego Biurrun
do_video_encoding ffv1.avi "-strict -2" pgmyuv "-an -vcodec ffv1"
476 1de61a18 Diego Biurrun
do_video_decoding
477 d13eef3d Michael Niedermayer
fi
478
479
###################################
480
if [ -n "$do_snow" ] ; then
481 0fc3a831 Diego Biurrun
# snow
482 a2377bb0 Diego Biurrun
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 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s 352x288"
484 e03c822a Michael Niedermayer
fi
485 d13eef3d Michael Niedermayer
486 e03c822a Michael Niedermayer
###################################
487
if [ -n "$do_snowll" ] ; then
488 0fc3a831 Diego Biurrun
# snow
489 a2377bb0 Diego Biurrun
do_video_encoding snow53.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
490 1de61a18 Diego Biurrun
do_video_decoding
491 f3203047 Michael Niedermayer
fi
492
493
###################################
494 8fce2707 Michael Niedermayer
if [ -n "$do_dv" ] ; then
495 0fc3a831 Diego Biurrun
# dv
496 a2377bb0 Diego Biurrun
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -an"
497 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s cif"
498 8fce2707 Michael Niedermayer
fi
499
500
###################################
501 0b297700 Daniel Maas
if [ -n "$do_dv50" ] ; then
502 0fc3a831 Diego Biurrun
# dv50
503 a2377bb0 Diego Biurrun
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -pix_fmt yuv422p -an"
504 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s cif -pix_fmt yuv420p"
505 0b297700 Daniel Maas
fi
506
507
508
###################################
509 b86bd1f1 Michael Niedermayer
if [ -n "$do_svq1" ] ; then
510 0fc3a831 Diego Biurrun
# svq1
511 a2377bb0 Diego Biurrun
do_video_encoding svq1.mov "" pgmyuv "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
512 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
513 b86bd1f1 Michael Niedermayer
fi
514
515
###################################
516 51133a7d Fabrice Bellard
if [ -n "$do_mp2" ] ; then
517 0fc3a831 Diego Biurrun
# mp2
518 fb132953 Diego Biurrun
do_audio_encoding mp2.mp2 "-ar 44100"
519
do_audio_decoding
520 976709ee Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
521 51133a7d Fabrice Bellard
fi
522
523
###################################
524
if [ -n "$do_ac3" ] ; then
525 0fc3a831 Diego Biurrun
# ac3
526 fb132953 Diego Biurrun
do_audio_encoding ac3.rm "" -vn
527
#do_audio_decoding
528 51133a7d Fabrice Bellard
fi
529
530 89d5dfd5 Fabrice Bellard
###################################
531 311be1fb Michael Niedermayer
if [ -n "$do_g726" ] ; then
532 0fc3a831 Diego Biurrun
# g726
533 fb132953 Diego Biurrun
do_audio_encoding g726.wav "-ar 44100" "-ab 32 -ac 1 -ar 8000 -acodec g726"
534
do_audio_decoding
535 311be1fb Michael Niedermayer
fi
536
537
###################################
538 f02ab814 Michael Niedermayer
if [ -n "$do_adpcm_ima_wav" ] ; then
539 0fc3a831 Diego Biurrun
# adpcm ima
540 fb132953 Diego Biurrun
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
541
do_audio_decoding
542 f02ab814 Michael Niedermayer
fi
543
544
###################################
545
if [ -n "$do_adpcm_ms" ] ; then
546 0fc3a831 Diego Biurrun
# adpcm ms
547 fb132953 Diego Biurrun
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
548
do_audio_decoding
549 f02ab814 Michael Niedermayer
fi
550
551
###################################
552 d8cbeba1 Michael Niedermayer
if [ -n "$do_adpcm_yam" ] ; then
553 0fc3a831 Diego Biurrun
# adpcm yamaha
554 fb132953 Diego Biurrun
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
555
do_audio_decoding
556 d8cbeba1 Michael Niedermayer
fi
557
558
###################################
559 aeb2904e Michael Niedermayer
if [ -n "$do_flac" ] ; then
560 0fc3a831 Diego Biurrun
# flac
561 fb132953 Diego Biurrun
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
562
do_audio_decoding
563 aeb2904e Michael Niedermayer
fi
564
565
###################################
566 6d3d8dae Michael Niedermayer
if [ -n "$do_wma" ] ; then
567
# wmav1
568
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
569 d9076fe7 Michael Niedermayer
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
570 6d3d8dae Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
571
# wmav2
572
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
573 d9076fe7 Michael Niedermayer
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
574 6d3d8dae Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
575
fi
576
577 3160138f Michael Niedermayer
###################################
578 0786943a Michael Niedermayer
#if [ -n "$do_vorbis" ] ; then
579 3160138f Michael Niedermayer
# vorbis
580 0786943a Michael Niedermayer
#disabled because its broken
581
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
582
#do_audio_decoding
583
#fi
584 6d3d8dae Michael Niedermayer
585
###################################
586 2a048239 Diego Biurrun
# libavformat testing
587 89d5dfd5 Fabrice Bellard
###################################
588
589 7dc0c991 Diego Biurrun
if [ -n "$do_libavtest" ] ; then
590 89d5dfd5 Fabrice Bellard
591
# avi
592 36aed9e5 Diego Biurrun
do_libav avi
593 89d5dfd5 Fabrice Bellard
594
# asf
595 36aed9e5 Diego Biurrun
do_libav asf "-acodec mp2" "-r 25"
596 89d5dfd5 Fabrice Bellard
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 36aed9e5 Diego Biurrun
do_libav mpg
605 89d5dfd5 Fabrice Bellard
606 d05c15cb Michael Niedermayer
# mpegts
607 36aed9e5 Diego Biurrun
do_libav ts
608 d05c15cb Michael Niedermayer
609 662fd26c Baptiste Coudurier
# swf
610
do_libav swf -an
611 89d5dfd5 Fabrice Bellard
612
# ffm
613 36aed9e5 Diego Biurrun
do_libav ffm
614 89d5dfd5 Fabrice Bellard
615 bbdd42d3 Michael Niedermayer
# flv
616 36aed9e5 Diego Biurrun
do_libav flv -an
617 bbdd42d3 Michael Niedermayer
618 c280f2d7 Michael Niedermayer
# mov
619 36aed9e5 Diego Biurrun
do_libav mov "-acodec pcm_alaw"
620 c280f2d7 Michael Niedermayer
621
# nut
622 36aed9e5 Diego Biurrun
#do_libav nut "-acodec mp2"
623 c280f2d7 Michael Niedermayer
624 a811de6e Michael Niedermayer
# dv
625 36aed9e5 Diego Biurrun
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
626 a811de6e Michael Niedermayer
627 a850fd18 Baptiste Coudurier
# gxf
628 36aed9e5 Diego Biurrun
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
629 a850fd18 Baptiste Coudurier
630 89d5dfd5 Fabrice Bellard
####################
631
# streamed images
632
# mjpeg
633 affd55a1 Roman Shaposhnik
#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 89d5dfd5 Fabrice Bellard
637 7481e919 Fabrice Bellard
# pbmpipe
638 d449d1bc Diego Biurrun
do_streamed_images pbm
639 7481e919 Fabrice Bellard
640 89d5dfd5 Fabrice Bellard
# pgmpipe
641 d449d1bc Diego Biurrun
do_streamed_images pgm
642 89d5dfd5 Fabrice Bellard
643
# ppmpipe
644 d449d1bc Diego Biurrun
do_streamed_images ppm
645 89d5dfd5 Fabrice Bellard
646
# gif
647
file=${outfile}libav.gif
648 20dd25ad Luca Abeni
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
649 7481e919 Fabrice Bellard
#do_ffmpeg_crc $file -i $file
650
651
# yuv4mpeg
652 8cf71ead Roine Gustafsson
file=${outfile}libav.y4m
653 7481e919 Fabrice Bellard
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
654
#do_ffmpeg_crc $file -i $file
655 89d5dfd5 Fabrice Bellard
656
####################
657
# image formats
658
# pgm (we do not do md5 on image files yet)
659 f8aa7645 Diego Biurrun
do_image_formats pgm
660 89d5dfd5 Fabrice Bellard
661
# ppm (we do not do md5 on image files yet)
662 f8aa7645 Diego Biurrun
do_image_formats ppm
663 89d5dfd5 Fabrice Bellard
664 d0c30ca5 Fabrice Bellard
# jpeg (we do not do md5 on image files yet)
665 f8aa7645 Diego Biurrun
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
666 d0c30ca5 Fabrice Bellard
667 89d5dfd5 Fabrice Bellard
####################
668
# audio only
669
670
# wav
671 e587a0a5 Diego Biurrun
do_audio_only wav
672 89d5dfd5 Fabrice Bellard
673
# alaw
674 e587a0a5 Diego Biurrun
do_audio_only al
675 89d5dfd5 Fabrice Bellard
676
# mulaw
677 e587a0a5 Diego Biurrun
do_audio_only ul
678 89d5dfd5 Fabrice Bellard
679
# au
680 e587a0a5 Diego Biurrun
do_audio_only au
681 89d5dfd5 Fabrice Bellard
682 d8cbeba1 Michael Niedermayer
# mmf
683 e587a0a5 Diego Biurrun
do_audio_only mmf
684 d8cbeba1 Michael Niedermayer
685 f11288da Michael Niedermayer
# aiff
686 e587a0a5 Diego Biurrun
do_audio_only aif
687 f11288da Michael Niedermayer
688 ea395e8c Aurelien Jacobs
# voc
689 e587a0a5 Diego Biurrun
do_audio_only voc
690 ea395e8c Aurelien Jacobs
691 affd55a1 Roman Shaposhnik
####################
692
# pix_fmt conversions
693 dc8918ad Baptiste Coudurier
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
694
             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
695 bb270c08 Diego Biurrun
             monob pal8"
696 affd55a1 Roman Shaposhnik
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 2a048239 Diego Biurrun
fi #  [ -n "$do_libavtest" ]
705 89d5dfd5 Fabrice Bellard
706
707 51133a7d Fabrice Bellard
708 281a74da Michael Niedermayer
if $diff_cmd "$logfile" "$reffile" ; then
709 115329f1 Diego Biurrun
    echo
710 51133a7d Fabrice Bellard
    echo Regression test succeeded.
711
    exit 0
712
else
713 115329f1 Diego Biurrun
    echo
714 51133a7d Fabrice Bellard
    echo Regression test: Error.
715
    exit 1
716
fi