Skill 详情
video-processing-editing
基于 FFmpeg 的视频编辑自动化,涵盖剪切、修剪、拼接、转场、音频混合、字幕和导出优化。
使用前先检查
自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。
SKILL.md
这段内容是审核时保存的快照。外部来源才是完整且最新的版本。
---
name: video-processing-editing
description: FFmpeg automation for cutting, trimming, concatenating videos. Audio mixing, timeline editing, transitions, effects. Export optimization for YouTube, social media. Subtitle handling, color
grading, batch processing. Use for videogen projects, content creation, automated video production. Activate on "video editing", "FFmpeg", "trim video", "concatenate", "transitions", "export optimization".
NOT for real-time video editing UI, 3D compositing, or motion graphics.
allowed-tools: Read,Write,Edit,Bash(ffmpeg*,ffprobe*,python*)
metadata:
tags:
- video
- processing
- editing
- video-editing
- ffmpeg
pairs-with:
- skill: ai-video-production-master
reason: AI-generated video clips need FFmpeg post-processing for trimming, concatenation, and export
- skill: voice-audio-engineer
reason: Audio tracks for video require voice synthesis, mixing, and synchronization
- skill: sound-engineer
reason: Video sound design and audio mixing use spatial audio and effects processing techniques
---
# Video Processing & Editing
Expert in FFmpeg-based video editing, processing automation, and export optimization for modern content creation workflows.
## When to Use
✅ **Use for**:
- Automated video editing pipelines (script-to-video)
- Cutting, trimming, concatenating clips
- Adding transitions, effects, overlays
- Audio mixing and normalization
- Subtitle/caption handling
- Export optimization for platforms
- Batch video processing
- Color grading and correction
❌ **NOT for**:
- Real-time video editing UI (use DaVinci Resolve/Premiere)
- 3D compositing (use After Effects/Blender)
- Motion graphics animation (use After Effects)
- Basic screen recording (use OBS)
---
## Technology Selection
### Video Editing Tools
| Tool | Speed | Features | Use Case |
|------|-------|----------|----------|
| FFmpeg | Very Fast | CLI automation | Production pipelines |
| MoviePy | Medium | Python API | Programmatic editing |
| PyAV | Fast | Low-level control | Custom processing |
| DaVinci Resolve | Slow | Full NLE | Manual editing |
**Decision tree**:
```
Need automation? → FFmpeg
Need Python API? → MoviePy
Need frame-level control? → PyAV
Need manual editing? → DaVinci Resolve
```
---
## Common Anti-Patterns
### Anti-Pattern 1: Not Using Keyframe-Aligned Cuts
**Novice thinking**: "Just cut the video at any timestamp"
**Problem**: Causes artifacts, black frames, and playback issues.
**Wrong approach**:
```bash
# ❌ Cut at arbitrary timestamp (not keyframe-aligned)
ffmpeg -i input.mp4 -ss 00:01:23.456 -to 00:02:45.678 -c copy output.mp4
# Result: Black frames, artifacts, sync issues
```
**Why wrong**:
- Video codecs use keyframes (I-frames) every 2-10 seconds
- Non-keyframe cuts require re-encoding
- Using `-c copy` (stream copy) without keyframe alignment breaks playback
- GOP (Group of Pictures) structure depends on keyframes
**Correct approach 1**: Re-encode for precise cuts
```bash
# ✅ Re-encode for frame-accurate cutting
ffmpeg -i input.mp4 -ss 00:01:23.456 -to 00:02:45.678 \
-c:v libx264 -crf 18 -preset medium \
-c:a aac -b:a 192k \
output.mp4
# Frame-accurate, but slower (re-encoding)
```
**Correct approach 2**: Keyframe-aligned stream copy
```bash
# ✅ Fast cutting with keyframe alignment
# Step 1: Find keyframes near cut points
ffprobe -select_streams v -show_frames -show_entries frame=pkt_pts_time,key_frame \
-of csv input.mp4 | grep ",1$" | awk -F',' '{print $2}'
# Step 2: Cut at nearest keyframes (fast, no re-encoding)
ffmpeg -i input.mp4 -ss 00:01:22.000 -to 00:02:46.000 -c copy output.mp4
# Blazing fast, no quality loss, but not frame-accurate
```
**Correct approach 3**: Two-pass for best of both worlds
```bash
# ✅ Fast seek + precise cut
ffmpeg -ss 00:01:20.000 -i input.mp4 \
-ss 00:00:03.456 -to 00:01:25.678 \
-c:v libx264 -crf 18 -preset medium \
-c:a aac -b:a 192k \
output.mp4
# -ss BEFORE -i: Fast seek to keyframe (no decode)
# -ss A在 GitHub 阅读完整来源 (打开外部页面)