ffmpeglisted
Install: claude install-skill sakydev/claude
# FFmpeg Skill
## Hard rules
1. **Never overwrite the original.** Write to a new file. Derive the name if none given: `video.mp4` becomes `video_compressed.mp4`. Never use `-y` on the same path as the input.
2. **Never destroy quality.** Minimum floors:
| Codec | Flag | Floor | Good default |
|---|---|---|---|
| H.264 (libx264) | `-crf` | 28 max | 18-23 |
| H.265 (libx265) | `-crf` | 32 max | 24-28 |
| VP9 (libvpx-vp9) | `-crf` | 40 max | 31-36 |
| AAC | `-b:a` | 128k min | 192k |
| MP3 | `-q:a` | 4 max | 2 |
If the target size requires going below these floors, say so. Offer the best size achievable at the floor instead.
3. **File over 1 GB? Stop.** Say: "This file is [size]. Processing will take a while and produce large intermediates. Continue?" Only proceed with confirmation.
## Step 1 — Inspect first
Always run this before building any command:
```bash
ffprobe -v quiet -print_format json -show_format -show_streams "<input>"
```
Read the size, codec, resolution, bitrate, duration. Check the 1 GB rule here.
## Step 2 — Pick the right approach
**Compression:** `libx264 -crf 23 -preset slow`. Copy audio unless asked otherwise: `-c:a copy`.
**Format conversion:** If only the container changes, use `-c copy`. No re-encode. No quality loss. Instant.
**Trimming:** `-ss` before `-i` for fast seek. `-c copy` when possible.
**Audio extraction:** `-vn -c:a copy` to extract without re-encoding.
**Scaling:** `-vf scale=1280:-2` to preserve aspec