Skip to content
Back to skills

Raw Cut

ASecurity

Clean-cut a RAW single-speaker recording — supports BOTH Video Mode (talking-head / screen recording with frame-locked lip-sync) AND Audio-Only Mode (pure voiceover cut with zero video processing, even from an .mp4 input). Removes silences, long pauses, false starts, retakes, repeated lines, and background voices (TV/phone/people), keeping one best take of every line with short even pauses. Use when the user gives a raw video or voiceover and asks to "clean it", "cut the pauses", "fix retakes...

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentspythongoshellangularawsapi

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add rahadexe/agent-video-editor --skill raw-cut --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Raw Cut?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Raw Cut
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rahadexe-raw-cut/badge)](https://www.skillsdirectory.com/skills/rahadexe-raw-cut)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: raw-cut
description: Clean-cut a RAW single-speaker recording — supports BOTH Video Mode (talking-head / screen recording with frame-locked lip-sync) AND Audio-Only Mode (pure voiceover cut with zero video processing, even from an .mp4 input). Removes silences, long pauses, false starts, retakes, repeated lines, and background voices (TV/phone/people), keeping one best take of every line with short even pauses. Use when the user gives a raw video or voiceover and asks to "clean it", "cut the pauses", "fix retakes", "audio raw cut করো", "voice clean করো", "video raw cut করো", or wants the clean base before motion graphics. Bangla + English speech. Cut only — no graphics, captions, zoom, colour or background removal.
---

# raw-cut — Dual-Mode (Audio & Video) Raw Take → Clean Cut

**Output:**
- **Video Mode (`--mode video`):** one clean `.mp4` where every line is said **once**, by the **best take**, with short even pauses (≈0.15–0.3 s by ear), **frame-locked lip-sync**, and nothing else changed.
- **Audio-Only Mode (`--mode audio` / `--audio-only`):** one clean 48 kHz stereo PCM `.wav` (and/or `.mp3` via `--also-mp3`) with **zero video processing** — never encodes `master.mov`, never builds video contact sheets, and never touches video streams even if the input is an `.mp4`!

Script: `scripts/rawcut.py` inside this skill folder (`skills/raw-cut/scripts/rawcut.py` in the full pipeline, or `<skill-dir>/scripts/rawcut.py` when installed standalone via `npx skills add`). Requires Python 3 + `numpy` + `ffmpeg` 7+ (`Pillow` needed only in video mode). Always set `PYTHONIOENCODING=utf8` on Windows. Run long commands in the background.

> **Standalone vs. Full Pipeline Paths:** Inside the full `agent-video-editor` workspace, write clean outputs to `outputs/audio/clean_cuts/` or `outputs/video/clean_cuts/` and cache to `work/<slug>`. When installed standalone as a skill in any other folder, write clean outputs next to the input file (for example `<name>_clean.wav` or `<name>_clean.mp4`) and cache in `./work/<slug>`.

> **Skill Hygiene Rule:** This skill folder contains **instructions (`SKILL.md`) and scripts (`scripts/rawcut.py`) ONLY** — never store media assets, outputs, or cache files inside `skills/raw-cut/`.

---

## 0. Pick the Right Mode (Audio vs Video)

| User Request | Flag | Behavior | Output Path |
|---|---|---|---|
| "শুধু audio raw cut করো" / "voice clean করো" / faceless video voiceover | `--mode audio` (or `--audio-only`) | **0% video work** (`source_audio.wav` only, 5–10× faster, smooth audio crossfades, audio-only verify) | `outputs/audio/clean_cuts/<slug>_clean.wav` (add `--also-mp3` for `.mp3` too) |
| "video সহ raw cut করো" / talking-head or screen-record clean cut | `--mode video` | Constant-30 fps `master.mov`, video contact sheets, `xfade` + `acrossfade`, 0-frame lip-sync verify | `outputs/video/clean_cuts/<slug>_clean.mp4` |
| Mode not specified | `--mode auto` (default) | Audio output ext (`.wav/.mp3/.m4a/.flac`) OR audio input OR no video stream → `audio`; otherwise → `video` | Routed automatically |

---

## 1. Check the Machine — Once, Not Every Time

```powershell
$env:PYTHONIOENCODING="utf8"
python skills/raw-cut/scripts/rawcut.py doctor
```
- The result is cached for 30 days in the OS temp folder (never pollutes the skill folder). `run` calls it automatically. Use `doctor --force` only when something failed, or when you changed PC, key, or model.
- Checks: ffmpeg/ffprobe, Pillow, CPU/RAM/disk, encode speed, API key + audio comprehension test, and latency.
- **FAIL** → stop and tell the user the exact problem and fix. Never guess-cut with a broken setup.
- **WARN** → tell the user once, then continue.

**Transcription engine order (cheapest reliable option first):**

| # | Engine | When | Setup |
|---|---|---|---|
| 1 | **Local** faster-whisper `large-v3` | NVIDIA GPU + `faster-whisper` installed | `pip install faster-whisper` |
| 2 | **Free API**: Google AI Studio Gemini (`gemini-flash-latest`) | Free key | `GEMINI_API_KEY=...` (aistudio.google.com) |
| 3 | **Router / paid API**: OpenAI-compatible audio model | Key set | `RAWCUT_BASE_URL`+`RAWCUT_API_KEY` (+`RAWCUT_MODEL`) |
| – | Local on CPU | Last resort only | Slow (~4× realtime) and weak on Bangla |

Overrides: `RAWCUT_ENGINE=local|api`, `RAWCUT_LOCAL_MODEL`, `RAWCUT_LANG` (default `bn`). Put keys in env or `.env`. Never print a key.

A weak model is the #1 cause of missing lines: if speech coverage drops below 88% or any window fails, `run` prints `TRANSCRIPT WEAK` and stops safely.

---

## 2. Cut — One Command

### Audio-Only Mode (Zero Video Processing)
```powershell
python skills/raw-cut/scripts/rawcut.py run "inputs/raw_audio/<raw>.mp3" "outputs/audio/clean_cuts/<slug>_clean.wav" "work/<slug>" --mode audio --also-mp3
```
*(Works identically even if `<raw>` is an `.mp4` — `--mode audio` ignores the video track completely. Add `--denoise` if you want the cut taken from the denoised `clean.wav` instead of the untouched `source_audio.wav`.)*

### Video Mode (Frame-Locked A/V)
```powershell
python skills/raw-cut/scripts/rawcut.py run "inputs/raw_video/<raw>.mp4" "outputs/video/clean_cuts/<slug>_clean.mp4" "work/<slug>" --mode video
```

- Steps: `prep` → `transcribe` (24 s overlapping windows, parallel, cached) → `takes` (group retakes, pick defaults) → `cut` → `verify`.
- Safe to re-run and resumable from `work/<slug>`.
- **Never overwrites an edited `keep.json`.** Delete `keep.json` to re-pick defaults, or delete `windows/` + `phrases.json` to re-transcribe.
- Single steps: `prep`, `transcribe`, `takes`, `cut W out [--denoise] [--also-mp3]`, `verify W out [--quick]`.

---

## 3. Review Retakes (The Only Judgment Step)

- **Audio Mode:** Review the printed retake groups and `work/<slug>/takes.json` (text, timing, dB, completeness). Default pick is the **last complete, full-length take**. Change `work/<slug>/keep.json` only if an earlier take is clearly cleaner or more complete, then re-run `cut` + `verify`.
- **Video Mode:** Open each contact sheet printed by `run` (`start | middle | end` per attempt). Change the pick only if the default misses words/stumbles OR has eyes closed, hand over face, or big posture shift (prefer lower `move`; `join` breaks ties).

Always apply without being asked:
- **Drop non-content filler:** "ok", "হয়ে গেছে", mic tests, talking off-camera.
- **Keep anything carrying new information**, even if said once.
- **Never reorder lines** unless the user asks.
- **Partial rescue** (first half of one take + second half of another) only at a real pause — tell the user if you do it.

---

## 4. Verify — What Must Be True

| Check | Audio Mode | Video Mode |
|---|---|---|
| Duration sync | `audio … edl … diff` ≤ 50 ms | `video … audio … diff` ≤ 33 ms |
| Lip-sync | *(skipped — audio-only)* | `picture offset in frames`: all `0` |
| `joins inside speech` | `none` | `none` |
| `clips < 0.35 s (stutter)` | `none` | `none` |
| `pauses > 0.4 s (clear speech)` | `none` (or one borderline) | `none` (or one borderline) |
| Fresh transcript (unless `--quick`) | Every line once, in order, nothing missing | Every line once, in order, nothing missing |

Report briefly to the user in their language: output path(s), final duration, final clean script, any non-obvious retake drops/choices, and (in video mode) any big head jumps worth hiding with a zoom later.

---

## Why the Script Does What It Does (Don't Undo These)

1. **Audio-only isolation.** Audio mode never decodes or encodes video, writes lossless 48 kHz stereo PCM WAV (`source_audio.wav`), and uses smooth 40 ms triangular `acrossfade` at silent soft joins so Remotion and DAWs get sample-accurate, click-free audio.
2. **Video sync.** Phone video is VFR and often offsets video vs audio start time. Video `prep` makes a constant-30 fps master and trims both streams by **time** (never frame index).
3. **Transcribe in context.** 24 s overlapping windows prevent hallucination; cut points always come from the loudness envelope, never raw transcript timestamps.
4. **Background voices.** Any phrase ≥ 12 dB quieter than the speaker (or tagged background) is dropped.
5. **Pauses judged by ear.** Clear speech (`STRONG_DB` 15) drives pause planning; short onset/tail (`TAIL_IN` 0.06 / `TAIL_OUT` 0.12 s) prevents clipped syllables; inner pauses > 0.30 s compress to ≈ 0.13 s.
6. **No clipped or leaking retakes.** Cut points settle into silence and never cross a dropped neighbour attempt's quietest dip (`lim_lo`/`lim_hi`).
7. **No stutter clips.** Joins removing < 0.15 s or leaving clips < 0.35 s merge back when the gap is pure silence.
8. **Dissolve joins (video).** 4-frame `xfade` + `acrossfade` when gap < 3 s, head jump < 12, and both sides silent; hard cut otherwise.

Files in this skill

  • SKILL.md8.7 KB
  • scripts/rawcut.py53.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.