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