FFmpeg
SKILL.md
Input Seeking (Major Difference)
-ssBEFORE-i: fast seek, may be inaccurate—starts from nearest keyframe-ssAFTER-i: frame-accurate but slow—decodes from start- Combine both:
-ss 00:30:00 -i input.mp4 -ss 00:00:05—fast seek then accurate trim - For cutting, add
-avoid_negative_ts make_zeroto fix timestamp issues
Stream Selection
- Default: first video + first audio—may not be what you want
- Explicit selection:
-map 0:v:0 -map 0:a:1—first video, second audio - All streams of type:
-map 0:a—all audio streams - Copy specific:
-map 0 -c copy—all streams, no re-encoding - Exclude:
-map 0 -map -0:s—all except subtitles
Encoding Quality
- CRF (Constant Rate Factor): lower = better quality, larger file—18-23 typical for H.264
-preset: ultrafast to veryslow—slower = smaller file at same quality