FFmpeg in 6 commands: convert to MP4, trim without re-encoding, pull MP3 audio, resize to 1280 wide, grab 1 frame a second and compress at CRF 28. ReelSDK runs the same commands over HTTP for $0.02 per compute minute.

How to use ffmpeg

Install 9.0.2 or your system's package (Ubuntu 24.04 ships 6.1.1), then list every input before its output: ffmpeg -i input.avi output.mp4. ReelSDK runs ffmpeg 8.1 for you, on a fresh machine for every job, so there's nothing to install.

LearnUpdated

At a glance

6 ffmpeg commands for everyday jobs

Swap in your own file names.

6 ffmpeg commands for everyday jobs
TaskCommand
Convert to MP4ffmpeg -i input.avi output.mp4
Trim without re-encodingffmpeg -ss 00:00:05 -to 00:00:15 -i in.mp4 -c copy out.mp4
Extract MP3 audioffmpeg -i in.mp4 -vn -c:a libmp3lame -q:a 2 out.mp3
Resize a videoffmpeg -i in.mp4 -vf scale=1280:-2 out.mp4
Save one frame a second as imagesffmpeg -i in.mp4 -vf fps=1 frame_%02d.jpg
Compress a videoffmpeg -i in.mp4 -c:v libx264 -crf 28 -c:a aac out.mp4
Run any of them on ReelSDKPOST /v1/ffmpeg with the same arguments

Source: ffmpeg documentation, checked November 2026.

Install ffmpeg

Install ffmpeg for your operating system, then use it from a terminal. The commands below go in the terminal, not inside a video editor.

On macOS, install it with Homebrew: brew install ffmpeg.

On Windows, ffmpeg.org links to ready-made builds from gyan.dev and BtbN. Download one from either source.

On Ubuntu, run sudo apt install ffmpeg.

The version you get depends on where you install it from. As of November 2026, the newest stable FFmpeg release is 9.0.2, released September 18, 2026. Ubuntu 24.04 ships version 6.1.1, so don't expect its package to match the latest release.

terminal
# macOS
brew install ffmpeg

# Ubuntu and Debian
sudo apt install ffmpeg

# check it
ffmpeg -version

Check that it works

Run ffmpeg -version in your terminal.

You should get version information. If your terminal can't find ffmpeg, the installation isn't ready to use from that terminal yet. Go back to your installation setup before trying the conversion commands.

Keep that version information handy. The latest release, an Ubuntu package, and a browser tool don't necessarily run the same version of FFmpeg (the browser option below uses a different release).

How an ffmpeg command is built

The general shape is ffmpeg [global options] [input options] -i input [output options] output.

Start with ffmpeg, put any input options before the input they belong to, use -i to name that input, then put the output options before the output filename.

The simplest conversion is ffmpeg -i input.avi output.mp4.

input.avi is the file you're starting with. output.mp4 is the file you want to create. Replace those names with your own filenames rather than typing the example names unchanged.

Placement matters. In the trim command from the table above, the time options appear before -i; in the resize command, the video filter appears after the input and before the output.

And if you're working with several inputs, list every input before the outputs. Don't alternate an input and its output, then add another input.

You don't need to fill every part of the general command shape. The brackets describe places where options can go; they aren't characters you type into the terminal.

Commands you'll use all the time

Pick the row in the table above that matches your task, replace the filenames, and run the command. Use a different output filename from your input.

For a format change, start with the conversion command. It takes the AVI input and writes an MP4 output. There's no trim, resize, or audio-only option in that example.

For a trim, replace the timestamps with the start and end you want. Here, -ss sets the start and -to sets the end. The -c copy option copies the streams without re-encoding them.

Just need the audio? The extraction command uses -vn to leave out video, selects libmp3lame for the audio, and writes an MP3 file. Keep the .mp3 output extension for this example.

The resize command uses a video filter, introduced by -vf. Its scale=1280:-2 setting sets the width to 1280 and lets FFmpeg calculate the height while keeping the proportions.

The image command also uses -vf, but with an fps filter instead of scale. Keep frame_%02d.jpg as the filename pattern rather than replacing it with a single image filename.

For compression, use the final row. It selects libx264 for video, applies -crf 28, and selects aac for audio. Start with the command as written before changing its options.

Run it online instead

If you'd rather skip the local installation, ReelSDK, a video rendering API, offers a free Run ffmpeg online tool. It runs FFmpeg 5.1 in your browser with nothing uploaded.

For apps, its API runs ffmpeg 8.1 commands for $0.02 per compute minute. That's separate from the free browser tool.

Check which environment you're using when comparing commands or version information: the browser tool, the API, and your local installation may each have a different FFmpeg version.

FAQ

Questions, answered

Do I need the latest FFmpeg release?

The commands here don't require you to install the latest release specifically. Use ffmpeg -version to check what your installation provides.

Why does Ubuntu show version 6.1.1?

Ubuntu 24.04 ships version 6.1.1. That differs from the latest stable FFmpeg release, 9.0.2, as of November 2026.

Does the online tool upload my video?

No. The free Run ffmpeg online tool runs FFmpeg 5.1 in your browser with nothing uploaded.

What license does FFmpeg use?

Most of FFmpeg is under the LGPL 2.1 or later. A few optional parts are GPL 2 or later, and building with --enable-gpl turns the whole build into GPL.

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains