summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-10-07 22:08:50 +0200
committerJonas Smedegaard <dr@jones.dk>2014-10-07 22:08:50 +0200
commitc8794fa313646dad7e4355a6dc1bf695f87bc1a9 (patch)
tree9fca5b5ba0687c23830f629a01fc0ce0299efd22 /localvideowebencode
parentd8261e71f059eff8f25eaf1a456398319bb640f1 (diff)
Use VBR (not CQ) mode for VP8/VP9 (now that bitrate is set sensibly so it actually works).
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode10
1 files changed, 6 insertions, 4 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 724a65d..a6576aa 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -201,9 +201,9 @@ fi
# resolve quality/speed hints
multipass=yes
qscale_theora=5
-crf_vp8=10
+#crf_vp8=10
cpu_vp8=2
-crf_vp9=10
+#crf_vp9=10
cpu_vp9=5
crf_h264=23
speedpreset_h264=medium
@@ -224,6 +224,8 @@ case "$compression" in
*) exit1 "Unknown compression mode \"$compression\".";;
esac
[ -n "$multipass" ] || singlepass=yes
+[ -n "$crf_vp8" ] || vbr_vp8=yes
+[ -n "$crf_vp9" ] || vbr_vp9=yes
# parse/resolve size and framerate
case "$profile" in
@@ -452,10 +454,10 @@ _melt_theora="vcodec=libtheora${bitrate:+ vb=$bitrate} qscale=$qscale_theora"
_melt_vp8="vcodec=libvpx vpreset=$sizepreset_vpx${bitrate_vp8:+ vb=$bitrate_vp8 minrate=$((bitrate_vp8/20)) maxrate=$((bitrate_vp8*12))} crf=$crf_vp8 cpu-used=$cpu_vp8"
_avconv_vp8="-c:v libvpx -pre:v $sizepreset_vpx${bitrate_vp8:+ -b:v $bitrate_vp8 -minrate $((bitrate_vp8/20)) -maxrate $((bitrate_vp8*12))} -crf $crf_vp8 -cpu-used $cpu_vp8"
_vpxenc_vpx="--min-q=$webm_qmin --max-q=$webm_qmax${multipass:+ --minsection-pct=5 --maxsection-pct=1200} --kf-max-dist=120 --auto-alt-ref=1 --lag-in-frames=$webm_lag --arnr-maxframes=7 --arnr-strength=5 --arnr-type=3"
-_vpxenc_vp8="--codec=vp8${bitrate_vp8:+ --target-bitrate=$((bitrate_vp8/1000))} --good --end-usage=cq --cq-level=$crf_vp8 --cpu-used=$cpu_vp8 $_vpxenc_vpx --token-parts=$webm_tokenparts_log2"
+_vpxenc_vp8="--codec=vp8${bitrate_vp8:+ --target-bitrate=$((bitrate_vp8/1000))} --good --end-usage=${vbr_vp8:+vbr}${crf_vp8:+cq --cq-level=$crf_vp8} --cpu-used=$cpu_vp8 $_vpxenc_vpx --token-parts=$webm_tokenparts_log2"
_melt_vp9="vcodec=libvpx-vp9 vpreset=$sizepreset_vpx${bitrate_vp9:+ vb=$bitrate_vp9 minrate=$((bitrate_vp9/20)) maxrate=$((bitrate_vp9*12))} crf=$crf_vp9 cpu-used=$cpu_vp9"
_avconv_vp9="-c:v libvpx-vp9 -pre:v $sizepreset_vpx${bitrate_vp9:+ -b:v $bitrate_vp9 -minrate $((bitrate_vp9/20)) -maxrate $((bitrate_vp9*12))} -crf $crf_vp9 -cpu-used $cpu_vp9"
-_vpxenc_vp9="--codec=vp9${bitrate_vp9:+ --target-bitrate=$((bitrate_vp9/1000))} --good --end-usage=cq --cq-level=$crf_vp9 --cpu-used=$cpu_vp9 $_vpxenc_vpx --tile-columns=$webm_tokenparts_log2 --tile-rows=$webm_tokenparts_log2"
+_vpxenc_vp9="--codec=vp9${bitrate_vp9:+ --target-bitrate=$((bitrate_vp9/1000))} --good --end-usage=${vbr_vp9:+vbr}${crf_vp9:+cq --cq-level=$crf_vp9} --cpu-used=$cpu_vp9 $_vpxenc_vpx --tile-columns=$webm_tokenparts_log2 --tile-rows=$webm_tokenparts_log2"
_melt_h264="vcodec=libx264 vpreset=$speedpreset_h264 vprofile=baseline${x264tune:+ tune=$x264tune} threads=0 movflags=+faststart crf=$crf_h264"
_melt_pcm="$_melt_downmix acodec=pcm_s16le"
_melt_vorbis="$_melt_downmix acodec=libvorbis aq=$quality_vorbis"