summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-02-09 02:50:03 +0100
committerJonas Smedegaard <dr@jones.dk>2021-02-09 03:00:07 +0100
commit0bcd710bdd37707ee92d8ed751878fb0c0183958 (patch)
tree6e9d22a1ce6d0177a8f2645655f45ba824c781d4 /localvideowebencode
parent0004e32da94cfce8823a5b4a342b7ba087120116 (diff)
fix several bugs in multipass mode
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode14
1 files changed, 7 insertions, 7 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 4d24b89..cbcbdc8 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -577,7 +577,7 @@ for vformat in vp8 vp9 avc; do
eval "[ -n \"\$q_$vformat\" ] || no_q_$vformat=yes"
[ -z "$gpu" ] || eval "[ -n \"\$no_gpu_encoder_$vformat\" ] || encoder_$vformat=${vformat}_$gpu"
[ avc = "$vformat" ] || eval "[ -n \"$use_vpxenc\$use_ffmpeg_$vformat\" ] || use_melt_$vformat=yes"
- [ -z "$multipass" ] || eval "[ -n \"\$no_multipass_$vformat\" ] || multipast_$vformat=yes"
+ [ -z "$multipass" ] || eval "[ -n \"\$no_multipass_$vformat\" ] || multipass_$vformat=yes"
eval "[ -n \"\$multipass_$vformat\" ] || singlepass_$vformat=yes"
done
if [ -n "$use_ffmpeg_vp8$use_ffmpeg_vp9$use_vpxenc" ]; then
@@ -660,20 +660,20 @@ _melt_postfilters_audio="${limit:+-filter ladspa.1077}"
# format bitrate options
_melt_bitrate_vp8="${do_bitrate_vp8:+ vb=$bitrate_vp8 minrate=$((bitrate_vp8/20)) maxrate=$((bitrate_vp8*12))}"
_ffmpeg_bitrate_vp8="${do_bitrate_vp8:+ -b:v $bitrate_vp8 -minrate $((bitrate_vp8/20)) -maxrate $((bitrate_vp8*12))}"
-_vpxenc_bitrate_vp8="${do_bitrate_vp8:+ --target-bitrate=$((bitrate_vp8/1000)) --minsection-pct=5 --maxsection-pct=1200}"
+_vpxenc_bitrate_vp8="${do_bitrate_vp8:+ --target-bitrate=$((bitrate_vp8/1000))${multipass_vp8:+ --minsection-pct=5 --maxsection-pct=1200}}"
_melt_bitrate_vp9="${do_bitrate_vp9:+ vb=$bitrate_vp9 minrate=$((bitrate_vp9/20)) maxrate=$((bitrate_vp9*12))}"
_ffmpeg_bitrate_vp9="${do_bitrate_vp9:+ -b:v $bitrate_vp9 -minrate $((bitrate_vp9/20)) -maxrate $((bitrate_vp9*12))}"
-_vpxenc_bitrate_vp9="${do_bitrate_vp9:+ --target-bitrate=$((bitrate_vp9/1000)) --minsection-pct=5 --maxsection-pct=1200}"
+_vpxenc_bitrate_vp9="${do_bitrate_vp9:+ --target-bitrate=$((bitrate_vp9/1000))${multipass_vp9:+ --minsection-pct=5 --maxsection-pct=1200}}"
_melt_bitrate_avc="${do_bitrate_avc:+ maxrate=$bitrate_avc${no_gpu:+ bufsize=$((bitrate_avc*2))}}"
_ffmpeg_bitrate_avc="${do_bitrate_avc:+ -maxrate $bitrate_avc${no_gpu:+ -bufsize $((bitrate_avc*2))}}"
# format low-level options
_melt_misc_vp8=" qmin=$qmin_vp8 qmax=$qmax_vp8 g=120 deadline=good cpu-used=$cpu_vp8${profile_vp8:+ vprofile=$profile_vp8} auto-alt-ref=1 lag-in-frames=$lag_vp8 arnr-maxframes=7 arnr-strength=5 arnr-type=centered"
_ffmpeg_misc_vp8=" -qmin $qmin_vp8 -qmax $qmax_vp8 -g 120 -deadline good -cpu-used $cpu_vp8${profile_vp8:+ -profile:v $profile_vp8} -auto-alt-ref 1 -lag-in-frames $lag_vp8 -arnr-maxframes 7 -arnr-strength 5 -arnr-type centered"
-_vpxenc_misc_vp8="${multipass_vp8:+ --passes=2} --min-q=$qmin_vp8 --max-q=$qmax_vp8 --kf-max-dist=120 --good --cpu-used=$cpu_vp8${profile_vp8:+ --profile=$profile_vp8} --token-parts=$tokenparts_log2_vp8 --auto-alt-ref=1 --lag-in-frames=$lag_vp8 --arnr-maxframes=7 --arnr-strength=5 --arnr-type=3"
+_vpxenc_misc_vp8=" --passes=${singlepass_vp8:+1}${multipass_vp8:+2} --min-q=$qmin_vp8 --max-q=$qmax_vp8 --kf-max-dist=120 --good --cpu-used=$cpu_vp8${profile_vp8:+ --profile=$profile_vp8} --token-parts=$tokenparts_log2_vp8 --auto-alt-ref=1 --lag-in-frames=$lag_vp8 --arnr-maxframes=7 --arnr-strength=5 --arnr-type=3"
_melt_misc_vp9=" qmin=$qmin_vp9 qmax=$qmax_vp9 g=120 deadline=good cpu-used=$cpu_vp9${profile_vp9:+ vprofile=$profile_vp9} auto-alt-ref=1 lag-in-frames=$lag_vp9 arnr-maxframes=7 arnr-strength=5 arnr-type=centered"
_ffmpeg_misc_vp9=" -qmin $qmin_vp9 -qmax $qmax_vp9 -g 120 -deadline good -cpu-used $cpu_vp9${profile_vp9:+ -profile:v $profile_vp9} -auto-alt-ref 1 -lag-in-frames $lag_vp9 -arnr-maxframes 7 -arnr-strength 5 -arnr-type centered"
-_vpxenc_misc_vp9="${singlepass_vp9:+ --passes=1} --min-q=$qmin_vp9 --max-q=$qmax_vp9 --kf-max-dist=120 --good --cpu-used=$cpu_vp9${profile_vp9:+ --profile=$profile_vp9} --tile-columns=$tokenparts_log2_vp9 --tile-rows=$tokenparts_log2_vp9 --auto-alt-ref=1 --lag-in-frames=$lag_vp9 --arnr-maxframes=7 --arnr-strength=5 --arnr-type=3"
+_vpxenc_misc_vp9=" --passes=${singlepass_vp9:+1}${multipass_vp9:+2} --min-q=$qmin_vp9 --max-q=$qmax_vp9 --kf-max-dist=120 --good --cpu-used=$cpu_vp9${profile_vp9:+ --profile=$profile_vp9} --tile-columns=$tokenparts_log2_vp9 --tile-rows=$tokenparts_log2_vp9 --auto-alt-ref=1 --lag-in-frames=$lag_vp9 --arnr-maxframes=7 --arnr-strength=5 --arnr-type=3"
_melt_misc_avc="${no_gpu:+ movflags=+faststart}"
_ffmpeg_misc_avc="${no_gpu:+ -movflags +faststart}"
@@ -750,7 +750,7 @@ if [ -n "${webm:+$multipass_vp8}${webm_vp9:+$multipass_vp9}${mp4:+$multipass_avc
${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \
pass=1 passlogfile=${stem}_vp9}} \
${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4 \
- pass=1 passlogfile=${stem}_vp8}} \
+ pass=1 passlogfile=${stem}_avc}} \
| pee \
${any_ffmpeg:+"$(render ffmpeg-chained-echo $_ffmpeg_stdin \
${webm:+${use_ffmpeg_vp8:+$_ffmpeg_rawvideo $_ffmpeg_vp8 -an \
@@ -777,7 +777,7 @@ fi
${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \
${multipass_vp9:+pass=2 passlogfile=${stem}_vp9}}} \
${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4
- ${multipass_avc:+pass=2 passlogfile=${stem}_vp8}}} \
+ ${multipass_avc:+pass=2 passlogfile=${stem}_avc}}} \
${channels:+${use_wav:+-consumer avformat:$stem.wav \
$_melt_wav}} \
${channels:+${use_matroska:+-consumer avformat:$stem.mkv \