mirror of https://git.ffmpeg.org/ffmpeg.git
Make do_video_encoding general enough to accomodate all cases.
Originally committed as revision 7212 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
5e5ac8e0a5
commit
a2377bb0b4
|
@ -163,7 +163,7 @@ do_video_decoding()
|
|||
do_video_encoding()
|
||||
{
|
||||
file=${outfile}$1
|
||||
do_ffmpeg $file -y $2 -f pgmyuv -i $raw_src $3 $file
|
||||
do_ffmpeg $file -y $2 -f $3 -i $raw_src $4 $file
|
||||
}
|
||||
|
||||
do_audio_encoding()
|
||||
|
@ -218,7 +218,7 @@ do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wa
|
|||
###################################
|
||||
if [ -n "$do_mpeg" ] ; then
|
||||
# mpeg1 encoding
|
||||
do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
|
||||
do_video_encoding mpeg1.mpg "-qscale 10" pgmyuv "-f mpeg1video"
|
||||
|
||||
# mpeg1 decoding
|
||||
do_video_decoding
|
||||
|
@ -227,25 +227,25 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg2" ] ; then
|
||||
# mpeg2 encoding
|
||||
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
|
||||
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video"
|
||||
|
||||
# mpeg2 decoding
|
||||
do_video_decoding
|
||||
|
||||
# mpeg2 encoding using intra vlc
|
||||
do_video_encoding mpeg2ivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags2 +ivlc"
|
||||
do_video_encoding mpeg2ivlc.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -flags2 +ivlc"
|
||||
|
||||
# mpeg2 decoding
|
||||
do_video_decoding
|
||||
|
||||
# mpeg2 encoding
|
||||
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
|
||||
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
|
||||
|
||||
# mpeg2 decoding
|
||||
do_video_decoding "-idct int"
|
||||
|
||||
# mpeg2 encoding interlaced
|
||||
do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
|
||||
do_video_encoding mpeg2i.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
|
||||
|
||||
# mpeg2 decoding
|
||||
do_video_decoding
|
||||
|
@ -254,13 +254,13 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg2thread" ] ; then
|
||||
# mpeg2 encoding interlaced
|
||||
do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
|
||||
do_video_encoding mpeg2thread.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
|
||||
|
||||
# mpeg2 decoding
|
||||
do_video_decoding
|
||||
|
||||
# mpeg2 encoding interlaced using intra vlc
|
||||
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
|
||||
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
|
||||
|
||||
# mpeg2 decoding
|
||||
do_video_decoding
|
||||
|
@ -276,7 +276,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_msmpeg4v2" ] ; then
|
||||
# msmpeg4 encoding
|
||||
do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
|
||||
do_video_encoding msmpeg4v2.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4v2"
|
||||
|
||||
# msmpeg4v2 decoding
|
||||
do_video_decoding
|
||||
|
@ -285,7 +285,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_msmpeg4" ] ; then
|
||||
# msmpeg4 encoding
|
||||
do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
|
||||
do_video_encoding msmpeg4.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4"
|
||||
|
||||
# msmpeg4 decoding
|
||||
do_video_decoding
|
||||
|
@ -294,7 +294,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_wmv1" ] ; then
|
||||
# wmv1 encoding
|
||||
do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
|
||||
do_video_encoding wmv1.avi "-qscale 10" pgmyuv "-an -vcodec wmv1"
|
||||
|
||||
# wmv1 decoding
|
||||
do_video_decoding
|
||||
|
@ -303,7 +303,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_wmv2" ] ; then
|
||||
# wmv2 encoding
|
||||
do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
|
||||
do_video_encoding wmv2.avi "-qscale 10" pgmyuv "-an -vcodec wmv2"
|
||||
|
||||
# wmv2 decoding
|
||||
do_video_decoding
|
||||
|
@ -312,7 +312,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_h261" ] ; then
|
||||
# h261 encoding
|
||||
do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
|
||||
do_video_encoding h261.avi "-qscale 11" pgmyuv "-s 352x288 -an -vcodec h261"
|
||||
|
||||
# h261 decoding
|
||||
do_video_decoding
|
||||
|
@ -321,7 +321,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_h263" ] ; then
|
||||
# h263 encoding
|
||||
do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
|
||||
do_video_encoding h263.avi "-qscale 10" pgmyuv "-s 352x288 -an -vcodec h263"
|
||||
|
||||
# h263 decoding
|
||||
do_video_decoding
|
||||
|
@ -330,7 +330,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_h263p" ] ; then
|
||||
# h263p encoding
|
||||
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
|
||||
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" pgmyuv "-s 352x288 -an -vcodec h263p -ps 300"
|
||||
|
||||
# h263p decoding
|
||||
do_video_decoding
|
||||
|
@ -339,7 +339,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg4" ] ; then
|
||||
# mpeg4
|
||||
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
|
||||
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" pgmyuv "-an -vcodec mpeg4"
|
||||
|
||||
# mpeg4 decoding
|
||||
do_video_decoding
|
||||
|
@ -348,7 +348,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_huffyuv" ] ; then
|
||||
# huffyuv
|
||||
do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p"
|
||||
do_video_encoding huffyuv.avi "" pgmyuv "-an -vcodec huffyuv -pix_fmt yuv422p"
|
||||
|
||||
# huffyuv decoding
|
||||
do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
|
||||
|
@ -357,7 +357,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_rc" ] ; then
|
||||
# mpeg4 rate control
|
||||
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
|
||||
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" pgmyuv "-an -vcodec mpeg4"
|
||||
|
||||
# mpeg4 rate control decoding
|
||||
do_video_decoding
|
||||
|
@ -366,7 +366,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg4adv" ] ; then
|
||||
# mpeg4
|
||||
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" "-an -vcodec mpeg4"
|
||||
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" pgmyuv "-an -vcodec mpeg4"
|
||||
|
||||
# mpeg4 decoding
|
||||
do_video_decoding
|
||||
|
@ -375,7 +375,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg4thread" ] ; then
|
||||
# mpeg4
|
||||
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
|
||||
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" pgmyuv "-an -vcodec mpeg4 -threads 2"
|
||||
|
||||
# mpeg4 decoding
|
||||
do_video_decoding
|
||||
|
@ -384,7 +384,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg4adv" ] ; then
|
||||
# mpeg4
|
||||
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
|
||||
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" pgmyuv "-an -vcodec mpeg4"
|
||||
|
||||
# mpeg4 decoding
|
||||
do_video_decoding
|
||||
|
@ -393,14 +393,13 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mp4psp" ] ; then
|
||||
# mp4 PSP style
|
||||
file=${outfile}mpeg4-PSP.mp4
|
||||
do_ffmpeg $file -y -b 768k -s 320x240 -f psp -ar 24000 -ab 32 -i $raw_src $file
|
||||
do_video_encoding mpeg4-PSP.mp4 "-b 768k -s 320x240" psp "-ar 24000 -ab 32 -i $raw_src"
|
||||
fi
|
||||
|
||||
###################################
|
||||
if [ -n "$do_error" ] ; then
|
||||
# damaged mpeg4
|
||||
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
|
||||
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" pgmyuv "-an -vcodec mpeg4"
|
||||
|
||||
# damaged mpeg4 decoding
|
||||
do_video_decoding
|
||||
|
@ -409,7 +408,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg4nr" ] ; then
|
||||
# noise reduction
|
||||
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
|
||||
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" pgmyuv "-an -vcodec mpeg4"
|
||||
|
||||
# mpeg4 decoding
|
||||
do_video_decoding
|
||||
|
@ -418,7 +417,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mpeg1b" ] ; then
|
||||
# mpeg1
|
||||
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
|
||||
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" pgmyuv "-an -vcodec mpeg1video -f mpeg1video"
|
||||
|
||||
# mpeg1 decoding
|
||||
do_video_decoding
|
||||
|
@ -427,7 +426,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_mjpeg" ] ; then
|
||||
# mjpeg
|
||||
do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
|
||||
do_video_encoding mjpeg.avi "-qscale 10" pgmyuv "-an -vcodec mjpeg -pix_fmt yuvj420p"
|
||||
|
||||
# mjpeg decoding
|
||||
do_video_decoding "" "-pix_fmt yuv420p"
|
||||
|
@ -436,7 +435,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_ljpeg" ] ; then
|
||||
# ljpeg
|
||||
do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
|
||||
do_video_encoding ljpeg.avi "" pgmyuv "-an -vcodec ljpeg -strict -1"
|
||||
|
||||
# ljpeg decoding
|
||||
do_video_decoding
|
||||
|
@ -445,7 +444,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_jpegls" ] ; then
|
||||
# jpeg ls
|
||||
do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG"
|
||||
do_video_encoding jpegls.avi "" pgmyuv "-an -vcodec jpegls -vtag MJPG"
|
||||
|
||||
# jpeg ls decoding
|
||||
do_video_decoding "" "-pix_fmt yuv420p"
|
||||
|
@ -454,7 +453,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_rv10" ] ; then
|
||||
# rv10 encoding
|
||||
do_video_encoding rv10.rm "-qscale 10" "-an"
|
||||
do_video_encoding rv10.rm "-qscale 10" pgmyuv "-an"
|
||||
|
||||
# rv10 decoding
|
||||
do_video_decoding
|
||||
|
@ -463,7 +462,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_rv20" ] ; then
|
||||
# rv20 encoding
|
||||
do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
|
||||
do_video_encoding rv20.rm "-qscale 10" pgmyuv "-vcodec rv20 -an"
|
||||
|
||||
# rv20 decoding
|
||||
do_video_decoding
|
||||
|
@ -472,7 +471,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_asv1" ] ; then
|
||||
# asv1 encoding
|
||||
do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
|
||||
do_video_encoding asv1.avi "-qscale 10" pgmyuv "-an -vcodec asv1"
|
||||
|
||||
# asv1 decoding
|
||||
do_video_decoding
|
||||
|
@ -481,7 +480,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_asv2" ] ; then
|
||||
# asv2 encoding
|
||||
do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
|
||||
do_video_encoding asv2.avi "-qscale 10" pgmyuv "-an -vcodec asv2"
|
||||
|
||||
# asv2 decoding
|
||||
do_video_decoding
|
||||
|
@ -490,7 +489,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_flv" ] ; then
|
||||
# flv encoding
|
||||
do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
|
||||
do_video_encoding flv.flv "-qscale 10" pgmyuv "-an -vcodec flv"
|
||||
|
||||
# flv decoding
|
||||
do_video_decoding
|
||||
|
@ -499,7 +498,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_ffv1" ] ; then
|
||||
# ffv1 encoding
|
||||
do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
|
||||
do_video_encoding ffv1.avi "-strict -2" pgmyuv "-an -vcodec ffv1"
|
||||
|
||||
# ffv1 decoding
|
||||
do_video_decoding
|
||||
|
@ -508,7 +507,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_snow" ] ; then
|
||||
# snow encoding
|
||||
do_video_encoding snow.avi "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
|
||||
do_video_encoding snow.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
|
||||
|
||||
# snow decoding
|
||||
do_video_decoding "" "-s 352x288"
|
||||
|
@ -517,7 +516,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_snowll" ] ; then
|
||||
# snow encoding
|
||||
do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
|
||||
do_video_encoding snow53.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
|
||||
|
||||
# snow decoding
|
||||
do_video_decoding
|
||||
|
@ -526,7 +525,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_dv" ] ; then
|
||||
# dv encoding
|
||||
do_video_encoding dv.dv "-dct int" "-s pal -an"
|
||||
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -an"
|
||||
|
||||
# dv decoding
|
||||
do_video_decoding "" "-s cif"
|
||||
|
@ -535,7 +534,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_dv50" ] ; then
|
||||
# dv50 encoding
|
||||
do_video_encoding dv.dv "-dct int" "-s pal -pix_fmt yuv422p -an"
|
||||
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -pix_fmt yuv422p -an"
|
||||
|
||||
# dv50 decoding
|
||||
do_video_decoding "" "-s cif -pix_fmt yuv420p"
|
||||
|
@ -545,7 +544,7 @@ fi
|
|||
###################################
|
||||
if [ -n "$do_svq1" ] ; then
|
||||
# svq1 encoding
|
||||
do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
|
||||
do_video_encoding svq1.mov "" pgmyuv "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
|
||||
|
||||
# svq1 decoding
|
||||
do_video_decoding "" "-pix_fmt yuv420p"
|
||||
|
|
Loading…
Reference in New Issue