cut-silences
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCut Silences (Pipeline Agent 1)
剪除静音(流水线 Agent 1)
First step of the automated edit. Takes a raw recording + its word-level transcript and removes only silence: dead air before the first word and after the last word, plus inter-word pauses longer than a threshold (trimmed down to a natural breath, never a hard zero-gap). It leaves the speaker's words untouched — false starts, retakes, and stutters are the cut-mistakes agent's job (Agent 2).
This agent is deterministic and transcript-driven, so its output () feeds cleanly into the next agents and the beat-sync validator.
*.silence-transcript.json自动化编辑的第一步。接收原始录制内容和对应的逐词级转录文本,仅移除静音:首个词之前和最后一个词之后的无效空档,以及超过阈值的词间停顿(会将其缩短至自然呼吸的间隔,绝不会硬切成零间隔)。它不会改动说话者的词语——说错后重说、重新录制和结巴都由 cut-mistakes Agent(Agent 2)负责。
该 Agent 采用确定性、基于转录文本的处理方式,因此其输出()可以直接供后续 Agent 和 beat-sync 校验器使用。
*.silence-transcript.jsonWhen to use
何时使用
- "cut the silences", "trim the pauses", "remove dead air", "tighten the pacing"
- As the first stage of the master edit workflow, right after transcription.
- "剪掉静音"、"缩短停顿"、"移除无效空档"、"让节奏更紧凑"
- 作为主编辑工作流的第一阶段,紧接在转录之后执行。
Prerequisites
前置条件
A word-level transcript JSON. Either the ElevenLabs Scribe shape
() or a generic
. Generate one with the workspace transcriber:
{ words: [{ text, start, end, type }], audio_duration_secs }{ words: [{ text, start, end }] }bash
node scripts/transcribe-elevenlabs.mjs path/to/raw.mp4 # -> path/to/raw.json需要一个逐词级转录 JSON。可以是 ElevenLabs Scribe 的结构
(),也可以是通用结构
。使用工作区转录器生成:
{ words: [{ text, start, end, type }], audio_duration_secs }{ words: [{ text, start, end }] }bash
node scripts/transcribe-elevenlabs.mjs path/to/raw.mp4 # -> path/to/raw.jsonUsage
用法
bash
undefinedbash
undefined1) Plan only — compute the cut, write EDL + re-timed transcript (no video touched)
1) Plan only — compute the cut, write EDL + re-timed transcript (no video touched)
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--out-dir video-projects/<slug>/assets
--out-dir video-projects/<slug>/assets
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--out-dir video-projects/<slug>/assets
--out-dir video-projects/<slug>/assets
2) With a video — also write the ffmpeg command (still does not render yet)
2) With a video — also write the ffmpeg command (still does not render yet)
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--video video-projects/<slug>/assets/raw.mp4 --out-dir video-projects/<slug>/assets
--video video-projects/<slug>/assets/raw.mp4 --out-dir video-projects/<slug>/assets
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--video video-projects/<slug>/assets/raw.mp4 --out-dir video-projects/<slug>/assets
--video video-projects/<slug>/assets/raw.mp4 --out-dir video-projects/<slug>/assets
3) Render the cut video (local ffmpeg, re-encode, A/V kept in sync)
3) Render the cut video (local ffmpeg, re-encode, A/V kept in sync)
add --apply to actually run ffmpeg
add --apply to actually run ffmpeg
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--video video-projects/<slug>/assets/raw.mp4 --apply
--output video-projects/<slug>/assets/edited-silenced.mp4
--video video-projects/<slug>/assets/raw.mp4 --apply
--output video-projects/<slug>/assets/edited-silenced.mp4
undefinednode .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--video video-projects/<slug>/assets/raw.mp4 --apply
--output video-projects/<slug>/assets/edited-silenced.mp4
--video video-projects/<slug>/assets/raw.mp4 --apply
--output video-projects/<slug>/assets/edited-silenced.mp4
undefinedOptions
选项
| Flag | Default | Meaning |
|---|---|---|
| — | Source video; enables the ffmpeg command / render |
| next to transcript | Where outputs are written |
| | Cut-video path |
| | Minimum pause treated as trimmable silence |
| | Silence kept before the first word |
| | Silence kept after the last word |
| off | Actually run ffmpeg to render the cut |
| 标志 | 默认值 | 含义 |
|---|---|---|
| — | 源视频;用于启用 ffmpeg 命令或渲染 |
| 转录文本所在目录 | 输出文件的写入位置 |
| | 剪辑后视频的路径 |
| | 视为可裁剪静音的最短停顿 |
| | 首个词之前保留的静音 |
| | 最后一个词之后保留的静音 |
| 关闭 | 实际运行 ffmpeg 渲染剪辑结果 |
How it decides (the silence rules)
判断规则(静音规则)
- Pauses below (0.55s) are left alone — natural speech rhythm.
--gap - For a trimmed pause, a natural breath is kept, scaled by context: for long pauses (≥2s),
0.24safter a sentence ender (0.20s),. ! ?otherwise. The kept breath is biased slightly toward the end of the previous phrase.0.14s - Head/tail dead air is trimmed to /
--head-pad.--tail-pad - Delete ranges are merged; keep ranges are the complement. The cut is rendered with an ffmpeg /
trim+atrimfiltergraph (written to aconcatscript and passed via*.silence-filter.txt), so video and audio stay in sync.-/filter_complex
- 低于 (0.55s)的停顿保持不变——保留自然的说话节奏。
--gap - 对于被裁剪的停顿,会根据上下文保留一段自然呼吸:长停顿(≥2s)保留 ,句末标点(
0.24s)之后保留. ! ?,其他情况保留0.20s。保留的呼吸间隔会略微偏向上一短语的末尾。0.14s - 开头和结尾的无效空档分别裁剪至 /
--head-pad。--tail-pad - 删除区间会进行合并,保留区间则为其补集。剪辑结果通过 ffmpeg 的 /
trim+atrimfiltergraph 渲染(filtergraph 会写入concat脚本,并通过*.silence-filter.txt传入),从而使视频和音频保持同步。-/filter_complex
Outputs (written to --out-dir
)
--out-dir输出(写入 --out-dir
)
--out-dir| File | Purpose |
|---|---|
| Keep/delete ranges, durations, params — the edit list |
| Words re-timed onto the edited timeline (feeds Agent 2 + beats) |
| Human-readable summary + largest pauses trimmed |
| The ffmpeg filtergraph (only with |
| The cut video (only with |
The JSON summary printed to stdout includes , , range counts, and output paths — useful for the master workflow to log and chain.
removedremovedPct| 文件 | 用途 |
|---|---|
| 保留/删除区间、时长和参数——即编辑列表 |
| 按剪辑后时间线重新计时的词语(供 Agent 2 和 beat 流程使用) |
| 便于阅读的摘要,以及被裁剪的最大停顿列表 |
| ffmpeg filtergraph(仅在使用 |
| 剪辑后的视频(仅在使用 |
打印到 stdout 的 JSON 摘要包含 、、区间数量和输出路径,便于主工作流记录日志和串联后续流程。
removedremovedPctTuning notes
调优说明
- Talking-head YouTube default () removes roughly 15-20% of a typical raw take as pure silence. Lower
--gap 0.55for a punchier, faster cut; raise it to preserve more natural breathing room.--gap - If a cut feels too aggressive at sentence boundaries, raise the sentence-break breath, or raise .
--gap
- 对于面对镜头的 YouTube 视频,默认设置()通常可从一条原始录制中裁掉约 15–20% 的纯静音。若希望剪辑更有力度、速度更快,可降低
--gap 0.55;若希望保留更多自然呼吸空间,则提高该值。--gap - 如果剪辑在句子边界处显得过于激进,请提高句子分隔处保留的呼吸时长,或提高 。
--gap
Hand-off to the next agent
传递给下一个 Agent
Pass (and the if rendered) to the cut-mistakes agent. Because timestamps are already on the edited timeline, downstream beat timing and work without further adjustment.
<stem>.silence-transcript.jsonsilenced.mp4scripts/validate-beat-sync.mjs将 (以及已渲染时的 )传递给 cut-mistakes Agent。由于时间戳已经基于剪辑后的时间线,下游 beat 时间对齐和 无需进一步调整即可运行。
<stem>.silence-transcript.jsonsilenced.mp4scripts/validate-beat-sync.mjs