音视频处理MCP服务器

这是一个通过MCP协议为AI助手提供FFmpeg音视频处理能力的服务,支持格式转换、裁剪、压缩、音频/帧提取、合并、字幕和水印叠加等,适用于多媒体内容的自动化编辑与处理场景。

  • by aitherlab-dev
  • Rust
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 aitherlab-dev/mcp-ffmpeg

使用说明

mcp-ffmpeg

MCP server for video/audio processing with FFmpeg. Gives AI assistants (Claude, etc.) the ability to work with media files — convert, trim, compress, extract audio, add subtitles, overlays, and more.

Built with Rust. Communicates over stdio using the Model Context Protocol.

Requirements

  • FFmpeg and ffprobe installed and available in PATH
  • Rust toolchain (to build from source)

Installation

git clone https://github.com/aitherlab-dev/mcp-ffmpeg.git
cd mcp-ffmpeg
cargo build --release

The binary will be at target/release/mcp-ffmpeg.

Configuration

Add to your Claude Code config (~/.claude.json):

{
  "mcpServers": {
    "mcp-ffmpeg": {
      "command": "/path/to/mcp-ffmpeg",
      "type": "stdio"
    }
  }
}

Tools

Tool Description
ffmpeg_info Get media file metadata (duration, resolution, codecs, bitrate, streams)
ffmpeg_convert Convert to another format (mp4, mkv, webm, mov, mp3, wav, etc.)
ffmpeg_trim Cut a segment by start/end time or duration
ffmpeg_compress Compress video with quality presets (low / medium / high)
ffmpeg_extract_audio Extract audio track (mp3, aac, wav, flac, ogg, opus)
ffmpeg_extract_frames Extract image frames at intervals or a specific count
ffmpeg_merge Concatenate multiple media files into one
ffmpeg_add_subtitles Burn subtitles (SRT/ASS/VTT) with customizable style
ffmpeg_add_text_overlay Add text at any position with optional show/hide timing
ffmpeg_add_image_overlay Overlay an image (PNG/JPG, supports transparency) with positioning and timing
ffmpeg_change_aspect_ratio Change aspect ratio (16:9, 9:16, 1:1, etc.) via padding, cropping, or stretching

Examples

Ask your AI assistant:

  • "Get info about video.mp4"
  • "Convert this video to webm"
  • "Cut the first 30 seconds from the video"
  • "Compress the video, medium quality"
  • "Extract audio as mp3"
  • "Take 10 frames evenly spaced from the video"
  • "Merge part1.mp4 and part2.mp4"
  • "Add subtitles from subs.srt"
  • "Put a watermark logo.png in the bottom-right corner"
  • "Make it 9:16 for Instagram Reels"

License

MIT