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.

634 lines
17KB

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