What Is FFmpeg
FFmpeg is an open-source framework for multimedia processing. The official website defines it as:
A complete, cross-platform solution to record, convert and stream audio and video.
Its defining feature is that decoding, encoding, transcoding, multiplexing (mux), demultiplexing (demux), streaming, filtering, and playback are all handled by a single suite of tools. It runs on all major platforms including Linux, macOS, Windows, BSD, and Solaris.
What FFmpeg Can Do
1. Decode, Encode, and Transcode
FFmpeg can decode and encode “nearly everything humans and machines have created” (official About).
- Decode: Read video and audio from containers such as MP4, MKV, AVI, MOV, and FLV
- Encode: Encode to H.264, H.265, VP9, AV1, AAC, MP3, and more
- Transcode: Decode and then re-encode to a different codec
ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mkv
2. Format Conversion (Container Conversion)
You can change the container (file format) without re-encoding the video or audio. This is called stream copy.
ffmpeg -i input.mkv -c copy output.mp4
Stream copy performs no decoding or encoding, so it is described as “extremely fast with no quality loss” in the official documentation.
3. Filtering
The -vf (video filter) and -af (audio filter) options enable a wide variety of processing.
- Resize, crop, rotate, burn-in subtitles
- Volume adjustment, noise removal, audio channel conversion
- Time-lapse, slow motion
Filters can be connected as a filter graph, enabling complex processing that combines multiple filters (official: ffmpeg-filters).
4. Streaming and Recording
Supports various protocols including RTMP, HLS, DASH, UDP, and TCP for sending and receiving live streams (official: ffmpeg-protocols).
5. Checking Supported Formats and Codecs
You can list the formats and codecs supported by your installed build.
ffmpeg -formats
ffmpeg -codecs
The Difference Between Codecs and Containers (Important Background Knowledge)
These are concepts that are easy to confuse when using FFmpeg.
| Concept | Description | Examples |
|---|---|---|
| Container | A “wrapper” that holds video, audio, subtitle, and other data. Distinguished by file extension. | .mp4, .mkv, .avi, .mov |
| Codec | The method of compressing and decompressing data. | H.264, H.265, AAC, MP3, VP9 |
An MP4 container typically holds H.264 (video) + AAC (audio), but containers and codecs are independent concepts. Technically, it is possible to store H.265 in an MP4 container as well.
FFmpeg Component Structure
According to the official About, FFmpeg consists of the following components.
Command-Line Tools
| Tool | Role |
|---|---|
ffmpeg | Conversion, encoding, filtering, and streaming |
ffprobe | Analysis and display of stream and format information |
ffplay | Simple media player using SDL (mainly for testing) |
For a detailed breakdown of how to use each of these three tools, see “The Difference and Role of ffmpeg / ffprobe / ffplay”.
Libraries for Developers (libav*)
| Library | Role |
|---|---|
libavcodec | Collection of encoders and decoders |
libavformat | Container mux/demux processing |
libavdevice | Device I/O (cameras, microphones, etc.) |
libavfilter | Filter graph processing |
libavutil | Common utilities (math, strings, etc.) |
libswscale | Video scaling and pixel format conversion |
libswresample | Audio resampling and format conversion |
These libraries can also be used in application development. Many software products including VLC, HandBrake, and OBS use FFmpeg’s libraries.
What FFmpeg Cannot Do
Bypassing DRM-Protected Content
FFmpeg alone cannot decode or extract content protected by DRM (Digital Rights Management). Commercially sold Blu-rays and streaming service content are protected under copyright law, and FFmpeg is not designed for such use.
GUI Operation
FFmpeg is a command-line tool. If you need a GUI, use a frontend application such as HandBrake (which uses FFmpeg as a backend).
Real-Time Preview Editing
Non-linear editing (timeline editing in applications like Adobe Premiere or DaVinci) is outside the scope of FFmpeg.
License
FFmpeg is licensed under LGPL v2.1 or later (or optionally GPL v2 or later) (official: FFmpeg Legal).
- LGPL build: The default. Commercial use via dynamic linking is permitted.
- GPL build: Built with the
--enable-gploption. Enables some advanced codecs such as libx264 and libx265. Restrictions apply when embedding in closed-source software.
When distributing binaries, always verify the license and attribution requirements.
One Command to Try First
Once installed, check the version.
ffmpeg -version
Then try converting a file you have on hand.
ffmpeg -i input.mp4 output.avi
This alone converts MP4 → AVI (codecs are automatically selected by FFmpeg).
For installation instructions, see “FFmpeg Installation Guide for Windows / macOS / Linux”. For how to write commands, see “FFmpeg Command Basic Syntax”.
Tested with: ffmpeg 6.1.1 / Ubuntu 24.04 (GitHub Actions runner) Primary sources: ffmpeg.org/about.html / ffmpeg.org/ffmpeg.html