Communitygithub.com

longform-edit

将原始的长篇YouTube录制(屏幕录制导出、摄像头文件,或二者加独立麦克风)自动剪辑成可发布的视频,如同Descript的自动模式:转录音频并附带时间戳,删除重拍并保留最后一次,收紧静音段同时保留屏幕上的无声动作(对长时间等待进行加速),将音频母带处理至-14 LUFS / -1.5 dBTP且无背景音乐,为最终渲染版本重新转录生成逐字SRT字幕(可选烧录字幕),草拟章节、标题和描述,在质量关卡(字数、音视频同步、每章字幕同步、字幕覆盖率、响度)上严格失败并输出联系截图。当有人说“编辑这段长视频”、“清理我的录制”、“删除重拍和静音段”、“处理长篇收件箱”或“像Descript一样处理”时使用。需要Claude Code配合ffmpeg、whisper.cpp和Python 3。

longform-edit 是什么?

这个技能(longform-edit)是一个全自动的长视频后期制作工具,专为开发者设计,通过Claude Code命令行界面运行。它能够将原始的长篇YouTube录制(如屏幕录制、摄像头文件,或二者加独立麦克风)自动处理为可直接发布的视频。技能的核心功能包括:智能转录(使用whisper.cpp生成带时间戳的单词级转录)、自动剪辑(识别并删除重拍,保留最后一次;收紧死寂时间,同时保留屏幕上有意义的无声动作,如长时间等待时加速播放)、音频母带处理(达到-14 LUFS / -1.5 dBTP的专业响度标准)、基于最终音频的逐字SRT字幕生成(可选烧录字幕)、以及草拟章节、标题和描述。技能内置严格的质量关卡(门控),包括帧数完整性、单词召回率(≥93%)、音视频同步(≤25ms延迟)、字幕同步(每章中位数≤0.12秒)、字幕覆盖率(≥98%)和响度(-14±1 LUFS)。如果任何关卡失败,技能会输出错误并保留失败视频,供人工审查和覆盖。该技能运行在本地或远程机器上,需要ffmpeg、whisper.cpp和Python 3环境,并提供了一个详细的审核流程(REVIEW.md、contact-sheet.jpg等),确保最终输出质量。

兼容平台✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/jsath/claude-skills/tree/HEAD/skills/video/longform-edit

在你喜欢的 AI 中提问

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

文档

longform-edit 是做什么的?

将原始文件放入文件夹,运行一个命令,即可获得一个经过剪辑、母带处理、添加字幕的视频,同时生成一份 REVIEW.md 解释每一处剪辑。短视频版本参见:edit-style(Reels)。转写设置参见:use-local-whisper。缩略图参见:thumbnail-generator。针对不同平台的片段字幕参见:reel-captions。

前置条件(先检查,仅在用户同意后安装)

ffmpeg -version | head -1                       # 任何 6.x+ 版本;仅 --burn-captions 需要 libass
whisper-cli --help >/dev/null && echo WHISPER_OK   # whisper.cpp (brew install whisper-cpp)
ls ~/models/whisper/ggml-small.en.bin           # 或设置 paths.whisper_model
python3 -m pip install -r scripts/requirements.txt  # numpy, pillow, opencv-python-headless
which claude                                     # 可选:标题 + 章节名称

模型:curl -L -o ~/models/whisper/ggml-small.en.bin https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin (466 MB;慢速机器可用 ggml-base.en,非英语内容可用多语言版 ggml-small)。也可以使用其他转写器:传入 --words words.json 格式为 [{"w": "word", "s": 0.12, "e": 0.40, "p": 0.9}]。 Claude.ai 没有 ffmpeg:在那里,仅接收带有时间戳的粘贴转录文本,并返回剪辑列表、重拍表、章节和 SRT 文件。明确指出未进行任何渲染。

设置(一次性)

将 config.example.json 复制到 ~/longform/config.json,设置 paths.inbox、paths.outbox、paths.whisper_model, 以及 transcribe.prompt 和 publish.word_fixes 中的名称,可选设置 publish.cta_line 和 publish.cta_keywords (草稿会标记缺少视频中间行动号召的视频)。所有阈值均位于该文件中。

运行

S=~/.claude/skills/longform-edit/scripts/longform_edit.py
python3 $S ~/longform/inbox/<slug>/ --config ~/longform/config.json             # 单个视频
python3 $S --config ~/longform/config.json                                      # 每个尚未生成 REVIEW.md 的收件箱文件夹
python3 $S <folder> --plan-only      # 约 1 分钟内生成剪辑计划 + REVIEW.md,不进行渲染
python3 $S <folder> --mic voice.wav  # 独立麦克风,通过互相关同步(开始时拍手有助于同步)
python3 $S <folder> --kind camera    # 人物出镜:每一个静音段都被视为空闲状态(通过运动或文件名自动检测)
python3 $S <folder> --burn-captions  # 同时生成 <slug>.captioned.mp4,其中烧录了 2-5 个单词的字幕
python3 $S <folder> --no-llm         # 使用启发式章节标题,不调用 claude CLI

收件箱:<inbox>/<slug>/ 存放一个视频(取最大的文件)和可选的一个音频文件(用作人声)以及一个 config.json(包含每个视频的覆盖配置)。输出:<outbox>/<slug>/。一个 15 分钟的原始文件大约需要 6-12 分钟;在后台运行并跟踪 <outbox>/<slug>/run.log。重新运行时会使用缓存:仅重新运行发生变化的部分。

它决定的步骤(详细信息及每个数字来源见 references/method.md)

  1. 重拍,保留最后一次。 一个以自身短语形式明确出现的提示语(例如 "let me say that again"、"retake"、 "scratch that",配置中有 22 个提示语)会删除被放弃的尝试及其提示语。如果一行话从头重新开始(相同开头 词语,相似度 >= 0.8,45 秒内),则会删除较早的尝试。连续的重复短语会删除第一份副本。由 um/uh 分隔的 静音也会被删除。任何较弱的情况会被标记,但不会删除。
  2. 死寂时间,有策略地处理。 每个 >= 0.7 秒的静音段都会对照画面进行检查(8 fps 下的帧差,忽略光标大小的 斑点,屏蔽摄像头气泡,净首尾变化可捕获慢速打字)。 静态屏幕:句中对齐到 0.28 秒 / 句末对齐到 0.40 秒,保留呼吸声。仅光标:0.6 秒。 真正的屏幕动作:保留,剪掉两端的空闲部分;如果持续时间超过 4.5 秒,则以 1.5-3x 速度播放,最后 0.9 秒以 1x 速度播放,以便结果平稳着陆。剪辑只落在测得的静音段内,绝不会在单词中间。
  3. 语音母带处理,无背景音乐。 75 Hz 高通滤波器,根据测量底噪进行 FFT 降噪,削减中频浑浊,增强临场感, 空气感,齿音消除,2.5:1 压缩,增益至 -14 LUFS,限制器 <= -1.5 dBTP,移除滤波器延迟。
  4. 基于最终音频的字幕。 最终渲染版本会重新转写;SRT 文件基于该转写生成,而非源转录文本,每条字幕 的开始时间对齐到语音起始点。每个单词都被覆盖(通过门控检查)。
  5. 发布草稿。 章节(结构提示词如 "the first"、"next"、长停顿、大幅画面变化;>= 3 个,第一个从 0:00 开始,每个 >= 40 秒),3 个标题选项,描述,置顶评论,标签和事实核查标志(通过 claude CLI 完成(如果 存在),否则使用启发式方法)。3 个缩略图候选帧(每部分最清晰、色彩最丰富的帧)。

关卡(如果任何一项失败,退出代码 2 并生成 <slug>.FAILED-GATES.mp4)

关卡通过条件
frames每个片段恰好具有 EDL 指定的帧数;视频和音频长度相差不超过 1.5 帧
words最终转写的单词召回率 >= 保留源单词的 93%,且没有连续丢失 >= 6 个单词
av_sync10 次探测:音频延迟 <= 25 毫秒,且帧与源帧的匹配程度优于 +-0.5 秒
captions每章中,字幕开始时间与语音开始时间的中位数 <= 0.12 秒,p95 <= 0.25 秒
caption_coverage>= 98% 的最终单词位于字幕内
loudness综合响度 -14 +-1 LUFS,真实峰值 <= -1 dBTP

运行之后(代理的任务,不要跳过)

  1. 退出代码。 0 = 所有关卡已通过。2 = 切勿将文件作为已完成交付;REVIEW.md 会说明哪个关卡失败及其原因。
  2. 查看 contact-sheet.jpg 和 cuts-sheet.jpg(打开图像):每个图块中都有画面,无黑帧,每个编辑点 的前后看起来是连续状态。
  3. 阅读 REVIEW.md:删除的重拍(前后文本)、已标记但未删除的列表、保留的屏幕动作、响度、每章字幕同步、 音视频探测、单词检查。如需更改某个决定,请编写 <outbox>/<slug>/overrides.json 并重新运行相同命令 (时间单位为源文件的秒数,参见 src 列):
    {"keep_retakes": ["R03"], "cut_retakes": ["R07"], "keep_ranges": [[312.0, 330.5]],
     "force_cut": [{"s": 100.2, "e": 104.9, "why": "cough"}]}
    
  4. PUBLISH.md 是草稿。 重写不够吸引人的标题,事实核查每个标记的数字(需测量,同一来源,同一窗口), 在 publish.word_fixes 中修正姓名拼写并重新运行,以便 SRT 正确。
  5. 切勿上传或安排发布。 返回文件路径;由人工发布。

按以下格式报告

LONGFORM EDIT: <slug>
运行时长  14:32 -> 11:05 (减少 24%):6 次重拍,11 个填充词,3 次加速,41 处停顿收紧
关卡      6/6 通过 (单词召回率 97.8%,最大 A/V 延迟 4 ms,字幕中位数 0.05 s,-14.0 LUFS / -1.6 dBTP)
标记      R04 在 03:12 重新开始?相似度 0.62,保留;"saves 10 hours" 在 07:40 需要来源
文件      <outbox>/<slug>/<slug>.mp4, .srt, chapters.txt, PUBLISH.md, REVIEW.md, thumbs/
已查看    contact-sheet.jpg 和 cuts-sheet.jpg:干净。未上传任何内容。

当某些东西缺失时

  • 没有 whisper 模型:停止并打印上面的下载命令;或接受来自任何其他转写器的 --words。
  • 没有 opencv:仍然可以运行,但每个静音段都被视为空闲状态(会在 run.log 中说明);建议为屏幕录制安装。
  • 没有 claude CLI:使用启发式章节标题,并在 PUBLISH.md 中标记为需要重写。
  • 没有 libass 的 ffmpeg:--burn-captions 将被跳过并附带说明;SRT 文件仍会输出(可将其作为 YouTube CC 上传)。
  • 麦克风同步置信度低于 4:停止并要求在开始时拍手或放下麦克风。

让剪辑效果更好的录制习惯

在重新录制一行之前,说出 "retake"(或 "let me say that again")作为一个完整的句子:这是唯一被信任用于 删除整个句子的提示语。在等待加载期间,要么保持安静且光标静止(会被删除),要么进行旁白(会被保留)。 静态图表上的沉默注视会被缩短:展示图表时请说话。每个文件保证一次性连续拍摄。

可选阶段(图形面板、场景切换、风格配置、外部摄像头同步、重拍揭示)在 references/optional-stages.md 中 描述;这些不在当前脚本中。

Individual skills in this repo

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

jsath/claude-skills

Writes captions for a finished video from its transcript: pulls the line worth repeating, writes first-line options, writes per-platform versions (Instagram, TikTok, YouTube title and description, others on request), keeps the creator's voice using their best past captions, and checks the call to action matches what the video actually says. Use when a creator asks for captions, a caption hook, a YouTube title and description, or a CTA check. Drafts only; never posts or schedules.

jsath/claude-skills

Write CAPTIONS-PLATFORMS.md for one finished short video: a per-platform post caption for Instagram, TikTok, YouTube Shorts (title + description), Facebook, Threads, Bluesky and X, each within that platform's limits, with your comment-keyword CTA on the platforms where it belongs and never on X. Keyword, CTA, platforms, hashtags and limits come from a config file; a checker script fails the file on any miss. Use after an edit is finished, when asked to 'write the captions', 'caption this reel for every platform', or before scheduling.

jsath/claude-skills

Transcribe audio or video on your own machine with Whisper (mlx-whisper, faster-whisper or whisper.cpp) and get word-level timestamps as words.json, a plain .txt and an .srt. No API key, nothing uploaded. This is the transcription step the editing skills (edit-style, longform-edit, reel-captions) depend on. Use when asked to transcribe a take, get word timings, make an SRT, re-transcribe a final render for a caption sync check, or 'run whisper locally'.

jsath/claude-skills

Turns one published long-form video or podcast transcript into up to thirty pieces: 10 clips with new hooks and exact timestamps, 8 X posts, 4 LinkedIn posts, 3 carousels, 2 threads, a newsletter, a community post and a blog post, laid out on a two-week plan, all built only from what was said. In Claude Code it also cuts, reframes and captions the clips with ffmpeg. Use when someone wants to repurpose a long video, find clips, or write social posts from a transcript. Never posts or schedules.

jsath/claude-skills

Turn a raw talking-head take into a dynamically edited 1080x1920 reel: full-face, full-graphic and split layouts that switch every 2 to 5 seconds, real UI and official-logo panels, captions on every word timed by Whisper, voice plus synthesised SFX (no music bed) mastered to -14 LUFS, and hard QA gates (caption sync on the final render, A/V length, loudness, colour, framing, contact sheet, claims). Also covers writing the script so it does not read as AI. Use when asked to 'edit this reel', 'make it look edited', 'add captions / dynamic layout / graphics', or 'write a reel script'.

jsath/claude-skills

Turns one podcast episode transcript into a week of written content: an Episode Prep agent that checks the transcript and speaker names, a Clip Spotter that picks the best short-clip moments with exact timestamps and hooks for an editor to cut, a Show Notes Writer that writes show notes and chapter markers, a Repurpose Writer that turns the big ideas into a newsletter, a LinkedIn post and Instagram captions, and an Episode Planner that spreads it all over the week. Works from a transcript the user supplies or exports from their transcription tool. It does not edit audio or video and does not cut clips. Use when a podcaster asks for show notes, chapters, clip timestamps, or posts from an episode, or says \"repurpose this episode\". Drafts only; never posts.

jsath/claude-skills

Turns one raw talking-head take into a finished 1080x1920 vertical reel in Claude Code with free local tools (ffmpeg, whisper.cpp, headless Playwright): transcribes, keeps the last take of repeated lines, cuts pauses, captions every word, adds real screenshots and official logos, and runs measured QA gates. Use when someone wants a raw phone take edited into a Reel, TikTok or Short, retakes and silences cut, word-by-word captions, or a finished video checked. In Claude.ai it only produces a cut list, shot plan and .srt from a pasted transcript.

jsath/claude-skills

Turns notes, voice-note transcripts and half ideas into Reel, TikTok and YouTube scripts in the creator's own voice: ranks an idea bank, writes ten hooks per idea, writes the script at the right length, rewrites anything that sounds like AI using transcripts of the creator's past videos, and fact-checks every claim with a source and date. Use when someone wants a video script, hooks, a ranked list of what to film, a voice pass, a claims check, or a record sheet to read from while filming.

jsath/claude-skills

Reviews and rewrites a video script (YouTube long-form, a short, or a talking-head reel) so it sounds like one person talking to one friend and holds attention: kills forced analogies and presenter phrases, fixes framing, checks hooks, open loops and re-engagement beats, and suggests titles. Use when someone says fix this script, polish my script, make it sound like me, tighten this before I film, or asks for a hook or title for a video. Returns the rewritten script plus a short change log.

jsath/claude-skills

Make a 1280x720 YouTube thumbnail (or a banner/cover) that reads at phone size: a text-free background plate (generated or from a real frame), a real cutout of the person, 1 to 3 words in tight colour blocks, an official logo, composed by a script that checks overlaps and frame edges and renders the 320px and 168px views you must look at. Use when asked for a thumbnail, cover, banner, 'make this clickable', or to fix a thumbnail that looks cluttered or small.

jsath/claude-skills

Runs five agents that keep a YouTube channel's titles and descriptions matched to what people search for now: a Channel Reader that pulls the user's own video list and stats with their YouTube Data API key, YouTube Analytics OAuth or a pasted YouTube Studio export, a Niche Watcher that finds what is working right now for similar-size channels from public search results the API returns or the user provides, a Title Writer that drafts titles, descriptions and chapters for new videos, a Back Catalogue agent that picks old videos worth a refresh and drafts new versions, and a Change Tracker that records every change the user makes and compares before and after on matched windows. Use when a creator asks for YouTube SEO, better titles or descriptions, what is working in their niche, a back catalogue refresh, or says \"seo run\". Never invents search volumes or stats and never changes a video; drafts only.

相关技能