summaryrefslogtreecommitdiffstats
path: root/roles/prerec
diff options
context:
space:
mode:
authorLeo Vivier <zaeph@zaeph.net>2022-12-02 08:34:04 +0100
committerLeo Vivier <zaeph@zaeph.net>2022-12-02 08:34:04 +0100
commitb9fdae5d678fd00ff420c8fa7b4fbf06298aeb1c (patch)
tree9086e6ae471dfc23901afdd994ff9b88d16e763f /roles/prerec
parent1e448d2e99ff47b17d03aa5979d893b425ee7ab1 (diff)
downloademacsconf-ansible-b9fdae5d678fd00ff420c8fa7b4fbf06298aeb1c.tar.xz
emacsconf-ansible-b9fdae5d678fd00ff420c8fa7b4fbf06298aeb1c.zip
Use variables for input and output
Diffstat (limited to '')
-rwxr-xr-xroles/prerec/templates/reencode.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/roles/prerec/templates/reencode.sh b/roles/prerec/templates/reencode.sh
index 66c2f57..5a0128b 100755
--- a/roles/prerec/templates/reencode.sh
+++ b/roles/prerec/templates/reencode.sh
@@ -32,19 +32,22 @@ done
shift `expr $OPTIND - 1`
OPTIND=1
+input="$1"
+output="$2"
+
command="$(cat<<EOF
-ffmpeg -y -i "$1" $time_limit \
+ffmpeg -y -i "$input" $time_limit \
-vf "scale='-1':'min($limit_resolution,ih)',
select='eq(n,0)+if(gt(t-prev_selected_t,1/$limit_fps),1,0)'" \
-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 \
+ ffmpeg -y -i "$input" $time_limit \
-vf "scale='-1':'min($limit_resolution,ih)',
select='eq(n,0)+if(gt(t-prev_selected_t,1/$limit_fps),1,0)'" \
- -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 -threads $cpu "$2"
+ -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 -threads $cpu -- "$output"
EOF
)"