MCP server for video format conversion using FFmpeg
Project description
Video Format Converter MCP
基于 MCP (Model Context Protocol) 的视频格式转换服务器,使用 FFmpeg 进行视频处理。
功能特性
- 视频容器转换: MP4、MOV、MKV、WebM、AVI、WMV 等格式互转
- 视频编码设置: 支持 libx264、libx265、vp9、mpeg4 等编码器
- 分辨率调整: 支持指定分辨率或按比例缩放
- 码率控制: 视频码率、音频码率独立设置
- 音频属性: 编码器、采样率、声道数配置
- 智能 Remux: 纯换容器时直接复制流,无需重编码
安装
通过 uvx 安装(推荐):
uvx mcpcn-video-format-converter
或通过 pip 安装:
pip install mcpcn-video-format-converter
使用方法
启动 MCP 服务器:
mcpcn-video-format-converter
系统要求
- Python >= 3.12
- FFmpeg(需要系统安装)
环境变量
FFMPEG_BINARY: 指定 FFmpeg 可执行文件路径FFPROBE_BINARY: 指定 FFprobe 可执行文件路径
工具说明
convert_video_format
批量视频容器转换与属性重设。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| input_video_paths | list[string] | 是 | 输入视频文件路径列表,支持批量转换多个视频 |
| output_dir | string | 是 | 输出目录路径,转换后的视频保存到此目录 |
| target_format | string | 是 | 目标格式 (mp4/mov/mkv/webm/avi/wmv) |
| resolution | string | 否 | 分辨率,如 '1920x1080' 或 '720' |
| video_codec | string | 否 | 视频编码器 (libx264/libx265/vp9等) |
| video_bitrate | string | 否 | 视频码率,如 '2500k' |
| frame_rate | int | 否 | 帧率,如 24/30/60 |
| audio_codec | string | 否 | 音频编码器 (aac/libopus/mp3等) |
| audio_bitrate | string | 否 | 音频码率,如 '128k' |
| audio_sample_rate | int | 否 | 音频采样率,如 44100/48000 |
| audio_channels | int | 否 | 声道数,1=单声道,2=立体声 |
支持的格式与默认编解码器:
| 格式 | 视频编码器 | 音频编码器 | 附加参数 |
|---|---|---|---|
| mp4/m4v | libx264 | aac | movflags=+faststart |
| mov | libx264 | aac | - |
| webm | libvpx-vp9 | libopus | - |
| mkv | libx264 | aac | - |
| avi | mpeg4 | mp3 | - |
| wmv | wmv2 | wmav2 | - |
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcpcn_video_format_converter-0.1.3.tar.gz.
File metadata
- Download URL: mcpcn_video_format_converter-0.1.3.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
522d33dcdc7c3e20f750b08a92559ffd1dbcce0235e9624ef7feadd007603225
|
|
| MD5 |
4a471d13a5c22bece303c488b5f34a28
|
|
| BLAKE2b-256 |
dfadd860f9d39e4a6b3cfa0dd2f8f982cda403250ffb0d9679ce411ad11cd406
|
File details
Details for the file mcpcn_video_format_converter-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mcpcn_video_format_converter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9f54bd0012d05026363ef2cbd1166332feb1c8f2adbdc1cf00ec641d10a22f4
|
|
| MD5 |
284cb8c982f4b55f5b28c8cb05a34522
|
|
| BLAKE2b-256 |
9305f23d8b5c5f7556db6c71cae2525780859fb72948399a346abdd95884e643
|