summaryrefslogtreecommitdiffstats
path: root/roles/prerec/templates/reencode.sh
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2025-11-26 14:45:30 -0500
committerSacha Chua <sacha@sachachua.com>2025-11-26 14:45:30 -0500
commit16cbdc124d448afd1264fa37b12bd8f0f1841fd8 (patch)
treec477806c4e9bfc73f07c84e6a703a068c220d635 /roles/prerec/templates/reencode.sh
parenta921272d3c9c2c5c45ff3844ea16f2f8c9d105bb (diff)
downloademacsconf-ansible-16cbdc124d448afd1264fa37b12bd8f0f1841fd8.tar.xz
emacsconf-ansible-16cbdc124d448afd1264fa37b12bd8f0f1841fd8.zip
updatesHEADmain
Diffstat (limited to '')
-rwxr-xr-xroles/prerec/templates/reencode.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/roles/prerec/templates/reencode.sh b/roles/prerec/templates/reencode.sh
index 665fee2..ac5309a 100755
--- a/roles/prerec/templates/reencode.sh
+++ b/roles/prerec/templates/reencode.sh
@@ -10,6 +10,9 @@ print_only=false
limit_resolution={{ res_y }}
limit_fps={{ fps }}
+output_final="${2:-$(echo $input | sed 's/--original.*/--reencoded.webm/')}"
+output_temp="partial--${output_final}" # <-- New temporary name
+
while getopts :q:c:t:s OPT; do
case $OPT in
q|+q)
@@ -47,7 +50,7 @@ ffmpeg -y -i "$input" $time_limit \
fps='$limit_fps'" \
-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"
+ -pass 2 -threads $cpu -- "$output_temp"
EOF
)"
@@ -55,4 +58,5 @@ if [ $print_only == true ]; then
echo "$command"
else
eval "$command"
+ mv "$output_temp" "$output_final"
fi