cut-silences

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cut 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 (
*.silence-transcript.json
) feeds cleanly into the next agents and the beat-sync validator.
自动化编辑的第一步。接收原始录制内容和对应的逐词级转录文本,仅移除静音:首个词之前和最后一个词之后的无效空档,以及超过阈值的词间停顿(会将其缩短至自然呼吸的间隔,绝不会硬切成零间隔)。它不会改动说话者的词语——说错后重说、重新录制和结巴都由 cut-mistakes Agent(Agent 2)负责。
该 Agent 采用确定性、基于转录文本的处理方式,因此其输出(
*.silence-transcript.json
)可以直接供后续 Agent 和 beat-sync 校验器使用。

When 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 (
{ words: [{ text, start, end, type }], audio_duration_secs }
) or a generic
{ words: [{ text, start, end }] }
. Generate one with the workspace transcriber:
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.json

Usage

用法

bash
undefined
bash
undefined

1) 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
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--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
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json>
--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
undefined
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
undefined

Options

选项

FlagDefaultMeaning
--video <path>
—Source video; enables the ffmpeg command / render
--out-dir <dir>
next to transcriptWhere outputs are written
--output <path>
<video-stem>.silenced.mp4
Cut-video path
--gap <s>
0.55
Minimum pause treated as trimmable silence
--head-pad <s>
0.22
Silence kept before the first word
--tail-pad <s>
0.34
Silence kept after the last word
--apply
offActually run ffmpeg to render the cut
标志默认值含义
--video <path>
—源视频;用于启用 ffmpeg 命令或渲染
--out-dir <dir>
转录文本所在目录输出文件的写入位置
--output <path>
<video-stem>.silenced.mp4
剪辑后视频的路径
--gap <s>
0.55
视为可裁剪静音的最短停顿
--head-pad <s>
0.22
首个词之前保留的静音
--tail-pad <s>
0.34
最后一个词之后保留的静音
--apply
关闭实际运行 ffmpeg 渲染剪辑结果

How it decides (the silence rules)

判断规则(静音规则)

  • Pauses below
    --gap
    (0.55s) are left alone — natural speech rhythm.
  • For a trimmed pause, a natural breath is kept, scaled by context:
    0.24s
    for long pauses (≥2s),
    0.20s
    after a sentence ender (
    . ! ?
    ),
    0.14s
    otherwise. The kept breath is biased slightly toward the end of the previous phrase.
  • 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
    /
    atrim
    +
    concat
    filtergraph (written to a
    *.silence-filter.txt
    script and passed via
    -/filter_complex
    ), so video and audio stay in sync.
  • 低于
    --gap
    (0.55s)的停顿保持不变——保留自然的说话节奏。
  • 对于被裁剪的停顿,会根据上下文保留一段自然呼吸:长停顿(≥2s)保留
    0.24s
    ,句末标点(
    . ! ?
    )之后保留
    0.20s
    ,其他情况保留
    0.14s
    。保留的呼吸间隔会略微偏向上一短语的末尾。
  • 开头和结尾的无效空档分别裁剪至
    --head-pad
    /
    --tail-pad
    。
  • 删除区间会进行合并,保留区间则为其补集。剪辑结果通过 ffmpeg 的
    trim
    /
    atrim
    +
    concat
    filtergraph 渲染(filtergraph 会写入
    *.silence-filter.txt
    脚本,并通过
    -/filter_complex
    传入),从而使视频和音频保持同步。

Outputs (written to
--out-dir
)

输出(写入
--out-dir
)

FilePurpose
<stem>.silence-edl.json
Keep/delete ranges, durations, params — the edit list
<stem>.silence-transcript.json
Words re-timed onto the edited timeline (feeds Agent 2 + beats)
<stem>.silence-decisions.md
Human-readable summary + largest pauses trimmed
<stem>.silence-filter.txt
The ffmpeg filtergraph (only with
--video
)
<video-stem>.silenced.mp4
The cut video (only with
--apply
)
The JSON summary printed to stdout includes
removed
,
removedPct
, range counts, and output paths — useful for the master workflow to log and chain.
文件用途
<stem>.silence-edl.json
保留/删除区间、时长和参数——即编辑列表
<stem>.silence-transcript.json
按剪辑后时间线重新计时的词语(供 Agent 2 和 beat 流程使用)
<stem>.silence-decisions.md
便于阅读的摘要,以及被裁剪的最大停顿列表
<stem>.silence-filter.txt
ffmpeg filtergraph(仅在使用
--video
时生成)
<video-stem>.silenced.mp4
剪辑后的视频(仅在使用
--apply
时生成)
打印到 stdout 的 JSON 摘要包含
removed
、
removedPct
、区间数量和输出路径,便于主工作流记录日志和串联后续流程。

Tuning notes

调优说明

  • Talking-head YouTube default (
    --gap 0.55
    ) removes roughly 15-20% of a typical raw take as pure silence. Lower
    --gap
    for a punchier, faster cut; raise it to preserve more natural breathing room.
  • If a cut feels too aggressive at sentence boundaries, raise the sentence-break breath, or raise
    --gap
    .
  • 对于面对镜头的 YouTube 视频,默认设置(
    --gap 0.55
    )通常可从一条原始录制中裁掉约 15–20% 的纯静音。若希望剪辑更有力度、速度更快,可降低
    --gap
    ;若希望保留更多自然呼吸空间,则提高该值。
  • 如果剪辑在句子边界处显得过于激进,请提高句子分隔处保留的呼吸时长,或提高
    --gap
    。

Hand-off to the next agent

传递给下一个 Agent

Pass
<stem>.silence-transcript.json
(and the
silenced.mp4
if rendered) to the cut-mistakes agent. Because timestamps are already on the edited timeline, downstream beat timing and
scripts/validate-beat-sync.mjs
work without further adjustment.
将
<stem>.silence-transcript.json
(以及已渲染时的
silenced.mp4
)传递给 cut-mistakes Agent。由于时间戳已经基于剪辑后的时间线,下游 beat 时间对齐和
scripts/validate-beat-sync.mjs
无需进一步调整即可运行。