summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-02-04 22:29:39 +0100
committerJonas Smedegaard <dr@jones.dk>2021-02-04 22:44:57 +0100
commit685ef4f386be7436f6e49eb5129c222a203f353f (patch)
treee3f026a00404651aa8888aee94c67e132a3c72f8 /localvideowebencode
parent8ccb32ee517685231b7990d9b08b59bb2710c608 (diff)
fix support Constant Quality with ffmpeg, by avoiding option -pre (includes bitrate options impossible to undo, causing error 'Rate control parameters set without a bitrate'
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode14
1 files changed, 8 insertions, 6 deletions
diff --git a/localvideowebencode b/localvideowebencode
index cac9098..402562a 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -237,6 +237,8 @@ cpu_vp8=2
cpu_vp9=5
q_h264=23
preset_h264=medium
+profile_vp8=0
+profile_vp9=0
profile_h264=baseline
case "$compression" in
normal) :;;
@@ -374,22 +376,18 @@ if [ -n "$_width" ] && [ -n "$_height" ]; then
fi
_frames="${framerate:-$framerate_in}"
-pre_vp8=libvpx-360p
-pre_vp9=libvpx-360p
webm_qmin=0
webm_qmax=63
webm_lag=16
webm_tokenparts_log2=0
if [ -n "$_pixels" ] && [ $_pixels -ge $((1024*768)) ]; then
- pre_vp8=libvpx-720p
- pre_vp9=libvpx-720p
webm_qmin=11
webm_qmax=51
webm_tokenparts_log2=2
if [ -n "$_frames" ] && [ $_frames -gt 40 ]; then
- pre_vp8=libvpx-720p50_60
- pre_vp9=libvpx-720p50_60
webm_lag=25
+ profile_vp8=1
+ profile_vp9=1
fi
fi
@@ -516,7 +514,11 @@ _ffmpeg_bitrate_vp9="${no_q_vp9:+-b:v $bitrate_vp9} -minrate $((bitrate_vp9/20))
_vpxenc_bitrate_vp9="--target-bitrate=$((bitrate_vp9/1000)) --minsection-pct=5 --maxsection-pct=1200"
# codec low-level options
+_melt_misc_vp8="qmin=$webm_qmin qmax=$webm_qmax g=120 deadline=good${profile_vp8:+ profile=$profile_vp8} auto-alt-ref=1 lag-in-frames=$webm_lag arnr-maxframes=7 arnr-strength=5 arnr-type=centered"
+_ffmpeg_misc_vp8="-qmin=$webm_qmin --max-q=$webm_qmax -g 120 -deadline good${profile_vp8:+ -profile=$profile_vp8} -auto-alt-ref 1 -lag-in-frames $webm_lag -arnr-maxframes 7 -arnr-strength 5 -arnr-type centered"
_vpxenc_misc_vp8="--min-q=$webm_qmin --max-q=$webm_qmax --kf-max-dist=120${profile_vp8:+ --profile=$profile_vp8} --token-parts=$webm_tokenparts_log2 --auto-alt-ref=1 --lag-in-frames=$webm_lag --arnr-maxframes=7 --arnr-strength=5 --arnr-type=3"
+_melt_misc_vp9="qmin=$webm_qmin qmax=$webm_qmax g=120 deadline=good${profile_vp9:+ profile=$profile_vp9} auto-alt-ref=1 lag-in-frames=$webm_lag arnr-maxframes=7 arnr-strength=5 arnr-type=centered"
+_ffmpeg_misc_vp9="-qmin=$webm_qmin --max-q=$webm_qmax -g 120 -deadline good${profile_vp9:+ -profile $profile_vp9} -auto-alt-ref 1 -lag-in-frames $webm_lag -arnr-maxframes 7 -arnr-strength 5 -arnr-type centered"
_vpxenc_misc_vp9="--min-q=$webm_qmin --max-q=$webm_qmax --kf-max-dist=120${profile_vp9:+ --profile=$profile_vp9} --tile-columns=$webm_tokenparts_log2 --tile-rows=$webm_tokenparts_log2 --auto-alt-ref=1 --lag-in-frames=$webm_lag --arnr-maxframes=7 --arnr-strength=5 --arnr-type=3"
# codec options