# FFmpeg
FFmpeg is a free, [[Open Source]] multimedia framework for recording, converting, and streaming audio and video. Created by [[Fabrice Bellard]] in 2000, it has become the backbone of media processing across the industry—YouTube, VLC, Chrome, OBS, Handbrake, and countless other applications rely on FFmpeg or its libraries. The name combines "FF" (fast forward) with "MPEG" (the video standards group).
FFmpeg supports virtually every audio and video format in existence, from ancient codecs to cutting-edge ones like AV1. Its command-line tools handle everything from simple format conversion to complex filtering pipelines, while its libraries (libavcodec, libavformat, libavfilter) power media playback in browsers, players, and streaming platforms. Licensed under [[LGPL License]] or [[GNU General Public License (GPL)|GNU General Public License]] depending on configuration.
## Core Components
| Component | Description |
|-----------|-------------|
| **ffmpeg** | Command-line tool for transcoding |
| **ffprobe** | Analyze media file properties |
| **ffplay** | Simple media player |
| **libavcodec** | Audio/video codec library |
| **libavformat** | Container format library |
| **libavfilter** | Audio/video filter library |
| **libavutil** | Utility functions |
| **libswscale** | Image scaling and color conversion |
| **libswresample** | Audio resampling |
## Common Usage Examples
```bash
# Convert video format
ffmpeg -i input.avi output.mp4
# Extract audio from video
ffmpeg -i video.mp4 -vn -acodec mp3 audio.mp3
# Resize video
ffmpeg -i input.mp4 -vf scale=1280:720 output.mp4
# Convert to GIF
ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1" output.gif
# Trim video (start at 00:01:00, duration 30s)
ffmpeg -i input.mp4 -ss 00:01:00 -t 30 output.mp4
# Compress video
ffmpeg -i input.mp4 -crf 28 -preset slow output.mp4
# Concatenate videos
ffmpeg -f concat -i filelist.txt -c copy output.mp4
# Add subtitles
ffmpeg -i input.mp4 -vf subtitles=subs.srt output.mp4
# Stream to RTMP
ffmpeg -i input.mp4 -c:v libx264 -f flv rtmp://server/live/stream
```
## Supported Formats (Selection)
| Category | Formats |
|----------|---------|
| **Video Codecs** | H.264, H.265/HEVC, VP8, VP9, AV1, MPEG-4, ProRes |
| **Audio Codecs** | AAC, MP3, FLAC, Opus, Vorbis, AC3, PCM |
| **Containers** | MP4, MKV, WebM, AVI, MOV, FLV, TS |
| **Images** | PNG, JPEG, GIF, WebP, BMP, TIFF |
| **Streaming** | HLS, DASH, RTMP, RTSP, SRT |
## Filter Examples
FFmpeg's filter system enables complex processing:
```bash
# Video filters (-vf)
-vf "crop=640:480:0:0" # Crop video
-vf "rotate=PI/2" # Rotate 90 degrees
-vf "fade=in:0:30" # Fade in over 30 frames
-vf "drawtext=text='Hello'" # Add text overlay
-vf "hue=s=0" # Convert to grayscale
# Audio filters (-af)
-af "volume=2.0" # Double volume
-af "atempo=1.5" # Speed up audio
-af "highpass=f=200" # Remove low frequencies
```
## Who Uses FFmpeg
- **YouTube**: Transcoding uploaded videos
- **VLC**: Media playback
- **Chrome/Firefox**: WebM/VP9 decoding
- **OBS Studio**: Streaming and recording
- **Handbrake**: Video transcoding GUI
- **Plex/Jellyfin**: Media server transcoding
- **WhatsApp/Telegram**: Media processing
## History
- **2000**: Fabrice Bellard starts FFmpeg project
- **2004**: Michael Niedermayer becomes lead maintainer
- **2011**: Libav fork (later largely reunified)
- **2015**: FFmpeg adds HEVC/H.265 support
- **2018**: AV1 decoder added
- **Present**: Active development, ~1000 contributors
## FFmpeg vs Other Tools
| Aspect | FFmpeg | Handbrake | Adobe Media Encoder |
|--------|--------|-----------|---------------------|
| Interface | CLI | GUI | GUI |
| Price | Free | Free | Subscription |
| Flexibility | Maximum | Limited presets | Medium |
| Batch processing | Excellent | Good | Good |
| Learning curve | Steep | Easy | Medium |
## References
- https://ffmpeg.org
- https://ffmpeg.org/documentation.html
- https://en.wikipedia.org/wiki/FFmpeg
- https://trac.ffmpeg.org/wiki
## Related
- [[Fabrice Bellard]]
- [[Open Source]]
- [[LGPL License]]
- [[GNU General Public License (GPL)]]