FFmpeg MCP
FFmpeg MCP is a media processing server that lets you manipulate video and audio files through natural language commands via FFmpeg.
Get Media Info (
ffmpeg_get_info): Retrieve comprehensive metadata (duration, resolution, codecs, bitrate, stream details) for any video/audio file.Convert Format (
ffmpeg_convert): Convert media between formats (MP4, MKV, WebM, MOV, MP3, WAV, etc.) with optional resolution scaling and custom codec selection.Compress Video (
ffmpeg_compress): Reduce file size using quality presets (low/medium/high) and encoding speed presets (ultrafast to veryslow) with optional resolution scaling.Trim Video (
ffmpeg_trim): Extract a segment by specifying start time with either an end time or duration.Merge Videos (
ffmpeg_merge): Concatenate multiple video files into a single output file.Extract Audio (
ffmpeg_extract_audio): Pull audio tracks into formats like MP3, AAC, WAV, FLAC, OGG, or Opus with optional bitrate control.Extract Frames (
ffmpeg_extract_frames): Save frames as images (JPG, PNG, BMP) at a set time interval or as a fixed count distributed across the video.Add Subtitles (
ffmpeg_add_subtitles): Burn/hardcode subtitles (SRT, ASS, VTT) into video with customizable style (outline, shadow, background, glow) and font size.
Provides comprehensive video and audio processing capabilities including format conversion, compression, trimming, audio extraction, frame extraction, subtitle burning, and media file merging through FFmpeg
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FFmpeg MCP compress this video to medium quality to save space"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π¬ ffmpeg-mcp
A powerful MCP server for video and audio processing through FFmpeg
Integrate FFmpeg with Claude, Dive, and other MCP-compatible AI systems. Convert, compress, trim videos, extract audio, and more β all through natural language.
Features β’ Installation β’ Tools β’ Usage β’ Configuration
β¨ Features
π Media Information
Get comprehensive metadata
Duration, resolution, codecs
Bitrate and stream details
JSON formatted output
π Format Conversion
Convert between any formats
MP4, MKV, WebM, MOV, etc.
Custom video/audio codecs
Resolution scaling
ποΈ Video Compression
Quality presets (low/medium/high)
Encoding speed control
H.264 optimization
Size reduction stats
βοΈ Video Trimming
Precise start/end times
Duration-based cuts
Stream copy (fast)
No re-encoding needed
π΅ Audio Extraction
Multiple formats supported
MP3, AAC, WAV, FLAC, OGG, Opus
Bitrate control
High quality output
ποΈ Advanced Features
Merge multiple videos
Extract frames as images
Interval or count-based extraction
JPG, PNG, BMP, WebP output
π Subtitles
Burn-in SRT/ASS/VTT subtitles
Multiple styles available
Customizable font size
Works great with Whisper MCP
Related MCP server: Video & Audio Editing MCP Server
π Installation
Prerequisites
Install FFmpeg on your system:
Getting Started
Add the following config to your MCP client:
{
"mcpServers": {
"ffmpeg": {
"command": "uvx",
"args": ["ffmpeg-mcp-lite"]
}
}
}MCP Client Configuration
Open Dive Desktop
Click "+ Add MCP Server"
Paste the config provided above
Click "Save" and you're ready!
Use the Claude Code CLI to add the ffmpeg MCP server:
claude mcp add ffmpeg uvx ffmpeg-mcp-liteAdd to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"ffmpeg": {
"command": "uvx",
"args": ["ffmpeg-mcp-lite"]
}
}
}Go to Cursor Settings -> MCP -> New MCP Server. Use the config provided above.
Install via the VS Code CLI:
code --add-mcp '{"name":"ffmpeg","command":"uvx","args":["ffmpeg-mcp-lite"]}'Follow the configure MCP guide using the standard config from above.
Manual Installation
pip install ffmpeg-mcp-liteOr with uv:
uv pip install ffmpeg-mcp-liteπ οΈ Available Tools
All tools are prefixed with ffmpeg_ to avoid naming conflicts with other MCP servers.
π Media Information
Get comprehensive video/audio metadata
Parameters:
file_pathReturns: JSON with duration, resolution, codecs, bitrate, streams
π Conversion & Compression
Convert video/audio to different formats
Parameters:
file_path,output_format,scale,video_codec,audio_codecFormats: mp4, mkv, webm, mov, mp3, wav, etc.
Compress video to reduce file size
Parameters:
file_path,quality,scale,presetQuality: low, medium, high
Preset: ultrafast to veryslow
βοΈ Editing
Trim video to extract a segment
Parameters:
file_path,start_time,end_timeordurationTime format: "00:01:30" or seconds
Concatenate multiple videos into one
Parameters:
file_paths(list),output_pathSupports: Same codec videos
π΅ Audio & Frames
Extract audio track from video
Parameters:
file_path,audio_format,bitrateFormats: mp3, aac, wav, flac, ogg, opus
Extract frames as images
Parameters:
file_path,intervalorcount,formatFormats: jpg, png, bmp, webp
π Subtitles
Burn-in subtitles to video (hardcode)
Parameters:
file_path,subtitle_path,style,font_size,output_pathFormats: SRT, ASS, VTT
Styles: outline, shadow, background, glow
π‘ Usage Examples
Get Media Information
"Get info about /path/to/video.mp4"
"What's the resolution and duration of this video?"
"Show me the codec information for my video"Convert Videos
"Convert video.mp4 to WebM format"
"Convert this video to MKV with h265 codec"
"Convert and scale to 1280x720"Compress Videos
"Compress video.mp4 with medium quality"
"Compress this video to reduce file size, use fast preset"
"Compress with high quality and scale to 1920:-1"Trim Videos
"Trim video.mp4 from 00:01:00 to 00:02:30"
"Cut the first 30 seconds from this video"
"Extract a 1-minute clip starting at 5:00"Extract Audio
"Extract audio from video.mp4 as MP3"
"Get the audio track in AAC format with 192k bitrate"
"Extract audio as FLAC for best quality"Extract Frames
"Extract one frame every 5 seconds from video.mp4"
"Get 10 frames evenly distributed from this video"
"Extract frames as PNG images"
"Extract frames as WebP for screen recordings"π‘ For screen recordings, prefer
pngorwebpoverjpgβ JPEG chroma subsampling smears anti-aliased text and 1px UI borders.
Merge Videos
"Merge video1.mp4 and video2.mp4 together"
"Concatenate these three videos into one"Add Subtitles
"Add subtitles.srt to video.mp4"
"Burn in Chinese subtitles with shadow style"
"Add subtitles with font size 32 and glow effect"π§ Configuration
Environment Variables
Variable | Description | Default |
| Path to ffmpeg binary |
|
| Path to ffprobe binary |
|
| Default output directory |
|
Custom Configuration
{
"mcpServers": {
"ffmpeg": {
"command": "uvx",
"args": ["ffmpeg-mcp-lite"],
"env": {
"FFMPEG_OUTPUT_DIR": "/path/to/output"
}
}
}
}ποΈ Architecture
Built With
FFmpeg - Video/audio processing engine
FastMCP - MCP Python framework
asyncio - Async subprocess execution
Python 3.10+ - Type hints and modern features
Key Features
β Async Processing: Non-blocking FFmpeg execution
β Type Safe: Full type hints with mypy validation
β Well Tested: 32 test cases with pytest
β Cross Platform: Works on Windows, macOS, Linux
β Modular Design: One file per tool
π€ Contributing
Contributions are welcome!
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Development
# Clone and install
git clone https://github.com/kevinwatt/ffmpeg-mcp-lite.git
cd ffmpeg-mcp-lite
uv sync
# Run tests
uv run pytest
# Type checking
uv run mypy src/
# Linting
uv run ruff check src/π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
FFmpeg - The powerful multimedia framework
Anthropic - For the Model Context Protocol
Dive - MCP-compatible AI platform
Available Tools
8 toolsffmpeg_add_subtitlesA
Add subtitles to a video file (burn-in/hardcode).
Args:
file_path: Path to the input video file
subtitle_path: Path to the subtitle file (SRT, ASS, VTT)
style: Subtitle style - "outline" (default), "shadow", "background", or "glow"
font_size: Font size for subtitles (default: 24)
output_path: Optional output file path. If not specified, saves to default output directory.
Returns:
Path to the output video with subtitles
Inputs: file_path (required), subtitle_path (required), style, font_size, +1 more. Returns: result
ffmpeg_compressA
Compress a video file to reduce file size.
Args:
file_path: Path to the input video file
quality: Compression quality level - "low" (smallest file), "medium", or "high" (best quality)
scale: Optional resolution scale (e.g., "1280:720", "1920:-1" for auto height)
preset: Encoding speed preset - faster presets = larger files, slower = smaller files
Returns:
Path to the compressed file
Inputs: file_path (required), quality, scale, preset. Returns: result
ffmpeg_convertB
Convert video/audio to a different format.
Args:
file_path: Path to the input media file
output_format: Target format (e.g., mp4, mkv, webm, mp3, wav)
scale: Optional resolution scale (e.g., "1280:720", "1920:-1" for auto height)
video_codec: Optional video codec (e.g., libx264, libx265, libvpx-vp9)
audio_codec: Optional audio codec (e.g., aac, mp3, opus)
Returns:
Path to the converted file
Inputs: file_path (required), output_format (required), scale, video_codec, +1 more. Returns: result
ffmpeg_extract_audioA
Extract audio track from a video file.
Args:
file_path: Path to the input video file
audio_format: Output audio format (mp3, aac, wav, flac, ogg, opus)
bitrate: Audio bitrate (e.g., "128k", "192k", "320k"). If not specified, uses format default.
Returns:
Path to the extracted audio file
Inputs: file_path (required), audio_format, bitrate. Returns: result
ffmpeg_extract_framesA
Extract frames from a video as images.
Args:
file_path: Path to the input video file
interval: Extract one frame every N seconds (e.g., 1.0 for one frame per second)
count: Total number of frames to extract (evenly distributed). Mutually exclusive with interval.
format: Output image format (jpg, png, bmp)
Returns:
Path to the directory containing extracted frames
Inputs: file_path (required), interval, count, format. Returns: result
ffmpeg_get_infoA
Get video/audio file metadata using ffprobe.
Args:
file_path: Path to the media file
Returns:
JSON string with media metadata including duration, resolution,
codecs, bitrate, and stream information
Inputs: file_path (required). Returns: result
ffmpeg_mergeA
Concatenate multiple video files into one.
Args:
file_paths: List of paths to video files to merge (in order)
output_path: Optional output file path. If not specified, saves to default output directory.
Returns:
Path to the merged file
Inputs: file_paths (required), output_path. Returns: result
ffmpeg_trimA
Trim a video to extract a specific segment.
Args:
file_path: Path to the input video file
start_time: Start time (e.g., "00:01:30" or "90" for 90 seconds)
end_time: End time (e.g., "00:02:00"). Mutually exclusive with duration.
duration: Duration of the clip (e.g., "30" for 30 seconds). Mutually exclusive with end_time.
Returns:
Path to the trimmed file
Inputs: file_path (required), start_time (required), end_time, duration. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: adding subtitles, compressing, converting, extracting audio, extracting frames, getting info, merging, and trimming. No overlap in functionality.
All tools follow a consistent 'ffmpeg_verb_noun' pattern in snake_case (e.g., ffmpeg_extract_audio, ffmpeg_get_info). No deviations.
With 8 tools, the server covers a broad range of common FFmpeg operations without being excessive. Each tool serves a distinct, useful purpose.
The tool set covers core video/audio operations (info, conversion, compression, trimming, merging, subtitle addition) but lacks advanced features like video effects or audio filters. It is sufficient for typical use cases.
Maintenance
Related MCP Connectors
Transform video, audio and images, and generate media from prompts. FFmpeg, captions, models.
Video, audio, and image processing for AI agents: convert, transcribe, upscale - 150+ operations.
FFmpeg as a service for AI agents: typed video editing tools, async jobs, downloadable outputs.
Hosted MCP tools for FFmpeg-style video and audio processing through FFMPEG API.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables video editing using natural language commands powered by FFmpeg, supporting operations like trimming, merging, format conversion, and more with real-time progress tracking and error handling.52-
- AlicenseBqualityDmaintenanceProvides powerful video and audio editing capabilities through FFmpeg, enabling AI assistants to perform professional-grade operations including format conversion, trimming, overlays, transitions, and advanced audio processing.2790MIT
- AlicenseBqualityBmaintenanceProvides video and audio manipulation tools powered by FFmpeg, enabling AI assistants to perform media operations such as cutting, converting, and removing silence.6192 npm2MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to perform video and audio processing tasks such as format conversion, cutting, merging, and adding effects via FFmpeg, with hardware acceleration support.193-