Skip to content

FFmpeg

58.3k stars
official open-source macOS Linux Cross-platform Actively maintained

The universal media processing CLI. Convert, compress, extract, and transform audio and video with composable pipe chains and structured JSON metadata output.

Part of the FFmpeg CLI tools for AI agents

What your agent can do

You have a 2GB video file. You need a 720p compressed version, an audio-only MP3, a thumbnail at the 30-second mark, and metadata for your CMS. In a GUI editor, that's four separate export operations with manual settings each time. Your agent runs four commands in parallel and gets all four outputs in seconds. `ffprobe` for metadata, `ffmpeg -vf scale` for resize, `ffmpeg -vn` for audio extraction, `ffmpeg -ss 30 -frames:v 1` for the thumbnail.FFmpeg is the most composable CLI tool in existence. Pipe video from `curl` directly into `ffmpeg` for on-the-fly transcoding. Chain `ffmpeg` outputs into other tools. Read from stdin with `pipe:0`, write to stdout with `pipe:1`. Your agent builds media processing pipelines as shell commands, no temporary files needed. `curl -s $URL | ffmpeg -i pipe:0 -c:v libx264 -f mp4 pipe:1 | aws s3 cp - s3://bucket/output.mp4`.`ffprobe` is the metadata extraction companion. `ffprobe -v quiet -print_format json -show_format -show_streams input.mp4` returns complete media information as structured JSON: codec, resolution, duration, bitrate, frame rate, audio channels, file size. Your agent reads media properties programmatically before deciding what processing to apply.Frame extraction is the AI agent use case. `ffmpeg -i video.mp4 -vf "fps=1/10" frame_%04d.png` extracts one frame every 10 seconds. Feed those frames to a vision model for content analysis, scene detection, or thumbnail selection. Your agent turns video content into visual data that other AI tools can process.The `-y` flag auto-overwrites output files without prompting. Combined with `-v quiet` (suppress log noise) and `-nostdin` (disable interactive stdin), every FFmpeg command is fully non-interactive. Your agent processes media at scale without any human confirmation.

Limitations

Complex command syntax with a steep learning curve. No built-in batch processing UI — your agent scripts loops for multiple files. Hardware acceleration (NVENC, VideoToolbox) requires specific builds and GPU access. The LGPL/GPL license means some codec combinations have licensing implications for commercial distribution. No official MCP server.

Key Commands

ffprobe -print_format json Extract complete media metadata as structured JSON
ffmpeg -i (transcode) Convert media between formats with codec and quality control
ffmpeg -ss -t (clip) Extract a segment from a media file without re-encoding
ffmpeg -vf scale Resize video to specific dimensions
ffmpeg -vn (extract audio) Strip video and extract audio track
ffmpeg fps (extract frames) Extract frames from video at a specified rate
ffmpeg pipe Stream media through stdin/stdout for composable pipelines

GitHub Stats

repo FFmpeg/FFmpeg
stars 58.3k
language C
license LGPL-2.1
last commit Mar 25, 2026

FAQ

Is FFmpeg free?
Yes. FFmpeg is free and open-source under LGPL-2.1 (with optional GPL-2.0 components). Install with `brew install ffmpeg` on macOS or `sudo apt install ffmpeg` on Linux. Static builds for all platforms are available at ffmpeg.org. No usage limits, no paid tiers.
Can AI agents use FFmpeg?
Yes. FFmpeg is fully non-interactive with `-y` (auto-overwrite), `-v quiet` (suppress logs), and `-nostdin` (disable input). `ffprobe -print_format json` provides structured metadata. The command syntax is complex but perfectly suited for LLM generation — agents construct FFmpeg commands from natural language descriptions. Pipe support (`pipe:0`, `pipe:1`) enables composable processing chains.
What is the difference between ffmpeg and ffprobe?
ffmpeg processes media — converting, compressing, cutting, resizing. ffprobe reads media — extracting metadata as JSON, reporting codecs, durations, and stream details. Your agent uses ffprobe first to understand what it's working with, then ffmpeg to transform it. Both ship together in the same package.
Can FFmpeg extract frames for AI vision models?
Yes. `ffmpeg -i video.mp4 -vf 'fps=1/10' frame_%04d.png` extracts one frame every 10 seconds. Feed the frames to GPT-4V, Claude, Gemini, or any vision model for content analysis, scene detection, or thumbnail selection. Your agent turns hours of video into a manageable set of images for AI processing.
Does FFmpeg support streaming?
Yes. FFmpeg handles RTMP, HLS, DASH, and SRT streaming protocols. `ffmpeg -i input.mp4 -f hls -hls_time 4 playlist.m3u8` creates HLS segments for adaptive streaming. Your agent can ingest live streams, transcode in real-time, and output to CDNs or streaming platforms.

Last verified: Mar 25, 2026