summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-02-04 15:26:37 +0100
committerJonas Smedegaard <dr@jones.dk>2021-02-04 15:28:29 +0100
commit07c015937ef27e94dc101f5e6b287145a8ba6194 (patch)
tree2593ab26ea7c8df6af613991848d704e2728cf31 /localvideowebencode
parentff99c8a01b03722f9d65a98046d3b469afa2a22b (diff)
feature: add option --quality to disable or override quality rate factor
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode12
1 files changed, 11 insertions, 1 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 9ff9e8c..3a1a441 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -121,6 +121,8 @@ html favoring open formats with optional non-JavaScript Flash fallback.
exact medium exact slow
quality medium vary medium
(default: normal)
+ --quality Quality rate factor: auto [integer] none
+ (default: auto)
-h, --help This help text
Examples:
@@ -164,7 +166,7 @@ factor_vp9=127/100
lufs=-18
# parse cmdline options
-TEMP="`getopt -s sh -o hp:s:a:r:b:t: -l help,profile:,size:,aspect:,rate:,video:,refbpp:,formats:,audio:,audioprefilter:,loudness,loudness-data:,filter:,stem:,title:,still-frame:,sample,sample-start:,sample-length:,compression: -n "$PRG" -- "$@"`" || exit1 "Internal getopt error."
+TEMP="`getopt -s sh -o hp:s:a:r:b:t: -l help,profile:,size:,aspect:,rate:,video:,refbpp:,formats:,audio:,audioprefilter:,loudness,loudness-data:,filter:,stem:,title:,still-frame:,sample,sample-start:,sample-length:,compression:,quality: -n "$PRG" -- "$@"`" || exit1 "Internal getopt error."
eval set -- "$TEMP"
while true ; do
case "$1" in
@@ -188,6 +190,7 @@ while true ; do
--sample-start) sample=yes; samplestart="$2"; shift 2;;
--sample-length) sample=yes; samplelength="$2"; shift 2;;
--compression) compression="$2"; shift 2;;
+ --quality) quality="$2"; shift 2;;
--) shift; break;;
*) exit1 "Internal error resolving options.";;
esac
@@ -257,6 +260,11 @@ case "$compression" in
;;
*) exit1 "Unknown compression mode \"$compression\".";;
esac
+case "$quality" in
+ auto|'') :;;
+ none) no_q=yes;;
+ *) q=$quality;;
+esac
[ -n "$multipass" ] || singlepass=yes
# parse/resolve size and framerate
@@ -467,6 +475,8 @@ for vformat in vp8 vp9 h264; do
[ h264 = "$vformat" ] || [ -n "$vpxenc" ] || eval "[ -z \"$multipass\$q_$vformat\" ] || use_ffmpeg_$vformat=yes"
eval "[ -n \"\$bitrate_$vformat\" ] || no_bitrate_$vformat=yes"
+ eval "[ -z \"\$no_q$no_q_$vformat\" ] || q_$vformat="
+ eval "[ -z \"\$q\" ] || q_$vformat=$q"
eval "[ -n \"\$q_$vformat\" ] || no_q_$vformat=yes"
done
if [ -n "$use_ffmpeg_vp8$use_ffmpeg_vp9$use_vpxenc" ]; then