Communitygithub.com

claude-code-clean-audio-voice-cleanup

诊断视频背景噪声类型,选择并应用降噪方法(ElevenLabs 或 RNNoise),生成保留音量和视频流的清晰主文件。

claude-code-clean-audio-voice-cleanup 是什么?

此技能是 AI 视频编辑流水线中的音频/语音清理步骤,专用于已锁定的剪辑主文件。它能通过频谱图、电平和 SNR 测量诊断噪声类型(如静态嘶声、户外流水、风噪等),然后根据噪声动态性选择最优降噪方法:ElevenLabs Voice Isolator(云端 ML,适合动态宽带噪声)或 RNNoise(本地免费,适合平稳噪声)。工作流程包括先在短样本上 A/B 测试验证效果,再对完整主文件执行清理(视频流直通复制),最后使用 RMS 匹配保持原始响度(不压缩)。技能支持重新接线管道,将清理后的音频集成到后续流程(预览、音效混合、最终输出)。适用于 Claude Code、Cursor 等 AI 编码代理,依赖 tools/clean_voice.py 和 ffmpeg 工具。此步骤不处理最终响度标准化(那是 final-mix 的任务),也不处理音效/音乐混音。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/raisaksham377-bot/youtube-shorts-ai-editor/tree/HEAD/.claude/skills/clean-audio

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

clean-audio — 语音清理

对已锁定的主剪辑进行背景噪声去除,生成一个清理后的主文件,其中语音听起来自然且视频画面保持不变。此步骤在剪辑锁定后尽早执行,因此后续所有步骤(TSX 渲染、音效混音、最终合成)都将基于清晰的语音。需与用户协作;最终响度/限制是 final-mix 步骤的任务,此步骤仅为“仅降噪,保留电平”。

核心引擎是 tools/clean_voice.py;此技能是围绕它的判断流程:诊断 → 选择方法 → A/B 测试 → 清理 → 重新接线。

两种方法(根据噪声类型选择——这是核心决策)

方法是什么何时使用成本
--method elevenElevenLabs 语音隔离器(云端 ML 语音/噪声分离)语音频段内的动态宽带噪声——户外流水声、风声、交通噪音、人群嘈杂声。本地工具无法去除这些。约 1000 积分/分钟(5.5 分钟视频约 $1);需要 ELEVENLABS_API_KEY
--method rnnoise --model sh(或 cb)通过 ffmpeg arnndn 使用本地 RNNoise(模型位于 tools/models/rnnoise/)平稳/轻微噪声(稳定的嘶声、风扇声、部分房间混响)。免费/离线。仅能部分去除动态噪声。免费

在 video-1(室外溪流旁拍摄)上已验证:afftdn 几乎无效,RNNoise 仅部分降低水背景,而 ElevenLabs 几乎完全去除(静音段接近无声,语音和呼吸完好)。经验法则:平稳噪声 → 优先尝试本地方法;动态宽带噪声(水声/风声/交通噪音)→ 使用 ElevenLabs。

输入(每次先读取和测量)

  • 主文件 — videos/video-N/reference/<剪辑名称>.mp4(或已锁定的剪辑)。原始文件从不被修改;输出为新的 -clean / -clean-<模型> 文件。
  • 合成的预览文件(如果存在)— videos/video-N/output/video-N-preview.mp4,通过交换音频生成清洁的上下文预览(其视频与原始相同——无需重新渲染)。
  • videos/video-N/work/timeline.json — 其 master 字段;批准后需将此字段重新指向清理后的主文件。

工作流程

  1. 在选择方法之前先诊断噪声。 测量并观察:
    • 电平:ffmpeg -i M -vn -af astats(RMS、峰值、底噪)+ ebur128(集成 LUFS、真实峰值)。
    • 寻找无语音间隙(通过 grep edited-transcript.json 找到最大的单词间间隙),并测量该处的纯噪声 RMS 与语音 RMS 的比率——即真实 SNR。
    • 频谱图:ffmpeg -i M -vn -lavfi showspectrumpic=s=1500x600:legend=1:scale=log out.png 并查看它。嗡嗡声 = 稳定的水平线(50/60Hz)→ 陷波滤波器。隆隆声 = 低频带 → 高通滤波器。填满语音频段且波动的宽带背景 = 动态噪声(水声/风声)→ ElevenLabs。高频嘶声 = 顶部明亮频带。
    • 注意是否已对导出文件进行过处理(压缩/标准化/峰值限制)——这会限制可恢复的范围。
  2. 根据诊断结果与用户一起决定方法(上表)。如果不确定,对两种方法进行 A/B 测试。
  3. 先在短样本上进行 A/B 测试(在投入/提交前验证):截取约 15 秒的含静音样本,运行每种候选方法,将它们的电平相互匹配,然后对比——通过听觉(真正的测试)以及频谱图(静音段变暗 = 噪声被去除)和残余电平来判断。让用户选择。
  4. 清理完整主文件: python tools/clean_voice.py videos/video-N/reference/<剪辑名称>.mp4 --method <选择的方法> [--model sh] → <剪辑名称>-clean.mp4(或 -clean-<模型>.mp4)。视频流复制(快速、无损、保持 4K60)。
  5. 通过 RMS 匹配保留电平,而非 LUFS(工具会自动处理)。绝不要匹配集成 LUFS——它是门控的且因去除的噪声而被抬高,会过度提升语音导致削波。清理后的文件将显示比原始含噪文件更低的集成 LUFS 值;这是预期的(噪声原本在抬高该数值),语音 RMS 保持不变。最终响度标准化至 -14 LUFS 是 final-mix 步骤的任务。
  6. 为用户提供上下文预览(可选但推荐):将清理后的音频交换到合成预览上——ffmpeg -i preview.mp4 -i <剪辑名称>-clean.mp4 -map 0:v -map 1:a -c:v copy -c:a aac -shortest preview-clean.mp4(视频相同,无需重新渲染)。如需完整 A/B 测试,也可导出 FULL_*.mp3 浏览文件。
  7. 批准后,重新接线管道: 将 timeline.json 中的 "master" 指向清理后的文件,以便所有后续渲染/混音都使用清晰的语音;必要时重新渲染预览。

需要与用户沟通的决策

  • 方法(基于诊断)——如果不确定则进行 A/B 测试。
  • 完全静音的间隙 vs 轻微的环境背景。 语音隔离会去除所有背景音;在室外拍摄中,完全静音的间隙可能会让人感觉像真空密封。如需要,可提供添加低电平中性环境音的选择。
  • ElevenLabs 的成本(约 1000 积分/分钟)——在运行完整主文件前确认。

原则(本项目的风格)

  • 使用能达到效果的最小处理。 目标是去除干扰,而不是让语音听起来经过处理。优先使用最温和的能清除噪声的方法;不要过度处理一条干净的音轨。
  • 先诊断,再选择。 正确的工具取决于噪声类型——切勿盲目提高降噪器参数。本地频谱/RNNoise 无法分离动态宽带噪声;这是 ElevenLabs 的任务。
  • 在提交前先 A/B 测试(也先于花费)。在样本上验证;由用户的耳朵决定。
  • 保留电平;响度是 final-mix 步骤的任务。 使用峰值上限的 RMS 匹配,此处不进行压缩。
  • 非破坏性。 原始主文件不受影响;视频流被复制;输出为新文件。

工具快速参考

  • 清理:python tools/clean_voice.py IN.mp4 [--method eleven|rnnoise] [--model sh|cb] [-o OUT.mp4] [--no-preserve-loudness] [--keep]
  • 诊断:ffmpeg -i M -vn -af astats -f null - · ffmpeg -i M -vn -lavfi showspectrumpic=... out.png(然后查看 png 文件)。
  • RNNoise 模型:tools/models/rnnoise/<模型名称>.rnnn(sh、cb)。
  • 临时样本/频谱图放入暂存区,而非项目目录。

完成标志 = 噪声已诊断、方法已选择(如有需要已 A/B 测试)、完整主文件已清理并保留了电平、用户已通过听觉批准,并且——批准后——timeline.json 指向清理后的主文件。如果出现噪声类型→方法的新经验,则更新记忆。

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

raisaksham377-bot/youtube-shorts-ai-editor

Makes this repo's videos look like YOUR channel instead of the house default — interviews you for palette, fonts, wordmark, motion energy, delivery specs and SFX taste, then rewrites brand.md + remotion/src/brand.ts + remotion/src/fonts.ts together and renders a proof card so you SEE it. Use whenever the user wants to set up or change their brand, rebrand the repo, "make it my colors/fonts", change the accent color, set their wordmark, adjust the motion feel, or asks why their videos look like someone else's. Run it once before the first video. Not for per-video art direction (that is /make-tsx) and not for thumbnails, which are deliberately louder than the brand (that is /packaging).

raisaksham377-bot/youtube-shorts-ai-editor

Build a split-frame vertical Short/Reel (1080x1920) from talking-head footage — real face cropped into the bottom half throughout, bespoke motion-graphic beats + word-by-word captions in the top half. Use when the user wants a "vertical short", "reel", "9:16 video", "split-frame" format, asks to keep their face on screen the whole time while graphics play above it, wants an in-context app/UI mockup moment (like clicking a button in a browser) without cutting away from their face, or hits caption-pill-covers-my-face / no-GPU-rendering / audio-duration-mismatch problems while building one. Covers the crop-offset technique for framing the face, the caption-pill safe zone, the top-half-only UI-mockup scene pattern, the full pipeline from raw footage to final SFX mix, and the environment gotchas (no NVIDIA GPU, AAC priming gap, comp-native transcode). Topic-agnostic — this is a layout/technique skill, not tied to any one video's content. Builds on /clean-cut, /make-tsx conventions, and /suggest-sfx; doesn't rep...

raisaksham377-bot/youtube-shorts-ai-editor

Step 1 of the AI Video Editor pipeline — turn raw talking-head footage into a clean master cut. Use when the user wants to "clean cut", "cut the raw footage", "remove filler / dead air / bad takes", "tighten the pacing", produce cuts.json, run the cut editor, or render a cleaned preview/master for a video-N project in this repo. Covers audio extraction, AssemblyAI transcription, authoring cuts.json (keeps/cuts/fluff categorized), the cut policy (content-aggressive, pause-natural ~0.5s), QA + review docs, the local cut-editor UI, tight/natural previews, the final 4K60 render, and producing edited-transcript.json as the handoff to /make-tsx. Not for building TSX overlays (that is /make-tsx) or the raw TSX authoring rules (that is vidtsx-2d-generator).

raisaksham377-bot/youtube-shorts-ai-editor

Turn static SCREENSHOTS into a simulated screen recording (TSX) — a fake screencast with an animated cursor that eases to targets and clicks, a browser URL bar that updates per page, hard-cut navigations, in-page filter crossfades, smooth scroll, and a ken-burns zoom onto the payoff. Use when a beat needs to show a walkthrough of a web app / dashboard / settings page and you'd rather build it from screenshots than get (or ask for) a real screen recording — "fake a screen recording", "turn these screenshots into a screencast", "simulate clicking through the dashboard", "animate this UI walkthrough", "cursor moving through the app". Built on remotion/src/lib/screencast.tsx. This is a technique WITHIN step 2 (make-tsx): defer timeline/render/bake orchestration to make-tsx and raw crash-free TSX rules to vidtsx-2d-generator. Not for a single static page clone (use WebBrowserFrame directly) and not when the point is genuine proof of real speed/output (use a real recording).

raisaksham377-bot/youtube-shorts-ai-editor

Step 2 of the AI Video Editor pipeline — build the visual beats (Remotion TSX shots) over a project's master cut and bake a composited preview. Use when the user wants to add/edit overlays or full-screen animation segments, "make a shot / beat", implement an edit plan or a v2 update, retime a beat to the narration, re-render shots, or re-bake the video-N preview in this repo. Covers reading the plan + edited-transcript + brand + reusable kit, authoring shots library-first, syncing reveals to word times, updating timeline.json (cutaway vs overlay), rendering, verifying by screenshot, and baking with tools/bake.py. Defers raw TSX authoring rules to vidtsx-2d-generator and the cut itself to clean-cut.

raisaksham377-bot/youtube-shorts-ai-editor

Generates click-optimized YouTube packaging — 3 thumbnail bets under one fixed title, engineered for YouTube's built-in A/B/C thumbnail test, plus a value-forward description, then renders the thumbnails as real images. Use this whenever you want to package a long-form video or turn a video idea into titles and thumbnails. Triggers include how would you package this, title ideas for, thumbnail concept, package this video, A/B variations, and make this clickable. Calibrates to your channel's own CTR data if you have it. Long-form only, never Shorts. Not for non-YouTube copywriting.

raisaksham377-bot/youtube-shorts-ai-editor

Step 4 of the AI Video Editor pipeline — the SFX pass. Analyze a video's beats + narration and propose tasteful sound effects synced to them, drawing from (and growing) a shared, reusable SFX library, then render an SFX-mixed audition preview. Use when the user wants to "add SFX / sound effects", "suggest sfx", "score the transitions", "sound-design this beat", generate/source sound effects, build or extend the sfx library/catalog, author or audit a sfx-plan, or mix SFX over a video-N preview in this repo. Covers reading timeline + edited-transcript + brand §10, the library-first flow, generating misses with the ElevenLabs Sound Effects API, the per-video sfx-plan.json, the hard user-audit gate, and mixing with tools/mix_sfx.py (light voice ducking). Not the music bed (that is the final-mix step) and not the visual beats (that is /make-tsx).

raisaksham377-bot/youtube-shorts-ai-editor

Generate production-ready 2D TSX video files for VidTSX (Remotion-based) from a shot, scene, or video description. Use whenever the user wants to create or generate a VidTSX video, a 2D TSX shot or scene, an animated clip, title card, or rendered motion graphic — including when they describe a visual animation they want built, or say "make a shot", "build this scene", "generate the TSX", or "turn this into a video". Covers the mandatory file structure and composition config, dimension presets (horizontal/vertical/square), six style presets (minimalist, memphis, neo-brutalism, glassmorphism, neon, corporate), and the hard rules that keep renders from crashing, covering frame-based animation only (no useState/useEffect/setTimeout), strictly monotonic interpolate ranges, Easing.bezier not wrapper syntax, and the chroma-js and @remotion/paths import gotchas. Not for 3D/three.js compositions, general React work, or editing video files.

相关技能