Skip to main content
Glama

FFmpeg-MCP

ffmpegのコマンドラインを使用してMCPサーバーを実現することは非常に便利であり、ダイアログを通じてローカルビデオの検索、調整、ステッチ、再生などの機能を実現できます。

サポートツール

サーバーは次のツールを実装します。

  • find_video_pathパラメータはディレクトリとファイル名です。ファイル名は完全でもサフィックスなしでも構いません。ディレクトリ内を再帰的に検索し、フルパスを返します。

  • get_video_infoパラメータはビデオパスで、ビデオ情報、継続時間/fps/コーデック/幅/高さのリンクを返します。

  • clip_videoパラメータはファイルパス、開始時間、終了時間または継続時間で、トリミングされたファイルパスを返します。

  • concat_videosパラメータは、ファイルのリスト、出力パス、そして幅、高さ、フレームレートなどのファイルリスト内のビデオ要素が一貫している場合は、クイックモード合成が自動的に使用されます。

  • play_video ffplayでビデオ/オーディオを再生します。mov/mp4/avi/mkv/3gpなど多くの形式をサポートします。video_path: ビデオパス speed: 再生速度 loop: 再生回数

  • overlay_video 2つのビデオオーバーレイ。background_video: 背景ビデオパス overlay_video: 前面ビデオパス output_path: 出力ビデオパス position: 相対位置 dx: xオフセット dy: yオフセット

  • scale_videoビデオスケール。video_path: 入力ビデオパス width: 出力ビデオの幅、アスペクト比を -2 に維持 height: 出力ビデオの高さ、アスペクト比を -2 に維持 output_path: 出力ビデオパス

さらに多くの機能が登場します

Related MCP server: mcp-video

インストール手順

  1. プロジェクトをダウンロード

git clone  https://github.com/video-creator/ffmpeg-mcp.git
cd ffmpeg-mcp
uv sync
  1. Cline での構成

{
  "mcpServers": {
    "ffmpeg-mcp": {
      "autoApprove": [],
      "disabled": false,
      "timeout": 60,
      "command": "uv",
      "args": [
        "--directory",
        "/Users/xxx/Downloads/ffmpeg-mcp",
        "run",
        "ffmpeg-mcp"
      ],
      "transportType": "stdio"
    }
  }
}

注意: argsの値: /Users/XXX/Downloads/ffmpegは、実際のダウンロードffmpeg-mcpディレクトリを置き換える必要があります。

サポートされているプラットフォーム

現在、ARM64またはx86_64を含むmacOSプラットフォームのみがサポートされています。

Available Tools

8 tools
clip_videoB
智能视频剪辑函数

参数:
video_path : str - 源视频文件路径
start : int/float/str - 开始时间(支持秒数、MM:SS、HH:MM:SS格式,默认为视频开头,如果不传该参数,或者该参数为负数,从视频结尾往前剪辑)
end : int/float/str - 结束时间(同上,默认为视频结尾)
duration:  int/float/str - 裁剪时长,end和duration必须有一个
output_path: str - 裁剪后视频输出路径,如果不传入,会有一个默认的输出路径
time_out: int - 命令行执行超时时间,默认为300s
返回:
error - 错误码
str - ffmpeg执行过程中所有日志
str - 生成的剪辑文件路径
示例:
clip_video("input.mp4", "00:01:30", "02:30")

Inputs: video_path (required), duration, end, output_path, +2 more.

concat_videosA
使用FFmpeg拼接多个视频文件

参数:
input_files (List[str]): 输入视频文件路径列表
output_path (str): 合并后的输出文件路径,如果不传入,会一个默认的输出路径
fast (bool): 拼接方法,可选值:"True"(默认,要求所有视频必须具有相同的编码格式、分辨率、帧率等参数)| "False(当不确定合并的视频编码格式、分辨率、帧率等参数是否相同的情况下,这个参数应该是False)"

返回:
执行日志

注意:
1. 当fast=True时,要求所有视频必须具有相同的编码格式、分辨率、帧率等参数
2. 推荐视频文件使用相同编码参数,避免拼接失败
3. 输出文件格式由output_path后缀决定(如.mp4/.mkv)

Inputs: input_files (required), fast, output_path.

extract_frames_from_videoB
提取视频中的图像。

参数:
video_path(str) - 视频路径。
fps(int) - 每多少秒抽一帧,如果传0,代表全部都抽,传1,代表每一秒抽1帧。
output_folder(str) - 把图片输出到哪个目录
format(int) - 抽取的图片格式,0:代表png 1:jpg 2:webp
total_frames(int) - 最多抽取多少张,0代表不限制

Inputs: video_path (required), format, fps, output_folder, +1 more.

find_video_pathB
可以查找视频文件路径,查找文件路径,递归查找精确匹配文件名的视频文件路径(支持带或不带扩展名)
参数:
root_path - 要搜索的根目录
video_name - 视频文件名(可以带扩展名,但会忽略扩展名匹配)
返回:
首个匹配的视频文件完整路径,找不到时返回空字符串

Inputs: root_path (required), video_name (required).

get_video_infoC
获取视频信息,包括时长,帧率,codec等

参数:
video_path (str): 输入视频文件路径
返回:
视频详细信息

Inputs: video_path (required).

overlay_videoB
两个视频叠加,注意不是拼接长度,而是画中画效果

参数:
background_video(str) - 背景视频文件的路径。
overlay_video(str) - 前景视频文件路径。
output_path(str) - 输出路径
position(enum) - 相对位置,TopLeft=1: 左上角,TopCenter=2: 上居中, TopRight=3: 右上角 RightCenter=4: 右居中 BottomRight=5: 右下角 BottomCenter=6: 下居中 BottomLeft=7: 左下角 LeftCenter=8: 左居中 Center=9: 居中
dx(int) - 整形,前景视频坐标x偏移值
dy(int) - 整形,前景视频坐标y偏移值

Inputs: background_video (required), overlay_video (required), dx, dy, +2 more.

play_videoB
使用 ffplay 播放视频文件,支持mkv,mp4,mov,avi,3gp等等

参数:
video_path(str) - 视频文件的路径。
speed(float) - 浮点型,播放速率,建议0.5-2之间。
loop(int) - 整形,是否循环播放,1:不循环,播放后就退出,0: 循环播放。

Inputs: video_path (required), loop, speed.

scale_videoC
视频缩放

参数:
width(int) - 目标宽度。
height(int) - 目标高度。
output_path(str) - 输出路径

Inputs: height (required), video_path (required), width (required), output_path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools have distinct purposes (clipping, concatenating, extracting frames, finding files, getting info, overlaying, playing, scaling), but 'clip_video' and 'scale_video' could be confused as both modify video dimensions, though 'clip_video' focuses on time-based trimming while 'scale_video' adjusts resolution. The descriptions clarify this difference, but some overlap exists in the general 'video modification' category.

    Naming Consistency4/5

    The naming follows a consistent verb_noun pattern (e.g., clip_video, concat_videos, extract_frames_from_video), with all tools using snake_case. However, 'find_video_path' slightly deviates by including 'path' in the noun, while others use more generic terms like 'video' or 'frames', but this is minor and doesn't break readability.

    Tool Count5/5

    With 8 tools, the count is well-scoped for an FFmpeg server, covering core video processing tasks like editing, merging, extracting, overlaying, scaling, and playback. Each tool serves a clear function without redundancy, making it a manageable and comprehensive set for typical video manipulation workflows.

    Completeness4/5

    The toolset covers essential FFmpeg operations including trimming, merging, frame extraction, file finding, info retrieval, overlaying, playback, and scaling. Minor gaps exist, such as no direct tools for audio extraction or format conversion, but these can be worked around with existing tools (e.g., using clip_video or overlay_video creatively). The core video editing lifecycle is well-represented.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers