Originally published at ffmpeg-micro.com.
FFmpeg has over 400 command-line flags, dozens of codecs, and documentation that reads like a reference manual for people who already know what they're doing. Most developers don't need 90% of it.
This guide covers the five operations you'll use in almost every project, the tool you should learn before ffmpeg itself, and when it makes sense to stop running FFmpeg locally and use an API instead.
Start with ffprobe, Not ffmpeg
Before you process anything, learn what you're working with. ffprobe ships with FFmpeg and tells you everything about a media file: codecs, resolution, duration, bitrate, frame rate.
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
This prints structured JSON you can pipe into any script. You'll use it constantly to debug why a transcode failed or why a file is bigger than expected.
The Five Commands You Actually Need
Most FFmpeg tutorials bury you in options. In practice, these five operations cover about 80% of developer use cases.
Convert Between Formats
ffmpeg -i input.mov -c:v libx264 -c:a aac output.mp4
This converts a QuickTime file to MP4 with H.264 video and AAC audio. The -c:v flag sets the video codec, -c:a sets the audio codec.
Compress Video
ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 128k compressed.mp4
CRF (Constant Rate Factor) controls quality. Lower numbers mean higher quality and larger files. 23 is the default. 28 gives you a noticeably smaller file with acceptable quality for most web delivery.
Extract Audio
ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3
The -vn flag strips the video stream entirely. -q:a 2 sets MP3 quality on a 0-9 scale (0 is best, 9 is worst).
Resize Video
ffmpeg -i input.mp4 -vf scale=-2:720 -c:v libx264 -preset fast -crf 23 -c:a copy output.mp4
-vf scale=-2:720 scales the video to 720 pixels tall and calculates width automatically. The -2 keeps it divisible by 2, which H.264 requires.
Trim a Clip
ffmpeg -i input.mp4 -ss 00:00:30 -t 10 -c copy trimmed.mp4
-ss is the start time, -t is the duration in seconds. -c copy avoids re-encoding, so this runs almost instantly.
When to Stop Running FFmpeg Yourself
FFmpeg is the right tool when you're processing files on your own machine. It stops being the right tool when your app needs to process user-uploaded video, or you need video processing inside an automation tool like n8n or Make.com.
At that point, an API handles the same operations without the infrastructure. FFmpeg Micro lets you send a video URL and get a processed file back with a single HTTP call.
Common Pitfalls
-
Forgetting
-yin scripts. FFmpeg prompts before overwriting. Add-yto auto-overwrite in automation. -
Using
-ssafter-i. Put-ssbefore-ifor fast seeking on large files. -
Assuming codec from extension. An
.mp4can hold H.264, H.265, VP9. Always runffprobefirst. -
Ignoring exit codes. Check
$?or you'll silently pass corrupt files downstream.
FAQ
Is FFmpeg hard to learn? The basics take an afternoon. Five commands cover 80% of what developers need.
Can I use FFmpeg without installing it? Yes. Cloud APIs like FFmpeg Micro expose the same operations over HTTP.
Is FFmpeg free? FFmpeg is free and open-source (LGPL/GPL). Running it at scale costs whatever your server costs. API services charge per minute instead.
Last verified May 2026.
Top comments (0)