From ea71d25a2bd819dd4b8446ffbb727dfa1bdbe206 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 12 Jul 2026 15:00:39 +0300 Subject: =?UTF-8?q?scripts:=20stabilize-video=20=E2=80=94=20delete=20origi?= =?UTF-8?q?nal=20.MOV=20after=20successful=20stabilize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The source .MOV is removed only when the stabilized output decodes cleanly in the verify pass, so a failed encode never loses the original. --- scripts/stabilize-video | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/stabilize-video b/scripts/stabilize-video index 4490ec8..ae5739d 100755 --- a/scripts/stabilize-video +++ b/scripts/stabilize-video @@ -9,7 +9,8 @@ # stabilize-video clip1.MOV clip2.MOV # or pass explicit files # # Outputs are written next to each source as `stabilised-.mp4`. -# Clips that already have a stabilized output are skipped. +# On successful stabilization (output decodes OK) the original .MOV is +# deleted. Clips that already have a stabilized output are skipped. set -euo pipefail @@ -158,6 +159,9 @@ main() { if ffmpeg -v error -i "$out" -f null - 2>&1; then printf ' %-28s %s -> %s (%ss, decode OK)\n' \ "$base" "$src_h" "$out_h" "$dur" + # Stabilization succeeded — remove the original .MOV. + rm -f -- "$src" + echo " deleted source: $src" else printf ' %-28s %s -> %s DECODE ERROR\n' "$base" "$src_h" "$out_h" >&2 fi -- cgit v1.2.3