FFmpeg Fundamentals (2025)
Foundational FFmpeg knowledge for 7.1 LTS and 8.0.1. This SKILL is a lean orchestrator; detailed recipes and tables live under references/.
When to Use This Skill
Use for foundational FFmpeg operations:
- First-time FFmpeg users needing syntax help
- Basic transcoding between formats (MP4, WebM, MKV, MOV)
- Understanding codec options and quality settings
- Simple filter operations (scale, crop, rotate)
- File analysis with ffprobe
For specialized topics see related skills: hardware encoding -> ffmpeg-hardware-acceleration, streaming -> ffmpeg-streaming, Docker -> ffmpeg-docker-containers, advanced filter graphs -> ffmpeg-filter-complex-patterns.
Quick Reference
| Task |
Command Pattern |
| Convert format |
ffmpeg -i input.ext output.ext |
| Set quality (CRF) |
-c:v libx264 -crf 23 |
| Scale video |
-vf "scale=1920:1080" |
| Trim video |
-ss 00:00:10 -t 00:00:30 |
| Extract audio |
-vn -c:a aac output.m4a |
| Probe file |
ffprobe -v error -show_format -show_streams file |
Core Workflow
- Verify your FFmpeg version with
ffmpeg -version. Prefer the latest stable (8.0.1) or the 7.1 LTS.
- Probe the input with
ffprobe to inspect codecs, container, resolution, and duration.
- Decide whether to remux (
-c copy) or transcode (specify encoders, quality).
- Pick encoders and quality settings (see Codec Reference below).
- Add filters as needed (see
references/filter-essentials.md and references/frame-manipulation.md).
- Verify the output: re-probe, check duration, A/V sync, and pixel format.
Basic Command Syntax
ffmpeg [global_options] {[input_options] -i input} ... {[output_options] output} ...
Common examples:
# Basic transcode
ffmpeg -i input.mp4 output.mkv
# Specify codecs
ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mp4
# Copy streams without re-encoding (remux)
ffmpeg -i input.mkv -c copy output.mp4
# CRF quality mode
ffmpeg -i input.mp4 -c:v libx264 -crf 23 output.mp4
# Bitrate mode
ffmpeg -i input.mp4 -c:v libx264 -b:v 5M output.mp4
# Overwrite without prompting
ffmpeg -y -i input.mp4 output.mp4
# Show progress as parseable stats
ffmpeg -progress - -i input.mp4 output.mp4
For exhaustive option ordering rules, stream specifiers, and per-format option tables, see the ffmpeg-command-syntax skill.
Codec Reference (2025)
Video Codecs (Software)
| Codec |
Encoder |
Use Case |
Quality |
Speed |
| H.264/AVC |
libx264 |
Universal compatibility |
Excellent |
Medium |
| H.265/HEVC |
libx265 |
4K, HDR, storage efficiency |
Excellent |
Slow |
| H.266/VVC |
libvvenc |
Next-gen, 8K |
Best |
Very Slow |
| AV1 |
libsvtav1, libaom-av1 |
Web streaming, royalty-free |
Excellent |
Slow-Medium |
| VP9 |
libvpx-vp9 |
WebM, YouTube |
Very Good |
Slow |
| ProRes |
prores_ks |
Professional editing |
Lossless |
Fast |
Hardware Encoders
| Platform |
H.264 |
H.265 |
AV1 |
VVC |
FFv1 |
| NVIDIA |
h264_nvenc |
hevc_nvenc |
av1_nvenc |
- |
- |
| Intel |
h264_qsv |
hevc_qsv |
av1_qsv |
- |
- |
| AMD |
h264_amf |
hevc_amf |
av1_amf |
- |
- |
| Apple |
h264_videotoolbox |
hevc_videotoolbox |
- |
- |
- |
| Vulkan |
h264_vulkan |
hevc_vulkan |
av1_vulkan (8.0+) |
- |
ffv1_vulkan (8.0+) |
Hardware Decoders (FFmpeg 8.0+)
| Platform |
VVC/H.266 |
VP9 |
ProRes RAW |
| VAAPI |
vvc (8.0+) |
Yes |
- |
| QSV |
vvc_qsv (7.1+) |
Yes |
- |
| Vulkan |
- |
vp9 (8.0+) |
Yes (8.0+) |
Audio Codecs
| Codec |
Encoder |
Use Case |
Bitrate Range |
| AAC |
aac, libfdk_aac |
Universal, streaming |
96-320 kbps |
| MP3 |
libmp3lame |
Legacy compatibility |
128-320 kbps |
| Opus |
libopus |
VoIP, streaming, WebM |
32-256 kbps |
| FLAC |
flac |
Lossless archival |
~900 kbps |
| AC3 |
ac3 |
DVD, Blu-ray |
384-640 kbps |
| EAC3 |
eac3 |
Streaming, Dolby Digital+ |
192-768 kbps |
Probing & Analysis
# Get media info as JSON
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
# Get duration
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4
# Get resolution
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 input.mp4
# Get codec
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 input.mp4
# Validate file
ffprobe -v error input.mp4 && echo "Valid" || echo "Invalid"
Best Practices
Performance
- Use
-threads 0 to auto-detect optimal thread count.
- Place
-ss before -i for fast seeking (may be less accurate); after -i for frame-accurate seek.
- Use
-c copy when possible to avoid re-encoding.
- Use hardware acceleration when available.
Quality
- Prefer CRF over bitrate for single-pass encoding.
- Use
-preset slow or slower for better compression.
- Use
-tune options (film, animation, grain) when appropriate.
- Keep
-pix_fmt yuv420p for broad compatibility.
Compatibility
- Use
-movflags +faststart for web MP4 files.
- Use
-vtag hvc1 for HEVC on Apple devices.
- Test on target devices before mass conversion.
- Provide fallback formats for older browsers.
Error Prevention
- Test commands on a sample file first.
- Use
-report for detailed logging.
- Check output file size and duration.
- Verify A/V sync after conversion.
Capability Discovery
ffmpeg -encoders # List encoders
ffmpeg -decoders # List decoders
ffmpeg -formats # List formats
ffmpeg -filters # List filters
ffmpeg -hwaccels # List hardware acceleration methods
ffmpeg -h encoder=libx264 # Encoder-specific options
Exit codes:
- 0: success
- 1: error (check stderr)
- 255: interrupted (Ctrl+C)
Reference Map
Detailed recipes, option tables, and FFmpeg 8.0-specific guides:
references/version-history.md - Full FFmpeg 8.0 / 7.1 LTS feature lists, update strategy, official resources
references/common-operations.md - Format conversion, scaling, trimming, concat, audio, subtitles, Whisper recipe, image ops, output optimization (web/iOS/Android)
references/filter-essentials.md - Video filters (-vf), audio filters (-af), complex filtergraphs, filter_complex syntax reference
references/frame-manipulation.md - Frame rate, setpts, select, thumbnails, tiles, freezing, looping, reversing
references/whisper-transcription.md - Whisper AI filter for speech recognition and subtitle generation
references/vvc-h266-encoding.md - VVC/H.266 encoding with libvvenc plus hardware decode
references/vulkan-compute-codecs.md - Vulkan compute-based codecs (FFv1, AV1, VP9, ProRes RAW)
For deeper dives: ffmpeg-filter-complex-patterns, ffmpeg-hardware-acceleration, ffmpeg-streaming, ffmpeg-captions-subtitles, ffmpeg-audio-processing.
1---
2name: ffmpeg-fundamentals-2025
3description: |
4 Complete FFmpeg core knowledge system for FFmpeg 7.1 LTS and 8.0.1 (latest stable, released 2025-11-20).
5 PROACTIVELY activate for: (1) Basic transcoding and format conversion, (2) Command syntax questions, (3) Codec selection (H.264, H.265, VVC, AV1, VP9, APV), (4) Quality settings (CRF, bitrate, presets), (5) Video/audio filter chains, (6) Trimming, splitting, concatenating, (7) Resolution scaling and aspect ratios, (8) FFmpeg 8.0 features (Whisper AI, Vulkan codecs, APV, WHIP), (9) Version checking and update guidance.
6 Provides: Command syntax reference, codec comparison tables, filter examples, format conversion recipes, probing commands, Whisper transcription examples, version checking commands.
7 Ensures: Correct FFmpeg usage with 2025 best practices and latest stable version.
8metadata:
9 source: https://skillmd.com/skills/josiahsiegel/ffmpeg-fundamentals-2025
10---
11
12# FFmpeg Fundamentals (2025)
13
14Foundational FFmpeg knowledge for 7.1 LTS and 8.0.1. This SKILL is a lean orchestrator; detailed recipes and tables live under `references/`.
15
16## When to Use This Skill
17
18Use for foundational FFmpeg operations:
19
20- First-time FFmpeg users needing syntax help
21- Basic transcoding between formats (MP4, WebM, MKV, MOV)
22- Understanding codec options and quality settings
23- Simple filter operations (scale, crop, rotate)
24- File analysis with ffprobe
25
26For specialized topics see related skills: hardware encoding -> `ffmpeg-hardware-acceleration`, streaming -> `ffmpeg-streaming`, Docker -> `ffmpeg-docker-containers`, advanced filter graphs -> `ffmpeg-filter-complex-patterns`.
27
28## Quick Reference
29
30| Task | Command Pattern |
31|------|-----------------|
32| Convert format | `ffmpeg -i input.ext output.ext` |
33| Set quality (CRF) | `-c:v libx264 -crf 23` |
34| Scale video | `-vf "scale=1920:1080"` |
35| Trim video | `-ss 00:00:10 -t 00:00:30` |
36| Extract audio | `-vn -c:a aac output.m4a` |
37| Probe file | `ffprobe -v error -show_format -show_streams file` |
38
39## Core Workflow
40
411. Verify your FFmpeg version with `ffmpeg -version`. Prefer the latest stable (8.0.1) or the 7.1 LTS.
422. Probe the input with `ffprobe` to inspect codecs, container, resolution, and duration.
433. Decide whether to **remux** (`-c copy`) or **transcode** (specify encoders, quality).
444. Pick encoders and quality settings (see Codec Reference below).
455. Add filters as needed (see `references/filter-essentials.md` and `references/frame-manipulation.md`).
466. Verify the output: re-probe, check duration, A/V sync, and pixel format.
47
48## Basic Command Syntax
49
50```bash
51ffmpeg [global_options] {[input_options] -i input} ... {[output_options] output} ...
52```
53
54Common examples:
55
56```bash
57# Basic transcode
58ffmpeg -i input.mp4 output.mkv
59
60# Specify codecs
61ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mp4
62
63# Copy streams without re-encoding (remux)
64ffmpeg -i input.mkv -c copy output.mp4
65
66# CRF quality mode
67ffmpeg -i input.mp4 -c:v libx264 -crf 23 output.mp4
68
69# Bitrate mode
70ffmpeg -i input.mp4 -c:v libx264 -b:v 5M output.mp4
71
72# Overwrite without prompting
73ffmpeg -y -i input.mp4 output.mp4
74
75# Show progress as parseable stats
76ffmpeg -progress - -i input.mp4 output.mp4
77```
78
79For exhaustive option ordering rules, stream specifiers, and per-format option tables, see the `ffmpeg-command-syntax` skill.
80
81## Codec Reference (2025)
82
83### Video Codecs (Software)
84
85| Codec | Encoder | Use Case | Quality | Speed |
86|-------|---------|----------|---------|-------|
87| H.264/AVC | libx264 | Universal compatibility | Excellent | Medium |
88| H.265/HEVC | libx265 | 4K, HDR, storage efficiency | Excellent | Slow |
89| H.266/VVC | libvvenc | Next-gen, 8K | Best | Very Slow |
90| AV1 | libsvtav1, libaom-av1 | Web streaming, royalty-free | Excellent | Slow-Medium |
91| VP9 | libvpx-vp9 | WebM, YouTube | Very Good | Slow |
92| ProRes | prores_ks | Professional editing | Lossless | Fast |
93
94### Hardware Encoders
95
96| Platform | H.264 | H.265 | AV1 | VVC | FFv1 |
97|----------|-------|-------|-----|-----|------|
98| NVIDIA | h264_nvenc | hevc_nvenc | av1_nvenc | - | - |
99| Intel | h264_qsv | hevc_qsv | av1_qsv | - | - |
100| AMD | h264_amf | hevc_amf | av1_amf | - | - |
101| Apple | h264_videotoolbox | hevc_videotoolbox | - | - | - |
102| Vulkan | h264_vulkan | hevc_vulkan | av1_vulkan (8.0+) | - | ffv1_vulkan (8.0+) |
103
104### Hardware Decoders (FFmpeg 8.0+)
105
106| Platform | VVC/H.266 | VP9 | ProRes RAW |
107|----------|-----------|-----|------------|
108| VAAPI | vvc (8.0+) | Yes | - |
109| QSV | vvc_qsv (7.1+) | Yes | - |
110| Vulkan | - | vp9 (8.0+) | Yes (8.0+) |
111
112### Audio Codecs
113
114| Codec | Encoder | Use Case | Bitrate Range |
115|-------|---------|----------|---------------|
116| AAC | aac, libfdk_aac | Universal, streaming | 96-320 kbps |
117| MP3 | libmp3lame | Legacy compatibility | 128-320 kbps |
118| Opus | libopus | VoIP, streaming, WebM | 32-256 kbps |
119| FLAC | flac | Lossless archival | ~900 kbps |
120| AC3 | ac3 | DVD, Blu-ray | 384-640 kbps |
121| EAC3 | eac3 | Streaming, Dolby Digital+ | 192-768 kbps |
122
123## Probing & Analysis
124
125```bash
126# Get media info as JSON
127ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
128
129# Get duration
130ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4
131
132# Get resolution
133ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 input.mp4
134
135# Get codec
136ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 input.mp4
137
138# Validate file
139ffprobe -v error input.mp4 && echo "Valid" || echo "Invalid"
140```
141
142## Best Practices
143
144### Performance
145
1461. Use `-threads 0` to auto-detect optimal thread count.
1472. Place `-ss` before `-i` for fast seeking (may be less accurate); after `-i` for frame-accurate seek.
1483. Use `-c copy` when possible to avoid re-encoding.
1494. Use hardware acceleration when available.
150
151### Quality
152
1531. Prefer CRF over bitrate for single-pass encoding.
1542. Use `-preset slow` or slower for better compression.
1553. Use `-tune` options (`film`, `animation`, `grain`) when appropriate.
1564. Keep `-pix_fmt yuv420p` for broad compatibility.
157
158### Compatibility
159
1601. Use `-movflags +faststart` for web MP4 files.
1612. Use `-vtag hvc1` for HEVC on Apple devices.
1623. Test on target devices before mass conversion.
1634. Provide fallback formats for older browsers.
164
165### Error Prevention
166
1671. Test commands on a sample file first.
1682. Use `-report` for detailed logging.
1693. Check output file size and duration.
1704. Verify A/V sync after conversion.
171
172## Capability Discovery
173
174```bash
175ffmpeg -encoders # List encoders
176ffmpeg -decoders # List decoders
177ffmpeg -formats # List formats
178ffmpeg -filters # List filters
179ffmpeg -hwaccels # List hardware acceleration methods
180ffmpeg -h encoder=libx264 # Encoder-specific options
181```
182
183Exit codes:
184
185- 0: success
186- 1: error (check stderr)
187- 255: interrupted (Ctrl+C)
188
189## Reference Map
190
191Detailed recipes, option tables, and FFmpeg 8.0-specific guides:
192
193- `references/version-history.md` - Full FFmpeg 8.0 / 7.1 LTS feature lists, update strategy, official resources
194- `references/common-operations.md` - Format conversion, scaling, trimming, concat, audio, subtitles, Whisper recipe, image ops, output optimization (web/iOS/Android)
195- `references/filter-essentials.md` - Video filters (`-vf`), audio filters (`-af`), complex filtergraphs, filter_complex syntax reference
196- `references/frame-manipulation.md` - Frame rate, setpts, select, thumbnails, tiles, freezing, looping, reversing
197- `references/whisper-transcription.md` - Whisper AI filter for speech recognition and subtitle generation
198- `references/vvc-h266-encoding.md` - VVC/H.266 encoding with libvvenc plus hardware decode
199- `references/vulkan-compute-codecs.md` - Vulkan compute-based codecs (FFv1, AV1, VP9, ProRes RAW)
200
201For deeper dives: `ffmpeg-filter-complex-patterns`, `ffmpeg-hardware-acceleration`, `ffmpeg-streaming`, `ffmpeg-captions-subtitles`, `ffmpeg-audio-processing`.