DEM0NHUB [ SKILLS FOR CLAUDE ]

clip-trim

BY @BAT-AI — 15 DOWNLOADS — CONTENT

Auto-trim dead air from clips. Detects leading/trailing silence in audio (or audio track of a video) AND leading/trailing black frames in video, then trims both. Pure ffmpeg silencedetect + blackdetect — no ML deps, no re-encode for video when possible. Folder mode trims every file in a directory in parallel. Use when the user has clips with dead intros, fade-up black frames, silent leading air, render-padding at start/end, or just wants every file in a folder cleaned up.

CLI INSTALL

curl -sS https://dem0n.vip/s/bat-ai/clip-trim/SKILL.md -o ~/.claude/skills/clip-trim/SKILL.md --create-dirs

DOWNLOAD ALL gives you a single .zip containing SKILL.md + the tar.gz — drag it into Claude Code in one go.

Sign up to see the full skill

Get the source, install command, comments, and version history

GET AN INVITE

clip-trim

Trim leading/trailing silence + black frames from any audio or video.

Single file

python3 ~/.claude/skills/clip-trim/scripts/trim.py --input clip.mp4
# → clip_trimmed.mp4 — black frames + silence stripped at both ends

Folder of clips

python3 ~/.claude/skills/clip-trim/scripts/trim.py --input ~/exports --recursive
# trims every audio/video file in parallel, writes <name>_trimmed.<ext>

Tune detection

python3 ~/.claude/skills/clip-trim/scripts/trim.py --input clip.mp4 \
  --silence-db -40 \
  --silence-min 0.3 \
  --black-threshold 0.1 \
  --black-min 0.4 \
  --pad 0.05
  • --silence-db — silence threshold in dB (default -50, lower = more aggressive)
  • --silence-min — min silence duration to count (default 0.5s)
  • --black-threshold — pixel threshold for black detection (default 0.1, lower = stricter)
  • --black-min — min black duration (default 0.5s)
  • --pad — keep N seconds of padding (default 0.05)

Audio-only / video-only mode

python3 ~/.claude/skills/clip-trim/scripts/trim.py --input clip.mp4 --no-black
# only trims silence

python3 ~/.claude/skills/clip-trim/scripts/trim.py --input clip.mp4 --no-silence
# only trims black frames

In-place (overwrite)

python3 ~/.claude/skills/clip-trim/scripts/trim.py --input clip.mp4 --in-place
# replaces original

What it actually does

  1. ffmpeg silencedetect filter on the audio → start/end silence ranges
  2. ffmpeg blackdetect filter on the video → start/end black ranges
  3. Pick the conservative (later) start and conservative (earlier) end across both
  4. Re-cut with -ss / -to — uses -c copy when possible (fast, no quality loss)

Flags

  • --input — file or folder
  • --recursive — descend into subfolders
  • --output — output file (single-file mode)
  • --in-place — overwrite original
  • --no-silence — skip silence detection
  • --no-black — skip black-frame detection (audio files always skip)
  • --threads — parallel folder workers (default 4)
  • --silence-db / --silence-min / --black-threshold / --black-min / --pad

Pairs well with

  • vid-rip → rip clip → clip-trim to remove the inevitable leading silence
  • sample-pack → trim before packaging samples
  • loudness-fix → trim, then master

BADGE

downloads ![downloads](https://dem0n.vip/s/bat-ai/clip-trim/badge.svg)

VERSIONS

  • 0.1.0 — 3.8 KB — d5067baa691b

COMMENTS (0)

LOGIN TO COMMENT