video-editing
affaan-m/ECC
利用 FFmpeg、Remotion、ElevenLabs、fal.ai 以及传统编辑软件组成的工作流,对真实视频素材进行剪辑、结构调整和增强处理。
...展开全部视频剪辑
针对真实视频素材的AI辅助剪辑。并非根据提示生成内容,而是快速剪辑现有视频。
何时启用
- 用户希望编辑、剪切或重组视频素材
- 将长视频剪辑成短视频
- 利用原始素材制作视频博客、教程或演示视频
- 为现有视频添加叠加层、字幕、音乐或旁白
- 为不同平台(YouTube、TikTok、Instagram)重新裁剪视频
- 用户说“编辑视频”、“剪辑这段素材”、“制作vlog”或“视频制作流程”
核心论点
当你不再要求AI生成完整的视频,而是开始利用它来压缩、结构化和增强真实素材时,AI视频编辑便彰显其价值。其价值不在于生成,而在于压缩。
工作流程
Screen Studio / 原始素材
→ Claude / Codex
→ FFmpeg
→ Remotion
→ ElevenLabs / fal.ai
→ Descript 或 CapCut
每个环节都有特定的任务。请勿跳过任何环节,也请勿试图让单一工具包揽下所有工作。
第 1 层:采集(Screen Studio / 原始素材)
收集源素材:
- Screen Studio:用于应用演示、编程实况和浏览器工作流的精修屏幕录像
- 原始摄像素材:视频博客素材、访谈、活动录像
- 通过 VideoDB 进行桌面录制:带有实时上下文的会话录制(参见
videodb技能)
输出:可供整理的原始文件。
第二层:整理(Claude / Codex)
使用 Claude Code 或 Codex 来:
- 转录与标注:生成文字稿,识别话题和主题
- 规划结构:决定保留哪些内容、删减哪些内容以及最佳排序方式
- 识别冗余段落:找出停顿、跑题和重复镜头
- 生成剪辑决策清单:标记剪切时间戳、保留片段
- 生成 FFmpeg 和 Remotion 代码框架:生成相关命令和组合
示例提示:
“这是一段4小时录音的文字记录。请从中筛选出8个最具表现力的片段,
用于制作一段24分钟的视频博客。请为每个片段提供相应的FFmpeg剪辑命令。”
这一层侧重于结构,而非最终的创意品味。
第三层:确定性剪辑(FFmpeg)
FFmpeg 负责处理那些枯燥但至关重要的工作:分割、修剪、拼接和预处理。
按时间戳提取片段
ffmpeg -i raw.mp4 -ss 00:12:30 -to 00:15:45 -c copy segment_01.mp4
根据编辑决策列表批量剪辑
#!/bin/bash
# cuts.txt:起始时间、结束时间、标签
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 "文件 '$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 (
{/* 主素材 */}
{/* 标题叠加 */}
AI 剪辑套件
{/* 下一段 */}
);
};
渲染输出
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卷素材:
generate(app_id: "fal-ai/nano-banana-pro", input_data: {
"prompt": "科技视频博客的专业缩略图,深色背景,屏幕上显示代码",
"image_size": "landscape_16_9"
})
VideoDB 生成式音频
如果已配置 VideoDB:
voiceover = coll.generate_voice(text="此处为旁白", voice="alloy")
music = coll.generate_music(prompt="编程视频博客的低保真背景音乐", duration=120)
sfx = coll.generate_sound_effect(prompt="轻柔的呼啸过渡音")
第6层:最终润色(Descript / CapCut)
最后一层由人工完成。使用传统剪辑软件进行:
- 节奏控制:调整感觉过快或过慢的剪辑点
- 字幕:自动生成后手动润色
- 调色:基础校正与氛围营造
- 最终音频混音:平衡人声、音乐和音效的音量
- 导出:针对不同平台的格式及画质设置
这正是展现个人品味的环节。AI 负责处理重复性工作,最终决策权掌握在您手中。
社交媒体内容重构
不同平台需要不同的宽高比:
| 平台 | 宽高比 | 分辨率 |
|---|---|---|
| YouTube | 16:9 | 1920x1080 |
| TikTok / Reels | 9:16 | 1080×1920 |
| Instagram 动态 | 1:1 | 1080×1080 |
| X / Twitter | 16:9 或 1:1 | 1280x720 或 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 | 确定性剪辑、批处理、格式转换 | 无可视化编辑界面 |
| Remotion | 可编程叠加层、可组合场景、可复用模板 | 非开发者需经历学习曲线 |
| Screen Studio | 即时生成精美的屏幕录制视频 | 仅支持屏幕录制 |
| ElevenLabs | 语音、旁白、音乐、音效 | 并非工作流的核心 |
| Descript / CapCut | 最终节奏调整、字幕添加、润色 | 需手动操作,无法自动化 |
核心原则
- 编辑,而非生成。此工作流旨在剪辑真实素材,而非根据提示生成内容。
- 结构优先于风格。在触碰任何视觉元素之前,先在第2层理清故事脉络。
- FFmpeg是核心支柱。虽然枯燥但至关重要。它让冗长的素材变得可控。
- 使用 Remotion 实现可重复性。如果某项操作需要重复执行,就将其转化为 Remotion 组件。
- 有选择地生成。仅将 AI 生成用于不存在的素材,而非包罗万象。
- 审美是最后一层。AI 负责处理重复性工作,最终的创意决策由你来定。
相关技能
fal-ai-media— AI 图像、视频和音频生成videodb— 服务器端视频处理、索引和流媒体传输content-engine— 平台原生内容分发
---
name: video-editing
description: Edit real video footage using a pipeline of FFmpeg, Remotion, ElevenLabs, fal.ai, and traditional editors for cutting, structuring, and augmenting raw captures.
---
# Video Editing
AI-assisted editing for real footage. Not generation from prompts. Editing existing video fast.
## When to Activate
- User wants to edit, cut, or structure video footage
- Turning long recordings into short-form content
- Building vlogs, tutorials, or demo videos from raw capture
- Adding overlays, subtitles, music, or voiceover to existing video
- Reframing video for different platforms (YouTube, TikTok, Instagram)
- User says "edit video", "cut this footage", "make a vlog", or "video workflow"
## Core Thesis
AI video editing is useful when you stop asking it to create the whole video and start using it to compress, structure, and augment real footage. The value is not generation. The value is compression.
## The Pipeline
```
Screen Studio / raw footage
→ Claude / Codex
→ FFmpeg
→ Remotion
→ ElevenLabs / fal.ai
→ Descript or CapCut
```
Each layer has a specific job. Do not skip layers. Do not try to make one tool do everything.
## Layer 1: Capture (Screen Studio / Raw Footage)
Collect the source material:
- **Screen Studio**: polished screen recordings for app demos, coding sessions, browser workflows
- **Raw camera footage**: vlog footage, interviews, event recordings
- **Desktop capture via VideoDB**: session recording with real-time context (see `videodb` skill)
Output: raw files ready for organization.
## Layer 2: Organization (Claude / Codex)
Use Claude Code or Codex to:
- **Transcribe and label**: generate transcript, identify topics and themes
- **Plan structure**: decide what stays, what gets cut, what order works
- **Identify dead sections**: find pauses, tangents, repeated takes
- **Generate edit decision list**: timestamps for cuts, segments to keep
- **Scaffold FFmpeg and Remotion code**: generate the commands and compositions
```
Example prompt:
"Here's the transcript of a 4-hour recording. Identify the 8 strongest segments
for a 24-minute vlog. Give me FFmpeg cut commands for each segment."
```
This layer is about structure, not final creative taste.
## Layer 3: Deterministic Cuts (FFmpeg)
FFmpeg handles the boring but critical work: splitting, trimming, concatenating, and preprocessing.
### Extract segment by timestamp
```bash
ffmpeg -i raw.mp4 -ss 00:12:30 -to 00:15:45 -c copy segment_01.mp4
```
### Batch cut from edit decision list
```bash
#!/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
```
### Concatenate segments
```bash
# Create file list
for f in segments/*.mp4; do echo "file '$f'"; done > concat.txt
ffmpeg -f concat -safe 0 -i concat.txt -c copy assembled.mp4
```
### Create proxy for faster editing
```bash
ffmpeg -i raw.mp4 -vf "scale=960:-2" -c:v libx264 -preset ultrafast -crf 28 proxy.mp4
```
### Extract audio for transcription
```bash
ffmpeg -i raw.mp4 -vn -acodec pcm_s16le -ar 16000 audio.wav
```
### Normalize audio levels
```bash
ffmpeg -i segment.mp4 -af loudnorm=I=-16:TP=-1.5:LRA=11 -c:v copy normalized.mp4
```
## Layer 4: Programmable Composition (Remotion)
Remotion turns editing problems into composable code. Use it for things that traditional editors make painful:
### When to use Remotion
- Overlays: text, images, branding, lower thirds
- Data visualizations: charts, stats, animated numbers
- Motion graphics: transitions, explainer animations
- Composable scenes: reusable templates across videos
- Product demos: annotated screenshots, UI highlights
### Basic Remotion composition
```tsx
import { AbsoluteFill, Sequence, Video, useCurrentFrame } from "remotion";
export const VlogComposition: React.FC = () => {
const frame = useCurrentFrame();
return (
<AbsoluteFill>
{/* Main footage */}
<Sequence from={0} durationInFrames={300}>
<Video src="/segments/intro.mp4" />
</Sequence>
{/* Title overlay */}
<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)",
}}>
The AI Editing Stack
</h1>
</AbsoluteFill>
</Sequence>
{/* Next segment */}
<Sequence from={300} durationInFrames={450}>
<Video src="/segments/demo.mp4" />
</Sequence>
</AbsoluteFill>
);
};
```
### Render output
```bash
npx remotion render src/index.ts VlogComposition output.mp4
```
See the [Remotion docs](https://www.remotion.dev/docs) for detailed patterns and API reference.
## Layer 5: Generated Assets (ElevenLabs / fal.ai)
Generate only what you need. Do not generate the whole video.
### Voiceover with ElevenLabs
```python
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": "Your narration text here",
"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)
```
### Music and SFX with fal.ai
Use the `fal-ai-media` skill for:
- Background music generation
- Sound effects (ThinkSound model for video-to-audio)
- Transition sounds
### Generated visuals with fal.ai
Use for insert shots, thumbnails, or b-roll that doesn't exist:
```
generate(app_id: "fal-ai/nano-banana-pro", input_data: {
"prompt": "professional thumbnail for tech vlog, dark background, code on screen",
"image_size": "landscape_16_9"
})
```
### VideoDB generative audio
If VideoDB is configured:
```python
voiceover = coll.generate_voice(text="Narration here", voice="alloy")
music = coll.generate_music(prompt="lo-fi background for coding vlog", duration=120)
sfx = coll.generate_sound_effect(prompt="subtle whoosh transition")
```
## Layer 6: Final Polish (Descript / CapCut)
The last layer is human. Use a traditional editor for:
- **Pacing**: adjust cuts that feel too fast or slow
- **Captions**: auto-generated, then manually cleaned
- **Color grading**: basic correction and mood
- **Final audio mix**: balance voice, music, and SFX levels
- **Export**: platform-specific formats and quality settings
This is where taste lives. AI clears the repetitive work. You make the final calls.
## Social Media Reframing
Different platforms need different aspect ratios:
| Platform | Aspect Ratio | Resolution |
|----------|-------------|------------|
| YouTube | 16:9 | 1920x1080 |
| TikTok / Reels | 9:16 | 1080x1920 |
| Instagram Feed | 1:1 | 1080x1080 |
| X / Twitter | 16:9 or 1:1 | 1280x720 or 720x720 |
### Reframe with FFmpeg
```bash
# 16:9 to 9:16 (center crop)
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" vertical.mp4
# 16:9 to 1:1 (center crop)
ffmpeg -i input.mp4 -vf "crop=ih:ih,scale=1080:1080" square.mp4
```
### Reframe with VideoDB
```python
from videodb import ReframeMode
# Smart reframe (AI-guided subject tracking)
reframed = video.reframe(start=0, end=60, target="vertical", mode=ReframeMode.smart)
```
## Scene Detection and Auto-Cut
### FFmpeg scene detection
```bash
# Detect scene changes (threshold 0.3 = moderate sensitivity)
ffmpeg -i input.mp4 -vf "select='gt(scene,0.3)',showinfo" -vsync vfr -f null - 2>&1 | grep showinfo
```
### Silence detection for auto-cut
```bash
# Find silent segments (useful for cutting dead air)
ffmpeg -i input.mp4 -af silencedetect=noise=-30dB:d=2 -f null - 2>&1 | grep silence
```
### Highlight extraction
Use Claude to analyze transcript + scene timestamps:
```
"Given this transcript with timestamps and these scene change points,
identify the 5 most engaging 30-second clips for social media."
```
## What Each Tool Does Best
| Tool | Strength | Weakness |
|------|----------|----------|
| Claude / Codex | Organization, planning, code generation | Not the creative taste layer |
| FFmpeg | Deterministic cuts, batch processing, format conversion | No visual editing UI |
| Remotion | Programmable overlays, composable scenes, reusable templates | Learning curve for non-devs |
| Screen Studio | Polished screen recordings immediately | Only screen capture |
| ElevenLabs | Voice, narration, music, SFX | Not the center of the workflow |
| Descript / CapCut | Final pacing, captions, polish | Manual, not automatable |
## Key Principles
1. **Edit, don't generate.** This workflow is for cutting real footage, not creating from prompts.
2. **Structure before style.** Get the story right in Layer 2 before touching anything visual.
3. **FFmpeg is the backbone.** Boring but critical. Where long footage becomes manageable.
4. **Remotion for repeatability.** If you'll do it more than once, make it a Remotion component.
5. **Generate selectively.** Only use AI generation for assets that don't exist, not for everything.
6. **Taste is the last layer.** AI clears repetitive work. You make the final creative calls.
## Related Skills
- `fal-ai-media` — AI image, video, and audio generation
- `videodb` — Server-side video processing, indexing, and streaming
- `content-engine` — Platform-native content distribution
所有文件
1 个文件安装 video-editing
下载技能文件并将其解压到 .claude/skills/ 目录中。
下载ZIP克隆仓库并复制技能文件到您的项目中。
git clone https://github.com/affaan-m/ECC/tree/main/skills/video-editing # Copy SKILL.md to your .claude/skills/ directory
复制





首页
