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.

179 lines
4.1KB

  1. #!/bin/sh
  2. #
  3. # automatic regression test for libavformat
  4. #
  5. #
  6. #set -x
  7. set -e
  8. . $(dirname $0)/regression-funcs.sh
  9. eval do_$test=y
  10. do_lavf()
  11. {
  12. file=${outfile}lavf.$1
  13. do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $DEC_OPTS -ar 44100 -f s16le $2 -i $pcm_src $ENC_OPTS -b:a 64k -t 1 -qscale:v 10 $3
  14. test $5 = "disable_crc" ||
  15. do_avconv_crc $file $DEC_OPTS -i $target_path/$file $4
  16. }
  17. do_image_formats()
  18. {
  19. outfile="$datadir/images/$1/"
  20. mkdir -p "$outfile"
  21. file=${outfile}%02d.$1
  22. run_avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $2 $ENC_OPTS $3 -frames 12 -y -qscale 10 $target_path/$file
  23. do_md5sum ${outfile}02.$1
  24. do_avconv_crc $file $DEC_OPTS $3 -i $target_path/$file
  25. echo $(wc -c ${outfile}02.$1)
  26. }
  27. if [ -n "$do_avi" ] ; then
  28. do_lavf avi "" "-c:a mp2 -ar 44100"
  29. fi
  30. if [ -n "$do_asf" ] ; then
  31. do_lavf asf "" "-c:a mp2 -ar 44100" "-r 25"
  32. fi
  33. if [ -n "$do_rm" ] ; then
  34. file=${outfile}lavf.rm
  35. # The RealMedia muxer is broken.
  36. do_lavf rm "" "-c:a ac3_fixed" "" disable_crc
  37. fi
  38. if [ -n "$do_mpg" ] ; then
  39. do_lavf mpg "" "-ar 44100"
  40. fi
  41. if [ -n "$do_mxf" ] ; then
  42. do_lavf mxf "-ar 48000" "-bf 2 -timecode_frame_start 264363"
  43. fi
  44. if [ -n "$do_mxf_d10" ]; then
  45. do_lavf mxf_d10 "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,pad=720:608:0:32 -c:v mpeg2video -g 0 -flags +ildct+low_delay -dc 10 -non_linear_quant 1 -intra_vlc 1 -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10"
  46. fi
  47. if [ -n "$do_ts" ] ; then
  48. do_lavf ts "" "-mpegts_transport_stream_id 42 -ar 44100"
  49. fi
  50. if [ -n "$do_swf" ] ; then
  51. do_lavf swf "" "-an"
  52. fi
  53. if [ -n "$do_flv_fmt" ] ; then
  54. do_lavf flv "" "-an"
  55. fi
  56. if [ -n "$do_mov" ] ; then
  57. do_lavf mov "" "-c:a pcm_alaw -c:v mpeg4"
  58. fi
  59. if [ -n "$do_dv_fmt" ] ; then
  60. do_lavf dv "-ar 48000 -channel_layout stereo" "-r 25 -s pal"
  61. fi
  62. if [ -n "$do_gxf" ] ; then
  63. do_lavf gxf "-ar 48000" "-r 25 -s pal -ac 1"
  64. fi
  65. if [ -n "$do_nut" ] ; then
  66. do_lavf nut "" "-c:a mp2 -ar 44100"
  67. fi
  68. if [ -n "$do_mkv" ] ; then
  69. do_lavf mkv "" "-c:a mp2 -c:v mpeg4 -ar 44100"
  70. fi
  71. # streamed images
  72. # mjpeg
  73. #file=${outfile}lavf.mjpeg
  74. #do_avconv $file -t 1 -qscale 10 -f image2 -c:v pgmyuv -i $raw_src
  75. #do_avconv_crc $file -i $target_path/$file
  76. if [ -n "$do_gif" ] ; then
  77. file=${outfile}lavf.gif
  78. do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24
  79. do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
  80. fi
  81. if [ -n "$do_yuv4mpeg" ] ; then
  82. file=${outfile}lavf.y4m
  83. do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10
  84. do_avconv_crc $file -i $target_path/$file
  85. fi
  86. # image formats
  87. if [ -n "$do_pgm" ] ; then
  88. do_image_formats pgm
  89. fi
  90. if [ -n "$do_ppm" ] ; then
  91. do_image_formats ppm
  92. fi
  93. if [ -n "$do_png" ] ; then
  94. do_image_formats png
  95. fi
  96. if [ -n "$do_bmp" ] ; then
  97. do_image_formats bmp
  98. fi
  99. if [ -n "$do_tga" ] ; then
  100. do_image_formats tga
  101. fi
  102. if [ -n "$do_tiff" ] ; then
  103. do_image_formats tiff "-pix_fmt rgb24"
  104. fi
  105. if [ -n "$do_sgi" ] ; then
  106. do_image_formats sgi
  107. fi
  108. if [ -n "$do_jpg" ] ; then
  109. do_image_formats jpg "-pix_fmt yuvj420p" "-f image2"
  110. fi
  111. if [ -n "$do_pam" ] ; then
  112. do_image_formats pam
  113. fi
  114. if [ -n "$do_pcx" ] ; then
  115. do_image_formats pcx
  116. fi
  117. if [ -n "$do_xwd" ] ; then
  118. do_image_formats xwd
  119. fi
  120. if [ -n "$do_dpx" ] ; then
  121. do_image_formats dpx
  122. fi
  123. if [ -n "$do_sunrast" ] ; then
  124. do_image_formats sun
  125. fi
  126. # pix_fmt conversions
  127. if [ -n "$do_pixfmt" ] ; then
  128. outfile="$datadir/pixfmt/"
  129. conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
  130. yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
  131. monob yuv440p yuvj440p"
  132. for pix_fmt in $conversions ; do
  133. file=${outfile}${pix_fmt}.yuv
  134. run_avconv $DEC_OPTS -r 1 -f image2 -c:v pgmyuv -i $raw_src \
  135. $ENC_OPTS -f rawvideo -t 1 -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
  136. do_avconv $file $DEC_OPTS -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
  137. $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt yuv444p
  138. done
  139. fi