summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-02-04 13:38:06 +0100
committerJonas Smedegaard <dr@jones.dk>2021-02-04 14:17:19 +0100
commit4351bbdf25e7ed35a4a571551617ccbd77fcd748 (patch)
treef76042699bfdaa175917629531fafe37a21addb3 /localvideowebencode
parentbe8a02250013065a93fbfbc4e07cb21a46145b4d (diff)
tidy: add generalized variables $q_* $no_q_* (replacing $qscale_* $crf_* $no_crf_*)
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode34
1 files changed, 17 insertions, 17 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 1bb7227..8045bc5 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -224,24 +224,24 @@ title=${title:-$stem}
[ -n "$use_lame_cbr" ] || use_lame_abr=yes
# resolve quality/speed hints
-qscale_theora=5
-#crf_vp8=10
+q_theora=5
+#q_vp8=10
cpu_vp8=2
-#crf_vp9=10
+#q_vp9=10
cpu_vp9=5
-crf_h264=23
+q_h264=23
preset_h264=medium
profile_h264=baseline
case "$compression" in
normal) :;;
dirty)
- qscale_theora=1
+ q_theora=1
cpu_vp8=5
- crf_h264=40
+ q_h264=40
;;
hq)
multipass=yes
- qscale_theora=6
+ q_theora=6
cpu_vp8=0
cpu_vp9=1
preset_h264=veryslow
@@ -461,10 +461,10 @@ encoder_vp9=libvpx-vp9
encoder_h264=libx264
for vformat in vp8 vp9 h264; do
# melt supports dual-pass or Constant Quality modes only for h.264
- [ h264 = "$vformat" ] || [ -n "$vpxenc" ] || eval "[ -z \"$multipass\$crf_$vformat\" ] || use_ffmpeg_$vformat=yes"
+ [ h264 = "$vformat" ] || [ -n "$vpxenc" ] || eval "[ -z \"$multipass\$q_$vformat\" ] || use_ffmpeg_$vformat=yes"
eval "[ -n \"\$bitrate_$vformat\" ] || no_bitrate_$vformat=yes"
- eval "[ -n \"\$crf_$vformat\" ] || no_crf_$vformat=yes"
+ eval "[ -n \"\$q_$vformat\" ] || no_q_$vformat=yes"
done
if [ -n "$use_ffmpeg_vp8$use_ffmpeg_vp9$use_vpxenc" ]; then
[ -n "$use_oggenc" ] || use_ffmpeg_ogg=yes
@@ -495,15 +495,15 @@ _opusenc_downmix="${downmix_opusenc:+${stereo:+--downmix-stereo}${mono:+--downmi
_melt_postfilters_audio="${limit:+-filter ladspa.1077}"
# codec options
-_melt_theora="vcodec=libtheora${bitrate_theora:+ vb=$bitrate_theora} qscale=$qscale_theora"
-_melt_vp8="vcodec=$encoder_vp8${pre_vp8:+ vpreset=$pre_vp8}${preset_vp8:+ preset=$preset_vp8}${bitrate_vp8:+ ${no_crf_vp8:+ vb=$bitrate_vp8} minrate=$((bitrate_vp8/20)) maxrate=$((bitrate_vp8*12))}${crf_vp8:+ crf=$crf_vp8} cpu-used=$cpu_vp8"
-_ffmpeg_vp8="-c:v $encoder_vp8${pre_vp8:+ -vpre $pre_vp8}${preset_vp8:+ preset $preset_vp8}${bitrate_vp8:+ ${no_crf_vp8:+-b:v $bitrate_vp8} -minrate $((bitrate_vp8/20)) -maxrate $((bitrate_vp8*12))}${crf_vp8:+ ${no_bitrate_vp8:+ -b:v 0 }-crf $crf_vp8} -cpu-used $cpu_vp8"
+_melt_theora="vcodec=libtheora${bitrate_theora:+ vb=$bitrate_theora} qscale=$q_theora"
+_melt_vp8="vcodec=$encoder_vp8${pre_vp8:+ vpreset=$pre_vp8}${preset_vp8:+ preset=$preset_vp8}${bitrate_vp8:+ ${no_q_vp8:+ vb=$bitrate_vp8} minrate=$((bitrate_vp8/20)) maxrate=$((bitrate_vp8*12))}${q_vp8:+ crf=$q_vp8} cpu-used=$cpu_vp8"
+_ffmpeg_vp8="-c:v $encoder_vp8${pre_vp8:+ -vpre $pre_vp8}${preset_vp8:+ preset $preset_vp8}${bitrate_vp8:+ ${no_q_vp8:+-b:v $bitrate_vp8} -minrate $((bitrate_vp8/20)) -maxrate $((bitrate_vp8*12))}${q_vp8:+ ${no_bitrate_vp8:+ -b:v 0 }-crf $q_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=${no_crf_vp8:+vbr}${crf_vp8:+cq --cq-level=$crf_vp8} --cpu-used=$cpu_vp8 $_vpxenc_vpx --token-parts=$webm_tokenparts_log2"
-_melt_vp9="vcodec=$encoder_vp9${pre_vp9:+ vpreset=$pre_vp9}${preset_vp9:+ preset=$preset_vp9}${bitrate_vp9:+ ${no_crf_vp9:+vb=$bitrate_vp9} minrate=$((bitrate_vp9/20)) maxrate=$((bitrate_vp9*12))}${crf_vp9:+ crf=$crf_vp9} cpu-used=$cpu_vp9"
-_ffmpeg_vp9="-c:v $encoder_vp9${pre_vp9:+ -vpre $pre_vp9}${preset_vp9:+ -preset $preset_vp9}${bitrate_vp9:+ ${no_crf_vp9:+-b:v $bitrate_vp9} -minrate $((bitrate_vp9/20)) -maxrate $((bitrate_vp9*12))}${crf_vp9:+ ${no_bitrate_vp9:+-b:v 0 }-crf $crf_vp9} -cpu-used $cpu_vp9"
-_vpxenc_vp9="--codec=vp9${bitrate_vp9:+ --target-bitrate=$((bitrate_vp9/1000))} --good --end-usage=${no_crf_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=$encoder_h264${preset_h264:+ vpreset=$preset_h264}${profile_h264:+ vprofile=$profile_h264}${x264tune:+ tune=$x264tune}${bitrate_h264:+ maxrate=${bitrate_h264} bufsize=$((bitrate_h264*2))} threads=0 movflags=+faststart crf=$crf_h264"
+_vpxenc_vp8="--codec=vp8${bitrate_vp8:+ --target-bitrate=$((bitrate_vp8/1000))} --good --end-usage=${no_q_vp8:+vbr}${q_vp8:+cq --cq-level=$q_vp8} --cpu-used=$cpu_vp8 $_vpxenc_vpx --token-parts=$webm_tokenparts_log2"
+_melt_vp9="vcodec=$encoder_vp9${pre_vp9:+ vpreset=$pre_vp9}${preset_vp9:+ preset=$preset_vp9}${bitrate_vp9:+ ${no_q_vp9:+vb=$bitrate_vp9} minrate=$((bitrate_vp9/20)) maxrate=$((bitrate_vp9*12))}${q_vp9:+ crf=$q_vp9} cpu-used=$cpu_vp9"
+_ffmpeg_vp9="-c:v $encoder_vp9${pre_vp9:+ -vpre $pre_vp9}${preset_vp9:+ -preset $preset_vp9}${bitrate_vp9:+ ${no_q_vp9:+-b:v $bitrate_vp9} -minrate $((bitrate_vp9/20)) -maxrate $((bitrate_vp9*12))}${q_vp9:+ ${no_bitrate_vp9:+-b:v 0 }-crf $q_vp9} -cpu-used $cpu_vp9"
+_vpxenc_vp9="--codec=vp9${bitrate_vp9:+ --target-bitrate=$((bitrate_vp9/1000))} --good --end-usage=${no_q_vp9:+vbr}${q_vp9:+cq --cq-level=$q_vp9} --cpu-used=$cpu_vp9 $_vpxenc_vpx --tile-columns=$webm_tokenparts_log2 --tile-rows=$webm_tokenparts_log2"
+_melt_h264="vcodec=$encoder_h264${preset_h264:+ vpreset=$preset_h264}${profile_h264:+ vprofile=$profile_h264}${x264tune:+ tune=$x264tune}${bitrate_h264:+ maxrate=${bitrate_h264} bufsize=$((bitrate_h264*2))} threads=0 movflags=+faststart crf=$q_h264"
_melt_pcm="$_melt_downmix acodec=pcm_s16le"
_melt_vorbis="$_melt_downmix acodec=libvorbis aq=$quality_vorbis"
_ffmpeg_vorbis="$_ffmpeg_downmix -c:a libvorbis -aq $quality_vorbis"