summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xroles/prerec/templates/reencode.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/roles/prerec/templates/reencode.sh b/roles/prerec/templates/reencode.sh
index e3a82eb..7ae3234 100755
--- a/roles/prerec/templates/reencode.sh
+++ b/roles/prerec/templates/reencode.sh
@@ -7,6 +7,7 @@ q=32
cpu=4
time_limit=""
print_only=false
+resolution=1080
while getopts :q:c:t:s OPT; do
case $OPT in
@@ -31,8 +32,8 @@ shift `expr $OPTIND - 1`
OPTIND=1
command="$(cat<<EOF
-ffmpeg -y -i "$1" $time_limit -c:v libvpx-vp9 -b:v 0 -crf $q -an -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu -g 240 -pass 1 -f webm -threads $cpu /dev/null &&
- ffmpeg -y -i "$1" $time_limit -c:v libvpx-vp9 -b:v 0 -crf $q -c:a libopus -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu -pass 2 -g 240 -threads $cpu "$2"
+ffmpeg -y -i "$1" $time_limit -vf "scale='-1':'min($resolution,ih)'" -c:v libvpx-vp9 -b:v 0 -crf $q -an -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu -g 240 -pass 1 -f webm -threads $cpu /dev/null &&
+ ffmpeg -y -i "$1" $time_limit -vf "scale='-1':'min($resolution,ih)'" -c:v libvpx-vp9 -b:v 0 -crf $q -c:a libopus -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu -pass 2 -g 240 -threads $cpu "$2"
EOF
)"