summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-09-21 20:13:28 +0200
committerJonas Smedegaard <dr@jones.dk>2014-09-21 20:13:28 +0200
commitfac3d4d2f3bc767c262c14b9781573f20f6b7b8b (patch)
tree9eed38f25e4ea3d9ddd5848c4d87797df420412b
parent8cc17063f29c1b91033b3aa7f12561342f1dc801 (diff)
Tidy computation of average bitrate.
-rwxr-xr-xlocalvideowebencode9
1 files changed, 4 insertions, 5 deletions
diff --git a/localvideowebencode b/localvideowebencode
index ca1dc6a..e31ae33 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -305,11 +305,10 @@ if [ -n "$_pixels" ] && [ $_pixels -ge $((1024*768)) ]; then
fi
bitrate="$bitrate_fixed"
-# compute average bitrate from reference bits-per-pixel and "power of .75"
-if [ -n "$_pixels" ] && [ -n "$_frames" ]; then
- bitrate="${bitrate_fixed:-$(perl \
- -E "say int( +(($_pixels/(640*360))**0.75" \
- -E "*640*360*$_frames*${refbpp:-$refbpp_default}) )")}"
+# compute average bitrate from reference data and "power of .75" rule
+if [ -z "$bitrate" ] && [ -n "$_pixels" ] && [ -n "$_frames" ]; then
+ bitrate=$(perl -E '$refsize=640*360;' \
+ -E "say int( +(($_pixels/\$refsize)**0.75*\$refsize*$_frames*$refbpp) )")
fi
# default per-codec-channel bitrates