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.

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