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.

661 lines
18KB

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