summaryrefslogtreecommitdiffstats
path: root/roles/prerec/templates/reencode.sh
diff options
context:
space:
mode:
Diffstat (limited to 'roles/prerec/templates/reencode.sh')
-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