FFmpeg is the world’s most widely used open-source multimedia tool, handling every kind of video and audio conversion and editing. It runs from the command line and powers the back end of many GUI tools.

Tested with: FFmpeg 6.1 (ubuntu-latest / GitHub Actions CI-verified)


What Is FFmpeg?

FFmpeg stands for “Fast Forward Moving Pictures Expert Group” and is a set of libraries and command-line tools for encoding, decoding, converting, and streaming video, audio, and subtitles.

  • Supported formats: MP4, MKV, WebM, MOV, AVI, GIF, and over 100 more
  • Supported codecs: H.264, H.265, AV1, VP9, AAC, MP3, Opus, and more
  • Platforms: Windows / macOS / Linux

Installation

Windows

Download the Windows build from the official download page, extract to C:\ffmpeg\, and add C:\ffmpeg\bin to the PATH environment variable.

# Verify installation
ffmpeg -version

macOS (Homebrew)

brew install ffmpeg

Ubuntu / Debian

sudo apt update && sudo apt install ffmpeg

Basic Command Syntax

FFmpeg commands follow the input → processing → output structure:

ffmpeg -i input_file [options] output_file
ElementDescription
-iFlag for specifying the input file
OptionsEncoding settings, filters, and so on
Output fileThe output format is determined by the extension

Common Commands

Convert video format

# Convert to MP4 (codecs auto-selected)
ffmpeg -i input.mov output.mp4

# Reliable conversion with H.264 + AAC
ffmpeg -i input.mkv -c:v libx264 -c:a aac output.mp4

Compress a video

# CRF mode (23 is standard; higher means more compression)
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset fast output.mp4

See the video compression tool or the compression command guide for details.

Extract audio

# Extract as MP3
ffmpeg -i input.mp4 -vn -c:a libmp3lame -b:a 192k output.mp3

# Extract as AAC
ffmpeg -i input.mp4 -vn -c:a aac -b:a 128k output.aac

See the audio extraction tool (browser-based).

Convert to GIF

# High-quality GIF (using palettegen)
ffmpeg -i input.mp4 -ss 0 -t 5 -vf "fps=15,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i input.mp4 -i palette.png -ss 0 -t 5 -vf "fps=15,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif

See the GIF conversion tool (browser-based).

Extract a thumbnail

# Save a single frame at a given timestamp
ffmpeg -i input.mp4 -ss 00:00:05 -vframes 1 thumbnail.jpg

See the thumbnail extraction tool (browser-based).

Normalize loudness

# Normalize to YouTube standard (-14 LUFS)
ffmpeg -i input.mp4 -af loudnorm=I=-14:TP=-1.5:LRA=11 output.mp4

See the volume adjustment tool (browser-based).


Try It in Your Browser Right Now

We’ve built free browser-based tools that let you try FFmpeg without installing anything.

TaskTool
Make videos smallerVideo compression tool
Convert to GIFGIF conversion tool
Extract audioAudio extraction tool
Grab a thumbnailThumbnail extraction tool
Adjust loudnessVolume adjustment tool

FAQ

Q. I get “ffmpeg command not found”

If ffmpeg -version errors out, the installation isn’t complete or PATH isn’t configured. On Windows, you’ll need to set an environment variable.

Q. The converted file won’t play

Check the output file extension. .mp4 has the best compatibility when combined with H.264 and AAC:

ffmpeg -i input.avi -c:v libx264 -c:a aac -movflags +faststart output.mp4

Q. Processing is too slow

Try -preset ultrafast (at the cost of quality) or GPU-accelerated encoding. See the hardware encoding articles for details.