How to Use FFmpeg: The Beginner's Guide (Install, First Conversion, and the Five Commands That Cover 80%)
CodexFuse Team · 2026-10-29T11:41:27.569Z · 10 min read
Learning how to use FFmpeg takes an afternoon: install it on Windows, Mac or Linux, inspect files with ffprobe, and master the five commands that cover 80% of everyday video work.
Learning how to use FFmpeg is easier than its reputation suggests. FFmpeg is a free, open-source command-line program that converts, compresses, trims, and inspects audio and video files, and it quietly powers much of the internet's media plumbing — from YouTube's upload pipelines to the conversion buttons inside apps you already use. This beginner guide walks you through installing FFmpeg, running your first conversion, and learning the five commands that cover roughly 80% of everyday video work, with the two truths no beginner guide should skip: the output filename is the command, and you inspect before you convert.
What is FFmpeg, and why do developers reach for it?
FFmpeg is a command-line toolkit for working with audio and video files. It reads almost any media format you hand it and writes almost any format back, which makes it the universal adapter between the files you have and the files you need. When a video will not upload, will not open, or is simply too large, FFmpeg is usually the fastest fix — faster than opening a full editor for a one-minute job.
That speed is exactly why YouTubers, developers, and power users keep it around. If your job is closer to cutting and arranging clips into a finished video, learn a real editor instead — the DaVinci Resolve beginner guide covers the free professional option — and reach for FFmpeg for everything around the edit: converting the exports, shrinking files for upload, pulling audio, and trimming clips.
How do I install FFmpeg on Windows, Mac, and Linux?
FFmpeg ships only source code from its own site; for day-to-day use you install a ready-made build through your system's package manager. The FFmpeg project itself links to prebuilt packages, and these are the standard routes as of October 2026:
| System | Command | Notes |
|---|---|---|
| Windows | winget install Gyan.FFmpeg | Requires Windows 10 or newer; the classic alternative is choco install ffmpeg via Chocolatey. |
| macOS | brew install ffmpeg | Needs Homebrew installed first. |
| Linux (Debian/Ubuntu) | sudo apt install ffmpeg | On Arch it is sudo pacman -S ffmpeg; on Fedora sudo dnf install ffmpeg from RPM Fusion. |
After installing, run ffmpeg -version. If it prints version information, you are set; if the terminal says the command is not found, the installer did not put FFmpeg on your PATH and you need to open a fresh terminal or add the folder yourself. The latest stable release checked for this guide is FFmpeg 9.0.2 “Lei”, released September 18, 2026, per the project's own download page — any 7.x or newer build covers everything in this guide.
What is the first FFmpeg command I should run?
Run ffprobe -v error -hide_banner -print_format json -show_streams input.mp4, replacing input.mp4 with your file. ffprobe ships with FFmpeg and reports everything about a media file — its codecs, resolution, duration, bitrate, and frame rate — so you inspect before you convert. You cannot fix a file you have not looked at, and the single biggest beginner habit is skipping this step and guessing.
Then run your first conversion: ffmpeg -i input.mov output.mp4. That one line contains the two truths the rest of this guide builds on. First, the output filename IS the command: FFmpeg chooses the container format from the extension you type, so a typo in the extension is the number-one beginner failure — name the output clip.mkv when you wanted clip.mp4 and you have told FFmpeg to make a different file. Second, when you name only the files, FFmpeg picks reasonable defaults (H.264 video and AAC audio for MP4); explicit codec flags, covered below, give you control over quality and size.
What are the five FFmpeg commands that cover 80% of everything?
Practically every FFmpeg job falls into one of five operations: convert formats, compress, extract audio, trim, or resize. Learn these five commands and you can handle the overwhelming majority of real-world requests:
| Job | Command |
|---|---|
| Convert format | ffmpeg -i input.mov -c:v libx264 -c:a aac output.mp4 |
| Compress video | ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 128k compressed.mp4 |
| Extract audio | ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3 |
| Trim a clip | ffmpeg -i input.mp4 -ss 00:00:30 -t 10 -c copy trimmed.mp4 |
| Resize video | ffmpeg -i input.mp4 -vf scale=-2:720 -c:v libx264 -preset fast -crf 23 -c:a copy output.mp4 |
1. Convert between formats
ffmpeg -i input.mov -c:v libx264 -c:a aac output.mp4 converts a QuickTime MOV to an MP4 with H.264 video and AAC audio. The -c:v flag sets the video codec and -c:a sets the audio codec; together they are the most important two flags in FFmpeg. When you omit them, FFmpeg guesses from the extension, which is fine for quick jobs but worth stating explicitly whenever the result matters.
2. Compress a video
ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 128k compressed.mp4 shrinks a video to a web-friendly size. CRF (constant rate factor) is the quality dial: lower numbers mean higher quality and larger files. For H.264, 23 is the default and a good balance; 28 gives a noticeably smaller file that still looks fine for most web delivery. -preset fast trades a bit of compression efficiency for speed; -b:a 128k sets the audio to 128 kbps, which is plenty for speech and casual music.
3. Extract audio
ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3 strips the video and keeps the audio as MP3. The -vn flag drops the video stream entirely, and -q:a 2 sets MP3 quality on a 0–9 scale where 0 is best and 9 is worst. If you need the audio for a podcast edit or a voice project, you will then likely open it in an audio editor — the Audacity beginner guide picks up exactly where FFmpeg leaves off.
4. Trim a clip without re-encoding
ffmpeg -i input.mp4 -ss 00:00:30 -t 10 -c copy trimmed.mp4 keeps the ten seconds starting at the 30-second mark. -ss is the start time, -t is the duration in seconds, and -c copy copies the streams without re-encoding, so the cut runs almost instantly with zero quality loss. The trade-off: cuts can only land on keyframes, so the exact start may shift by a second or two. If you need frame-accurate cuts, drop -c copy and let FFmpeg re-encode.
5. Resize a video
ffmpeg -i input.mp4 -vf scale=-2:720 -c:v libx264 -preset fast -crf 23 -c:a copy output.mp4 scales the video to 720 pixels tall and calculates the width automatically. The -2 keeps the width divisible by 2, which H.264 requires. Resizing only makes sense downward: shrinking a 1080p video to 720p saves real file size, but upscaling a 720p video to 1080p adds no detail — it only wastes space.
How do I make a video smaller without it looking terrible?
Pick the CRF number for the codec you are actually using, because CRF numbers are codec-specific and quoting one codec's numbers as universal is a common mistake. The values below are a practical ladder for the two codecs beginners use most (anchored to the source guides' stated defaults: libx264's default 23 and libx265 running lower):
| libx264 (H.264) CRF | libx265 (HEVC) CRF | What it looks like |
|---|---|---|
| 18–20 | 20–22 | Near-lossless; huge files, archive quality |
| 23 | 25–26 | The default balance; safe for most purposes |
| 26–28 | 28–30 | Web delivery; smaller files, still looks fine |
| 32+ | 34+ | Aggressive; visible artifacts on detailed scenes |
Two more rules round out the compression picture. First, the -preset flag (ultrafast to veryslow) trades encoding time for efficiency, never quality — a slower preset means a smaller file at the same CRF, not a better-looking one. Second, audio matters more than beginners think: shrinking a stereo track to -b:a 96k can save megabytes on long videos with no audible loss for speech.
What should I do when FFmpeg fails or the output looks wrong?
Run ffprobe first, every time. Most failures trace back to not knowing what the input actually is: an .mp4 can hold H.264, H.265, or VP9 video, so never assume the codec from the extension. The command ffprobe -v error -hide_banner -print_format json -show_streams input.mp4 prints the stream details in structured JSON you can pipe into scripts, and it takes seconds.
Next, read the actual error instead of the command. FFmpeg's errors are usually plain English — “Unknown encoder 'libmp3lame'” means your build lacks that encoder, “Invalid data found when processing input” means the file is corrupt or not the format its extension claims. Finally, check the exit code in any script (echo $? on Linux/Mac, echo %ERRORLEVEL% on Windows): FFmpeg returns non-zero on failure, and ignoring that check is how corrupt files silently pass through automated pipelines.
What are the beginner mistakes that waste the most time?
Five habits account for most wasted beginner hours. Typing the wrong output extension makes a different container than you wanted, because FFmpeg reads the extension as the order — double-check the last three characters of every command. Forgetting -y in scripts makes FFmpeg stop and ask whether to overwrite the output, hanging automation until you add -y to auto-overwrite.
Putting -ss after -i on large files makes seeking slow; place -ss before -i for fast seeks. Assuming the codec from the extension breaks workflows silently — the fix is the same as everything else in this guide: run ffprobe first. And re-encoding everything wastes hours: if the job is only a trim or a container swap, -c copy skips re-encoding entirely and finishes in seconds.
When should I stop using FFmpeg and use something else?
FFmpeg is the right tool when you are processing files on your own machine; it stops being the right tool when you need timeline editing, live previews, or color work. If you are assembling a project, step up to a real editor — the DaVinci Resolve beginner guide covers the free professional path and the Premiere Pro beginner guide covers Adobe's — then use FFmpeg on the exports.
FFmpeg also stops being the right tool when your app needs to process other people's uploads: at that point you are renting a server for it, so compare the cost of a VPS against a hosted media-processing API. If that is your direction, the VPS hosting explainer covers what the server side actually involves. And for interactive encoding, GUI front-ends like HandBrake and Shutter Encoder run the same engine underneath — FFmpeg is the motor, and there is no shame in using a dashboard.
Sources
- FFmpeg.org — Download page (checked October 29, 2026: FFmpeg 9.0.2 “Lei” released September 18, 2026, the latest stable release)
- Javid Jamae — “How to Learn FFmpeg: The Developer's Guide (2026)” (dev.to, May 2026 — the five-operations framework, ffprobe-first debugging, CRF 23/28 values, install via brew/apt/choco)
- IMG.LY — “FFmpeg — Ultimate Guide” (updated September 2026 — trim without re-encoding, H.264/H.265 transcode commands, libx265 CRF 27)
- MundoBytes — “Complete FFmpeg tutorial for editing and converting videos” (conversion and compression command lists)
- MundoBytes — “Practical commands with FFmpeg to convert formats in Linux” (command syntax, format conversion)
- CopyProgramming — 2026 Python FFmpeg guide (system install routes:
brew install ffmpegon macOS,apt install ffmpegon Ubuntu,choco install ffmpegon Windows)
Frequently asked questions
Is FFmpeg hard to learn?
No. The basics take an afternoon: install it, verify with ffmpeg -version, and learn the five commands in this guide. The other 400+ flags exist for specialists, and you may never touch most of them.
Is FFmpeg free to use?
Yes. FFmpeg is free and open-source (released under the LGPL/GPL), so it costs nothing to download and use on your own machine. It only costs money when you run it at scale on rented servers, like everything else.
Do I need to know how to program to use FFmpeg?
No. The commands in this guide are typed into a terminal but they are recipes, not programs — you paste them, swap the filenames, and run. Scripting skills only matter if you want to automate batches.
Why is my FFmpeg output file bigger than the input?
You re-encoded at a higher quality setting than the source, usually by omitting -crf and letting FFmpeg use its default. Add an explicit CRF (28 for H.264 web delivery) or use -c copy when you only need to trim or change containers.
Can FFmpeg convert MOV to MP4 without losing quality?
Usually yes. ffmpeg -i input.mov -c:v libx264 -crf 18 -c:a aac output.mp4 re-encodes near-losslessly, and if the MOV already contains H.264 video and AAC audio, ffmpeg -i input.mov -c copy output.mp4 moves the streams into an MP4 with zero quality loss and finishes in seconds.