Skip to main content
Glama

FFmpeg-MCP

El uso de la línea de comandos ffmpeg para lograr un servidor mcp puede ser muy conveniente; a través del diálogo, se logra la búsqueda de video local, la adaptación, la unión, la reproducción y otras funciones.

Herramientas de soporte

El servidor implementa las siguientes herramientas:

  • find_video_path Los parámetros son el directorio y el nombre del archivo, el nombre del archivo puede estar completo o no tener sufijo, búsqueda recursiva en el directorio, devuelve la ruta completa

  • get_video_info Los parámetros son la ruta del video, devuelven la información del video, vinculan duración/fps/codec/ancho/alto.

  • clip_video El parámetro es la ruta del archivo, la hora de inicio, la hora de finalización o la duración, y devuelve la ruta del archivo recortada

  • concat_videos Los parámetros son la lista de archivos, la ruta de salida y, si los elementos de vídeo en la lista de archivos, como el ancho, la altura, la velocidad de cuadros, etc., son consistentes, se utiliza automáticamente la síntesis de modo rápido.

  • play_video Reproduce video/audio con ffplay, admite muchos formatos, como mov/mp4/avi/mkv/3gp, video_path: ruta de video speed: frecuencia de reproducción loop: cantidad de reproducciones

  • overlay_video Dos superposiciones de vídeo. background_video: ruta de vídeo de fondo overlay_video: ruta de vídeo frontal output_path: ruta de vídeo de salida position: ubicación relativa dx: desplazamiento x dy: desplazamiento y

  • scale_video Escala de video. video_path: ruta de video de entrada width: ancho de video de salida, -2 mantener aspecto height: altura de video de salida, -2 mantener aspecto output_path: ruta de video de salida

Próximamente se añadirán más funciones

Related MCP server: mcp-video

Procedimiento de instalación

  1. Descargar proyecto

git clone  https://github.com/video-creator/ffmpeg-mcp.git
cd ffmpeg-mcp
uv sync
  1. Configuración en Cline

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

Nota: el valor: /Users/XXX/Downloads/ffmpeg en args debe reemplazar el directorio de descarga real ffmpeg-mcp

Plataformas compatibles

Actualmente, solo se admiten plataformas macOS, incluidas ARM64 o x86_64

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

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers