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