Communitygithub.com

视频剪辑(everything-claude-code)

从原始素材到成片:FFmpeg、Remotion、ElevenLabs、fal.ai,再到 Descript/CapCut 抛光。

视频剪辑(everything-claude-code) 是什么?

演示拍完后整理结构与节奏——可交付的上线成片剪辑。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/video-editing

在你喜欢的 AI 中提问

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

预览

来自技能 README

文档

视频剪辑

针对真实素材的AI辅助剪辑。不是根据提示生成内容。快速剪辑现有视频。

何时激活

  • 用户想要剪辑、裁剪或结构化视频素材
  • 将长录制内容转化为短视频
  • 从原始素材制作vlog、教程或演示视频
  • 为现有视频添加叠层、字幕、音乐或画外音
  • 为不同平台(YouTube、TikTok、Instagram)重新调整视频比例
  • 用户说出“剪辑视频”、“裁剪这段素材”、“制作一个vlog”或“视频工作流”

核心论点

当你不再要求AI创建整个视频,而是用它来压缩、结构化和增强真实素材时,AI视频剪辑才真正有用。价值不在于生成,而在于压缩。

流程

对于基于参考的衡量性工作,将“品味提炼”链接到“品味应用”,然后返回此处进行编辑器和最终输出审查。独立的品味技能可以使用现有素材;生成是可选的。

在实时编辑器或DAW更改之前,保存一个版本化的项目检查点,并验证文件存在。更改后再次保存并验证检查点。API回读证明的是当前内存状态,而不是保存状态。在手提交接中,将渲染媒体、可编辑项目和创意审批作为独立状态保存。

对于MIDI驱动的音频,根据接收机架的注音映射检查音高并进行试听;成功的片段创建仍可能产生静音。对于重建项目,通过原生加载和保存进行验证,按时间线顺序排序事件,验证样本链接和静音状态,然后检查并试听精确导出的音频,以发现意外静音。仅凭XML解析并不能证明DAW接受了每个片段或产生了可听输出。在调用较新命令之前,检查网桥的能力握手。不要作为创意任务的副作用启用上传或训练数据遥测;在缺乏共识或能力时,使用支持的本地控制路径。

Screen Studio / 原始素材
  → Claude / Codex
  → FFmpeg
  → Remotion
  → ElevenLabs / fal.ai
  → Descript 或 CapCut

每一层都有特定的工作。不要跳过层次。不要试图用一个工具完成所有事情。

第1层:采集(Screen Studio / 原始素材)

收集源材料:

  • Screen Studio:用于应用程序演示、编码会话、浏览器工作流的精致屏幕录制
  • 原始相机素材:vlog素材、采访、活动录制
  • 通过VideoDB的桌面录制:带实时上下文的会话录制(请参阅videodb技能)

输出:准备组织的原始文件。

第2层:组织(Claude / Codex)

使用Claude Code或Codex来:

  • 转录和标注:生成转录稿,识别主题和话题
  • 规划结构:决定保留什么、裁剪什么以及以什么顺序排列
  • 识别无效片段:找出暂停、离题、重复录制的内容
  • 生成剪辑决定表:包含剪辑时间戳、保留的片段
  • 搭建FFmpeg和Remotion代码:生成命令和组合
示例提示:
“这是一段4小时录制的转录稿。为一段24分钟的vlog识别8个最强片段。给出每个片段的FFmpeg剪辑命令。”

这一层关乎结构,而非最终创意品味。

第3层:确定性剪辑(FFmpeg)

FFmpeg处理枯燥但关键的工作:分割、修剪、拼接和预处理。

按时间戳提取片段

ffmpeg -i raw.mp4 -ss 00:12:30 -to 00:15:45 -c copy segment_01.mp4

根据剪辑决定表批量剪辑

#!/bin/bash
# cuts.txt: start,end,label
while IFS=, read -r start end label; do
  ffmpeg -i raw.mp4 -ss "$start" -to "$end" -c copy "segments/${label}.mp4"
done < cuts.txt

拼接片段

# 创建文件列表
for f in segments/*.mp4; do echo "file '$f'"; done > concat.txt
ffmpeg -f concat -safe 0 -i concat.txt -c copy assembled.mp4

创建代理以加快剪辑

ffmpeg -i raw.mp4 -vf "scale=960:-2" -c:v libx264 -preset ultrafast -crf 28 proxy.mp4

提取音频进行转录

ffmpeg -i raw.mp4 -vn -acodec pcm_s16le -ar 16000 audio.wav

标准化音频级别

ffmpeg -i segment.mp4 -af loudnorm=I=-16:TP=-1.5:LRA=11 -c:v copy normalized.mp4

第4层:可编程组合(Remotion)

Remotion将剪辑问题转化为可组合的代码。用于传统剪辑软件难以处理的场景:

何时使用Remotion

  • 叠层:文本、图像、品牌标识、下三分之一字幕
  • 数据可视化:图表、统计、动画数字
  • 动态图形:转场、解说动画
  • 可组合场景:可跨视频重复使用的模板
  • 产品演示:带注释的截图、UI高亮

基本的Remotion组合

import { AbsoluteFill, Sequence, Video, useCurrentFrame } from "remotion";

export const VlogComposition: React.FC = () => {
  const frame = useCurrentFrame();

  return (
    <AbsoluteFill>
      {/* 主素材 */}
      <Sequence from={0} durationInFrames={300}>
        <Video src="/segments/intro.mp4" />
      </Sequence>

      {/* 标题叠层 */}
      <Sequence from={30} durationInFrames={90}>
        <AbsoluteFill style={{
          justifyContent: "center",
          alignItems: "center",
        }}>
          <h1 style={{
            fontSize: 72,
            color: "white",
            textShadow: "2px 2px 8px rgba(0,0,0,0.8)",
          }}>
            AI剪辑技术栈
          </h1>
        </AbsoluteFill>
      </Sequence>

      {/* 下一片段 */}
      <Sequence from={300} durationInFrames={450}>
        <Video src="/segments/demo.mp4" />
      </Sequence>
    </AbsoluteFill>
  );
};

渲染输出

npx remotion render src/index.ts VlogComposition output.mp4

有关详细模式和API参考,请参阅Remotion文档。

第5层:生成资产(ElevenLabs / fal.ai)

只生成你需要的。不要生成整个视频。

使用ElevenLabs录制画外音

import os
import requests

resp = requests.post(
    f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}",
    headers={
        "xi-api-key": os.environ["ELEVENLABS_API_KEY"],
        "Content-Type": "application/json"
    },
    json={
        "text": "你的旁白文本",
        "model_id": "eleven_turbo_v2_5",
        "voice_settings": {"stability": 0.5, "similarity_boost": 0.75}
    }
)
with open("voiceover.mp3", "wb") as f:
    f.write(resp.content)

使用fal.ai生成音乐和音效

使用fal-ai-media技能来:

  • 背景音乐生成
  • 音效(ThinkSound模型用于视频转音频)
  • 转场音效

使用fal.ai生成视觉元素

用于插入镜头、缩略图或不存在的B-roll:

generate(app_id: "fal-ai/nano-banana-pro", input_data: {
  "prompt": "专业缩略图,适用于技术vlog,深色背景,屏幕上有代码",
  "image_size": "landscape_16_9"
})

VideoDB的生成音频

如果配置了VideoDB:

voiceover = coll.generate_voice(text="旁白文本", voice="alloy")
music = coll.generate_music(prompt="编码vlog的Lo-Fi背景音乐", duration=120)
sfx = coll.generate_sound_effect(prompt="微妙的嗖嗖转场声效")

第6层:最终润色(Descript / CapCut)

最后一层是人。使用传统编辑器进行:

  • 节奏:调整感觉太快或太慢的剪辑点
  • 字幕:自动生成,然后手动清理
  • 色彩校正:基本校正和氛围营造
  • 最终音频混音:平衡画外音、音乐和音效电平
  • 导出:针对特定平台格式和质量设置

这是品味所在。AI清除重复劳动,你做出最终决策。

社交媒体重帧

不同平台需要不同的宽高比:

平台宽高比分辨率
YouTube16:91920x1080
TikTok / Reels9:161080x1920
Instagram Feed1:11080x1080
X / Twitter16:9 或 1:11280x720 或 720x720

使用FFmpeg重帧

# 16:9 到 9:16(中心裁剪)
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" vertical.mp4

# 16:9 到 1:1(中心裁剪)
ffmpeg -i input.mp4 -vf "crop=ih:ih,scale=1080:1080" square.mp4

使用VideoDB重帧

from videodb import ReframeMode

# 智能重帧(AI引导主体跟踪)
reframed = video.reframe(start=0, end=60, target="vertical", mode=ReframeMode.smart)

场景检测和自动剪辑

FFmpeg场景检测

# 检测场景变化(阈值0.3 = 中等敏感度)
ffmpeg -i input.mp4 -vf "select='gt(scene,0.3)',showinfo" -vsync vfr -f null - 2>&1 | grep showinfo

静音检测实现自动剪辑

# 查找静音片段(用于裁剪静音段)
ffmpeg -i input.mp4 -af silencedetect=noise=-30dB:d=2 -f null - 2>&1 | grep silence

高光片段提取

使用Claude分析转录稿+场景时间戳:

“给定这段带时间戳的转录稿和这些场景变化点,识别5个最吸引人的30秒社交片段。”

每个工具的最佳用途

工具优势劣势
Claude / Codex组织、规划、代码生成不是创意品味层
FFmpeg确定性剪辑、批量处理、格式转换无可视化剪辑UI
Remotion可编程叠层、可组合场景、可复用模板非开发者上手难度大
Screen Studio即刻生成精致的屏幕录制仅限屏幕录制
ElevenLabs语音、旁白、音乐、音效不是工作流的核心
Descript / CapCut最终节奏、字幕、润色手动,不可自动化

关键原则

  1. 剪辑,不是生成。 这个工作流是用于剪辑真实素材,而不是根据提示创建内容。
  2. 结构优先于风格。 在第2层先理清故事,再处理视觉元素。
  3. FFmpeg是骨干。 枯燥但关键。它将长素材变得可管理。
  4. Remotion用于可重复性。 如果要做超过一次,就做成Remotion组件。
  5. 选择性生成。 仅对不存在的资产使用AI生成,而不是全部。
  6. 品味是最后一层。 AI清除重复劳动,你做出最终创意决策。

原生Fusion预设

ITO Production v1 提供克制的发光效果、对立的RGB空间偏移以及亮度/边缘光晕。经过原生导入、保存/重新打开以及双源视觉检查后的短期动态渲染检查。这些是基于镜头的起始值,需要针对具体镜头进行调整;光晕不检测或跟踪主体。

ITO V28 包含经过原生验证的Fusion图代码片段和一个幂等的Lua安装程序。这些是技术兼容性示例,不建议作为生产默认值:其记录的视觉限制需要在使用前进行调整和品味审核。请参阅捆绑包来源以了解之前的导入和渲染检查范围。

相关技能

  • fal-ai-media — AI图像、视频和音频生成
  • videodb — 服务器端视频处理、索引和流媒体
  • content-engine — 平台原生内容分发

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能