Commit 178aef82 authored by diego's avatar diego

Make do_video_encoding general enough to accomodate all cases.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7212 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 66c83f7f
...@@ -163,7 +163,7 @@ do_video_decoding() ...@@ -163,7 +163,7 @@ do_video_decoding()
do_video_encoding() do_video_encoding()
{ {
file=${outfile}$1 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() 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 ...@@ -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 if [ -n "$do_mpeg" ] ; then
# mpeg1 encoding # mpeg1 encoding
do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video" do_video_encoding mpeg1.mpg "-qscale 10" pgmyuv "-f mpeg1video"
# mpeg1 decoding # mpeg1 decoding
do_video_decoding do_video_decoding
...@@ -227,25 +227,25 @@ fi ...@@ -227,25 +227,25 @@ fi
################################### ###################################
if [ -n "$do_mpeg2" ] ; then if [ -n "$do_mpeg2" ] ; then
# mpeg2 encoding # 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 # mpeg2 decoding
do_video_decoding do_video_decoding
# mpeg2 encoding using intra vlc # 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 # mpeg2 decoding
do_video_decoding do_video_decoding
# mpeg2 encoding # 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 # mpeg2 decoding
do_video_decoding "-idct int" do_video_decoding "-idct int"
# mpeg2 encoding interlaced # 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 # mpeg2 decoding
do_video_decoding do_video_decoding
...@@ -254,13 +254,13 @@ fi ...@@ -254,13 +254,13 @@ fi
################################### ###################################
if [ -n "$do_mpeg2thread" ] ; then if [ -n "$do_mpeg2thread" ] ; then
# mpeg2 encoding interlaced # 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 # mpeg2 decoding
do_video_decoding do_video_decoding
# mpeg2 encoding interlaced using intra vlc # 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 # mpeg2 decoding
do_video_decoding do_video_decoding
...@@ -276,7 +276,7 @@ fi ...@@ -276,7 +276,7 @@ fi
################################### ###################################
if [ -n "$do_msmpeg4v2" ] ; then if [ -n "$do_msmpeg4v2" ] ; then
# msmpeg4 encoding # 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 # msmpeg4v2 decoding
do_video_decoding do_video_decoding
...@@ -285,7 +285,7 @@ fi ...@@ -285,7 +285,7 @@ fi
################################### ###################################
if [ -n "$do_msmpeg4" ] ; then if [ -n "$do_msmpeg4" ] ; then
# msmpeg4 encoding # 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 # msmpeg4 decoding
do_video_decoding do_video_decoding
...@@ -294,7 +294,7 @@ fi ...@@ -294,7 +294,7 @@ fi
################################### ###################################
if [ -n "$do_wmv1" ] ; then if [ -n "$do_wmv1" ] ; then
# wmv1 encoding # 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 # wmv1 decoding
do_video_decoding do_video_decoding
...@@ -303,7 +303,7 @@ fi ...@@ -303,7 +303,7 @@ fi
################################### ###################################
if [ -n "$do_wmv2" ] ; then if [ -n "$do_wmv2" ] ; then
# wmv2 encoding # 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 # wmv2 decoding
do_video_decoding do_video_decoding
...@@ -312,7 +312,7 @@ fi ...@@ -312,7 +312,7 @@ fi
################################### ###################################
if [ -n "$do_h261" ] ; then if [ -n "$do_h261" ] ; then
# h261 encoding # 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 # h261 decoding
do_video_decoding do_video_decoding
...@@ -321,7 +321,7 @@ fi ...@@ -321,7 +321,7 @@ fi
################################### ###################################
if [ -n "$do_h263" ] ; then if [ -n "$do_h263" ] ; then
# h263 encoding # 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 # h263 decoding
do_video_decoding do_video_decoding
...@@ -330,7 +330,7 @@ fi ...@@ -330,7 +330,7 @@ fi
################################### ###################################
if [ -n "$do_h263p" ] ; then if [ -n "$do_h263p" ] ; then
# h263p encoding # 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 # h263p decoding
do_video_decoding do_video_decoding
...@@ -339,7 +339,7 @@ fi ...@@ -339,7 +339,7 @@ fi
################################### ###################################
if [ -n "$do_mpeg4" ] ; then if [ -n "$do_mpeg4" ] ; then
# mpeg4 # 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 # mpeg4 decoding
do_video_decoding do_video_decoding
...@@ -348,7 +348,7 @@ fi ...@@ -348,7 +348,7 @@ fi
################################### ###################################
if [ -n "$do_huffyuv" ] ; then if [ -n "$do_huffyuv" ] ; then
# huffyuv # 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 # huffyuv decoding
do_video_decoding "" "-strict -2 -pix_fmt yuv420p" do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
...@@ -357,7 +357,7 @@ fi ...@@ -357,7 +357,7 @@ fi
################################### ###################################
if [ -n "$do_rc" ] ; then if [ -n "$do_rc" ] ; then
# mpeg4 rate control # 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 # mpeg4 rate control decoding
do_video_decoding do_video_decoding
...@@ -366,7 +366,7 @@ fi ...@@ -366,7 +366,7 @@ fi
################################### ###################################
if [ -n "$do_mpeg4adv" ] ; then if [ -n "$do_mpeg4adv" ] ; then
# mpeg4 # 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 # mpeg4 decoding
do_video_decoding do_video_decoding
...@@ -375,7 +375,7 @@ fi ...@@ -375,7 +375,7 @@ fi
################################### ###################################
if [ -n "$do_mpeg4thread" ] ; then if [ -n "$do_mpeg4thread" ] ; then
# mpeg4 # 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 # mpeg4 decoding
do_video_decoding do_video_decoding
...@@ -384,7 +384,7 @@ fi ...@@ -384,7 +384,7 @@ fi
################################### ###################################
if [ -n "$do_mpeg4adv" ] ; then if [ -n "$do_mpeg4adv" ] ; then
# mpeg4 # 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 # mpeg4 decoding
do_video_decoding do_video_decoding
...@@ -393,14 +393,13 @@ fi ...@@ -393,14 +393,13 @@ fi
################################### ###################################
if [ -n "$do_mp4psp" ] ; then if [ -n "$do_mp4psp" ] ; then
# mp4 PSP style # mp4 PSP style
file=${outfile}mpeg4-PSP.mp4 do_video_encoding mpeg4-PSP.mp4 "-b 768k -s 320x240" psp "-ar 24000 -ab 32 -i $raw_src"
do_ffmpeg $file -y -b 768k -s 320x240 -f psp -ar 24000 -ab 32 -i $raw_src $file
fi fi
################################### ###################################
if [ -n "$do_error" ] ; then if [ -n "$do_error" ] ; then
# damaged mpeg4 # 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 # damaged mpeg4 decoding
do_video_decoding do_video_decoding
...@@ -409,7 +408,7 @@ fi ...@@ -409,7 +408,7 @@ fi
################################### ###################################
if [ -n "$do_mpeg4nr" ] ; then if [ -n "$do_mpeg4nr" ] ; then
# noise reduction # 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 # mpeg4 decoding
do_video_decoding do_video_decoding
...@@ -418,7 +417,7 @@ fi ...@@ -418,7 +417,7 @@ fi
################################### ###################################
if [ -n "$do_mpeg1b" ] ; then if [ -n "$do_mpeg1b" ] ; then
# mpeg1 # 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 # mpeg1 decoding
do_video_decoding do_video_decoding
...@@ -427,7 +426,7 @@ fi ...@@ -427,7 +426,7 @@ fi
################################### ###################################
if [ -n "$do_mjpeg" ] ; then if [ -n "$do_mjpeg" ] ; then
# mjpeg # 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 # mjpeg decoding
do_video_decoding "" "-pix_fmt yuv420p" do_video_decoding "" "-pix_fmt yuv420p"
...@@ -436,7 +435,7 @@ fi ...@@ -436,7 +435,7 @@ fi
################################### ###################################
if [ -n "$do_ljpeg" ] ; then if [ -n "$do_ljpeg" ] ; then
# ljpeg # ljpeg
do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1" do_video_encoding ljpeg.avi "" pgmyuv "-an -vcodec ljpeg -strict -1"
# ljpeg decoding # ljpeg decoding
do_video_decoding do_video_decoding
...@@ -445,7 +444,7 @@ fi ...@@ -445,7 +444,7 @@ fi
################################### ###################################
if [ -n "$do_jpegls" ] ; then if [ -n "$do_jpegls" ] ; then
# jpeg ls # 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 # jpeg ls decoding
do_video_decoding "" "-pix_fmt yuv420p" do_video_decoding "" "-pix_fmt yuv420p"
...@@ -454,7 +453,7 @@ fi ...@@ -454,7 +453,7 @@ fi
################################### ###################################
if [ -n "$do_rv10" ] ; then if [ -n "$do_rv10" ] ; then
# rv10 encoding # rv10 encoding
do_video_encoding rv10.rm "-qscale 10" "-an" do_video_encoding rv10.rm "-qscale 10" pgmyuv "-an"
# rv10 decoding # rv10 decoding
do_video_decoding do_video_decoding
...@@ -463,7 +462,7 @@ fi ...@@ -463,7 +462,7 @@ fi
################################### ###################################
if [ -n "$do_rv20" ] ; then if [ -n "$do_rv20" ] ; then
# rv20 encoding # 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 # rv20 decoding
do_video_decoding do_video_decoding
...@@ -472,7 +471,7 @@ fi ...@@ -472,7 +471,7 @@ fi
################################### ###################################
if [ -n "$do_asv1" ] ; then if [ -n "$do_asv1" ] ; then
# asv1 encoding # 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 # asv1 decoding
do_video_decoding do_video_decoding
...@@ -481,7 +480,7 @@ fi ...@@ -481,7 +480,7 @@ fi
################################### ###################################
if [ -n "$do_asv2" ] ; then if [ -n "$do_asv2" ] ; then
# asv2 encoding # 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 # asv2 decoding
do_video_decoding do_video_decoding
...@@ -490,7 +489,7 @@ fi ...@@ -490,7 +489,7 @@ fi
################################### ###################################
if [ -n "$do_flv" ] ; then if [ -n "$do_flv" ] ; then
# flv encoding # 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 # flv decoding
do_video_decoding do_video_decoding
...@@ -499,7 +498,7 @@ fi ...@@ -499,7 +498,7 @@ fi
################################### ###################################
if [ -n "$do_ffv1" ] ; then if [ -n "$do_ffv1" ] ; then
# ffv1 encoding # 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 # ffv1 decoding
do_video_decoding do_video_decoding
...@@ -508,7 +507,7 @@ fi ...@@ -508,7 +507,7 @@ fi
################################### ###################################
if [ -n "$do_snow" ] ; then if [ -n "$do_snow" ] ; then
# snow encoding # 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 # snow decoding
do_video_decoding "" "-s 352x288" do_video_decoding "" "-s 352x288"
...@@ -517,7 +516,7 @@ fi ...@@ -517,7 +516,7 @@ fi
################################### ###################################
if [ -n "$do_snowll" ] ; then if [ -n "$do_snowll" ] ; then
# snow encoding # 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 # snow decoding
do_video_decoding do_video_decoding
...@@ -526,7 +525,7 @@ fi ...@@ -526,7 +525,7 @@ fi
################################### ###################################
if [ -n "$do_dv" ] ; then if [ -n "$do_dv" ] ; then
# dv encoding # 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 # dv decoding
do_video_decoding "" "-s cif" do_video_decoding "" "-s cif"
...@@ -535,7 +534,7 @@ fi ...@@ -535,7 +534,7 @@ fi
################################### ###################################
if [ -n "$do_dv50" ] ; then if [ -n "$do_dv50" ] ; then
# dv50 encoding # 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 # dv50 decoding
do_video_decoding "" "-s cif -pix_fmt yuv420p" do_video_decoding "" "-s cif -pix_fmt yuv420p"
...@@ -545,7 +544,7 @@ fi ...@@ -545,7 +544,7 @@ fi
################################### ###################################
if [ -n "$do_svq1" ] ; then if [ -n "$do_svq1" ] ; then
# svq1 encoding # 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 # svq1 decoding
do_video_decoding "" "-pix_fmt yuv420p" do_video_decoding "" "-pix_fmt yuv420p"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment