Addaly is in open beta. Things will change, and AI answers can be wrong — check anything that matters.

Editing Video

Cuts, sound, colour and export — taught on DaVinci Resolve, which costs nothing.

Lesson 73 of 7710 min

Six ffmpeg commands worth knowing

The tool that does the jobs your editor refuses

ffmpeg is a free command-line program that reads and writes essentially every video and audio format there is. Every editor you have used has some version of it, or something like it, buried inside. Learning six commands from it removes a whole class of problem from your week: the file that will not import, the client who needs it 4 MB smaller, the screen recording that drifts out of sync, the codec your free editor declines to write.

Install it with brew install ffmpeg on macOS, sudo apt install ffmpeg on Debian or Ubuntu, winget install ffmpeg on Windows, or from the official downloads page. It has no interface. That is the point: it does one job per line and leaves the machine free.

The general shape is always the same:

bash
ffmpeg -i input.mov  [what to do]  output.mp4

Input first, options, output last. The last filename is always the one being written, and ffmpeg will ask before overwriting.

1. Find out what a file actually is

bash
ffprobe -hide_banner clip.mp4

The two lines beginning Stream #0:0 and Stream #0:1 tell you codec, resolution, frame rate, pixel format and audio sample rate. When somebody says "it won't import", this is the first thing to run, and it is usually the whole diagnosis. For a tidier answer:

bash
ffprobe -v error -select_streams v:0 \
  -show_entries stream=codec_name,width,height,r_frame_rate,pix_fmt \
  -of default=noprint_wrappers=1 clip.mp4

2. Change the box without touching the picture

bash
ffmpeg -i clip.mkv -c copy clip.mp4

Seconds, not minutes, and no quality loss at all, because nothing is decoded. Covered in the container lesson; it belongs on this list because it is the command you will use most.

3. Re-encode to a specific quality

bash
ffmpeg -i master.mov -c:v libx264 -crf 20 -preset slow \
  -pix_fmt yuv420p -c:a aac -b:a 192k out.mp4

-crf 20 is the quality dial — lower is better, 18 is near-transparent, 23 is the default. -preset slow trades encoding time for a smaller file at the same quality.

-pix_fmt yuv420p is the single most useful flag on this page. A file encoded as yuv444p or yuv422p plays perfectly in VLC and refuses to play in QuickTime, Safari and most browsers. When a file works on your machine and not on the client's, check the pixel format first.

4. Trim without re-encoding

bash
ffmpeg -ss 00:01:30 -i in.mp4 -t 60 -c copy out.mp4

Start at one minute thirty, take sixty seconds, copy the streams. Instant, lossless, and it will not land on the exact frame you asked for. With -c copy the cut must begin on a keyframe, and keyframes in a long-GOP file are typically one or two seconds apart, so the start can move by up to that much. For a rough extract this is fine. For a frame-accurate cut, drop -c copy and let it re-encode.

5. Fix a variable frame rate recording

Screen recorders and phones often write variable frame rate files: 30 fps when the screen is still, 12 fps when nothing moves. Editors assume a constant rate, so the audio holds and the picture drifts, and by minute eight the lips are a third of a second late.

bash
ffmpeg -i screen.mp4 -vf "fps=30" -c:v libx264 -crf 18 \
  -c:a copy fixed.mp4

Do this before importing, every time, for anything that came from a screen recorder, a phone screen capture or a game capture tool. The setup block warned about drift; this is the command that cures it.

6. Measure loudness on the exported file

bash
ffmpeg -i final.mp4 -af loudnorm=print_format=summary -f null -

It prints integrated loudness, loudness range and true peak for the actual delivered file rather than for your timeline. The sound block covered what the numbers mean. This is how you check them on the thing you are about to send, which is the only place the check counts.

Two more worth keeping

Extract the audio for a transcription service, or for a sound editor:

bash
ffmpeg -i film.mov -vn -c:a pcm_s24le audio.wav

Make a contact-sheet-style still every ten seconds, for logging or for thumbnails:

bash
ffmpeg -i film.mov -vf "fps=1/10" stills/frame_%04d.jpg

How to be safe with it

ffmpeg never modifies its input. Everything it does produces a new file, so the worst outcome of a wrong command is a wasted file and a wasted minute. That makes it a good place to experiment.

Two habits keep it painless. Work in the folder the files are in, so filenames stay short. And when a command fails, read the last three lines of the output rather than scrolling back through the banner — the actual error is nearly always there, and it nearly always names the stream it could not handle.

Honest limits

ffmpeg is not an editor and this is not a route around learning one. It has no timeline, no scopes and no sense of what a cut is. Its filter syntax is genuinely awkward, the documentation is written for people who already understand it, and half the answers you will find online are for versions from a decade ago. Use it for the six jobs above and reach for the editor for everything else.

Today

Run ffprobe on the last file a client sent you. Then remux it to MP4 with -c copy and time how long it takes.

The one thing to keep

ffmpeg never modifies its input, so inspecting, remuxing, converting a variable frame rate recording and measuring the loudness of a finished file are all free experiments.

Before you move on

A trim with `-ss 00:01:30 -t 60 -c copy` produces a file that starts about a second later than asked. Why?

Pick the one you would defend. Nobody sees your answer.

No ads. No data sale. No public scores on people. Ever.

© 2026 Addaly

Six ffmpeg commands worth knowing · Editing Video · Addaly