diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-12 15:00:39 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-12 15:00:39 +0300 |
| commit | ea71d25a2bd819dd4b8446ffbb727dfa1bdbe206 (patch) | |
| tree | cc7b769edeecfdc27dcd25ef6f3010ae29d1001a | |
| parent | c1062bce6ad73d25122b2d9b804ee92a9cfcb0eb (diff) | |
scripts: stabilize-video — delete original .MOV after successful stabilize
The source .MOV is removed only when the stabilized output decodes
cleanly in the verify pass, so a failed encode never loses the original.
| -rwxr-xr-x | scripts/stabilize-video | 6 |
1 files changed, 5 insertions, 1 deletions
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-<base>.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 |
