Skill detail
video-editor
Expert guidance for video editing with ffmpeg: encoding, transcoding, remuxing, color spaces, and quality optimization. Directly covers video editing and export.
Inspect before use
Read the source instructions and check the requirements before you install this skill.
SKILL.md
The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.
--- name: video-editor description: Expert guidance for video editing with ffmpeg, encoding best practices, and quality optimization. Use when working with video files, transcoding, remuxing, encoding settings, color spaces, or troubleshooting video quality issues. --- # Video Editor - FFmpeg & Encoding Expert Expert guidance for video editing, encoding, and processing with ffmpeg. This skill covers container formats, codecs, encoding best practices, and quality optimization for video production workflows. ## When to Use This Skill Use this skill when: - Encoding or transcoding video files - Converting between container formats (MKV, MP4, etc.) - Optimizing encoding settings for quality or file size - Troubleshooting video quality issues - Working with color spaces and color matrices - Hardsubbing or softsubbing videos - Preparing videos for specific platforms or devices - Understanding why a video looks wrong after processing ## Core Concepts ### Container vs. Codec **This distinction is critical.** File extensions like `.mkv` or `.mp4` are **container formats** that package already-compressed streams. The actual compression happens through **codecs** like H.264, H.265, VP9, or AV1. | Concept | What It Is | Examples | |---------|------------|----------| | Container | Wrapper that holds video/audio/subtitle streams | MKV, MP4, AVI, MOV, WebM | | Codec | Algorithm that compresses/decompresses video | H.264, H.265/HEVC, VP9, AV1 | | Encoder | Software that implements a codec | x264, x265, libvpx, NVENC | ### Remuxing vs. Reencoding | Operation | What It Does | Quality Impact | Speed | |-----------|--------------|----------------|-------| | **Remuxing** | Moves streams between containers without re-compression | None (lossless) | Very fast | | **Reencoding** | Decodes and re-encodes video with new settings | Always loses quality | Slow | **Rule of thumb:** If you only need to change the container format, remux. Only reencode when absolutely necessary. ## Quality Principles ### What "Quality" Actually Means Video quality measures **how closely the output resembles the source**. Every processing step moves the video further from the original. There is no way to add quality - only preserve or lose it. ### Common Misconceptions | Myth | Reality | |------|---------| | Higher resolution = better quality | Resolution is just dimensions; a 720p video can look better than a 4K one | | Higher bitrate = better quality | Encoder efficiency matters more; same quality at different sizes is possible | | H.265 is always 50% smaller | Depends on encoder settings; poorly-configured H.265 can be worse than H.264 | | Hardware encoding is fine for quality | Hardware encoders (NVENC, QuickSync) sacrifice quality for speed | | AI upscaling improves quality | Upscaling adds artificial detail that wasn't in the source | ### The Encoding Quality Hierarchy From most to least important: 1. **Encoder settings** (CRF, preset, tuning) 2. **Encoder choice** (x264/x265 vs. hardware encoders) 3. **Codec** (H.265 vs. H.264 vs. VP9) ## Quick Reference: FFmpeg Commands ### Remux (Change Container, No Quality Loss) ```bash # MKV to MP4 (preserves all streams) ffmpeg -i input.mkv -c copy output.mp4 # MP4 to MKV ffmpeg -i input.mp4 -c copy output.mkv ``` ### Basic Encoding ```bash # Encode with x264, copy audio ffmpeg -i input.mkv -c:a copy -c:v libx264 -preset slower -crf 20 output.mkv # Encode with x265 ffmpeg -i input.mkv -c:a copy -c:v libx265 -preset slower -crf 22 output.mkv ``` ### Quality-Focused Encoding ```bash # High-quality x264 for animation ffmpeg -i input.mkv -c:a copy -c:v libx264 -preset slower -crf 18 \ -x264-params bframes=8 output.mkv # High-quality x265 ffmpeg -i input.mkv -c:a copy -c:v libx265 -preset slower -crf 20 \ -x265-params bframes=8 output.mkv ``` ## Encoding Settings Deep Dive ### CRF (Constant Rate Factor) CRF controls quality vs. file size tradeoff. **Lower = higher quality, larger file.** | CRF RangRead the full source on GitHub (opens external page)