You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

623 lines
16KB

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