From d795244d3e4dfb05535954dc7bab79817cc9426f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 4 Nov 2014 04:28:46 +0300 Subject: [PATCH] Move MPEG-specific parameters to vopts --- video/ff_encode | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/video/ff_encode b/video/ff_encode index 275417c..baef862 100755 --- a/video/ff_encode +++ b/video/ff_encode @@ -39,9 +39,13 @@ else output=output.avi fi +if [ "$vcodec" = mpeg4 ]; then + vopts="-g 300 -bf 2" +fi + if [ "$vcodec" = mpeg4-hq ]; then vcodec=mpeg4 - vopts="-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2" + vopts="-g 300 -bf 2 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2" fi if [ "$vcodec" = x264 ]; then @@ -59,11 +63,11 @@ if [ "$vcodec" = x264-vhq ]; then fi if [ "$pass" -eq 1 ]; then - exec ffmpeg $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -g 300 -bf 2 -c:a "$acodec" -b:a "$abitrate" $output_opts "$output" + exec ffmpeg $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -c:a "$acodec" -b:a "$abitrate" $output_opts "$output" elif [ "$pass" -eq 2 ]; then - ffmpeg -pass 1 $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -g 300 -bf 2 -an -f rawvideo -y /dev/null $output_opts && - exec ffmpeg -pass 2 $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -g 300 -bf 2 -c:a "$acodec" -b:a "$abitrate" $output_opts "$output" + ffmpeg -pass 1 $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -an -f rawvideo -y /dev/null $output_opts && + exec ffmpeg -pass 2 $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -c:a "$acodec" -b:a "$abitrate" $output_opts "$output" else echo "Can only do 1 or 2 passes." >&2 -- 2.39.2