X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=inline;f=video%2Fff_encode;h=befff9db4fac7554034ae54982a5eca0d3765984;hb=7613b0295eb74910ca642b8ef030cb48bda61d17;hp=baef86223e2f75a80c5d00b5c89e76162bc047d1;hpb=d795244d3e4dfb05535954dc7bab79817cc9426f;p=audio-cdr-video.git diff --git a/video/ff_encode b/video/ff_encode index baef862..befff9d 100755 --- a/video/ff_encode +++ b/video/ff_encode @@ -41,33 +41,37 @@ fi if [ "$vcodec" = mpeg4 ]; then vopts="-g 300 -bf 2" -fi -if [ "$vcodec" = mpeg4-hq ]; then +elif [ "$vcodec" = mpeg4-hq ]; then vcodec=mpeg4 vopts="-g 300 -bf 2 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2" -fi -if [ "$vcodec" = x264 ]; then +elif [ "$vcodec" = mpeg4-vhq ]; then + vcodec=mpeg4 + vopts="-g 200 -bf 2 -mbd rd -flags +mv4+aic+qprd+mv0 -flags2 skiprd -trellis 2 -cmp 2 -subcmp 2" + +elif [ "$vcodec" = x264 ]; then vcodec=libx264 -fi -if [ "$vcodec" = x264-hq ]; then +elif [ "$vcodec" = x264-hq ]; then vcodec=libx264 vopts="-preset slow" -fi -if [ "$vcodec" = x264-vhq ]; then +elif [ "$vcodec" = x264-vhq ]; then vcodec=libx264 vopts="-preset veryslow" + +else + echo "Unknown video codec $vcodec; known codecs are {mpeg4,x264}[-[v]hq], copy" >&2 + exit 1 fi if [ "$pass" -eq 1 ]; then - exec ffmpeg $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -c:a "$acodec" -b:a "$abitrate" $output_opts "$output" + exec ffmpeg -threads auto $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" -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" + ffmpeg -pass 1 -threads auto $input_opts -i "$input" -c:v "$vcodec" $vopts $vscale -b:v "$vbitrate" -an -f rawvideo -y /dev/null $output_opts && + exec ffmpeg -pass 2 -threads auto $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