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