DEV Community

Javid Jamae
Javid Jamae

Posted on • Originally published at ffmpeg-micro.com

How to Learn FFmpeg: The Developer's Guide (2026)

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

-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
Enter fullscreen mode Exit fullscreen mode

-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 -y in scripts. FFmpeg prompts before overwriting. Add -y to auto-overwrite in automation.
  • Using -ss after -i. Put -ss before -i for fast seeking on large files.
  • Assuming codec from extension. An .mp4 can hold H.264, H.265, VP9. Always run ffprobe first.
  • 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)