Skip to main content
Glama
  ╔══════════════════════════════════════════════════════╗
  ║                                                      ║
  ║   ████████ ████████ ██    ██ ██████  ████████  ████  ║
  ║   ██       ██       ███  ███ ██   ██ ██       ██     ║
  ║   ██████   ██████   ██ ██ ██ ██████  ██████   ██  ██ ║
  ║   ██       ██       ██    ██ ██      ██       ██  ██ ║
  ║   ██       ██       ██    ██ ██      ████████  ████  ║
  ║                                                      ║
  ║   ██████  ████████ ██    ██ ██████  ████████ ██████  ║
  ║   ██   ██ ██       ███   ██ ██   ██ ██       ██   ██ ║
  ║   ██████  ██████   ██ ██ ██ ██   ██ ██████   ██████  ║
  ║   ██   ██ ██       ██  ████ ██   ██ ██       ██   ██ ║
  ║   ██   ██ ████████ ██    ██ ██████  ████████ ██   ██ ║
  ║                                                      ║
  ║        ██████  ██████   ████                         ║
  ║        ██   ██ ██   ██ ██  ██                        ║
  ║        ██████  ██████  ██  ██                        ║
  ║        ██      ██   ██ ██  ██                        ║
  ║        ██      ██   ██  ████                         ║
  ║                                                      ║
  ║  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░ 8 WRKRS    ║
  ║  GPU: AUTO   DASHBOARD: LIVE   CONCAT: INSTANT       ║
  ╚══════════════════════════════════════════════════════╝

ffmpeg-render-pro

npm version License: MIT Platform: Cross-platform Node.js MCP Server

具备实时仪表盘、GPU 自动检测、检查点系统和流拷贝拼接功能的并行视频渲染工具。这是目前最强大的免费 ffmpeg 渲染工具包。

Beeswax Pat 使用 Claude Code 构建 · 永久免费且开源

特性

  • 并行渲染 — 将帧拆分到 N 个工作线程,无需重新编码即可拼接

  • GPU 自动检测 — 通过 1 帧验证探测 NVENC、VideoToolbox、AMF、VA-API、QSV

  • 实时仪表盘 — 自动在浏览器中打开,显示各工作线程进度、FPS 图表和预计完成时间 (ETA)

  • 检查点系统 — 将长视频渲染的快进开销降低 93%

  • 调色 (Color grading) — 内置 5 种预设(黑色电影、暖色、冷色、电影感、复古)+ 自定义滤镜

  • 音频合并 — 结合视频和音频并进行响度标准化,无需重新编码视频

  • 确定性输出 — 种子化随机数生成器确保并行工作线程产生与顺序渲染一致的结果

  • MCP 服务器 — 包含 6 个工具的 Model Context Protocol 服务器,可与 Claude Code、Claude Desktop 及任何 MCP 客户端配合使用

  • 跨平台 — 支持 Windows、macOS、Linux。支持任何 GPU 或仅 CPU 渲染。需要 Node.js >= 18 + ffmpeg。

Related MCP server: ffmpeg-mcp

要求

  • Node.js >= 18

  • 已安装 ffmpeg 并添加到 PATH 环境变量

安装

# Global install gives you the ffmpeg-render-pro + ffmpeg-render-pro-mcp binaries
npm install -g ffmpeg-render-pro

# Or clone the repo directly
git clone https://github.com/beeswaxpat/ffmpeg-render-pro.git
cd ffmpeg-render-pro

快速开始

# System info (workers, RAM, CPU, ffmpeg version)
ffmpeg-render-pro info

# Probe hardware encoders
ffmpeg-render-pro detect-gpu

# 5s benchmark render (dashboard auto-opens at http://127.0.0.1:8080)
ffmpeg-render-pro benchmark

# Longer render, custom resolution
ffmpeg-render-pro benchmark --duration=30 --width=1080 --height=1920 --fps=30

# Force CPU / GPU encoding
ffmpeg-render-pro detect-gpu --cpu
ffmpeg-render-pro detect-gpu --gpu

CLI

ffmpeg-render-pro info                # System snapshot
ffmpeg-render-pro detect-gpu          # Probe hardware encoders
ffmpeg-render-pro render <worker.js>  # Render with your worker script
ffmpeg-render-pro benchmark           # Quick 5s test render

API

const {
  renderParallel,    // Core: parallel rendering engine
  createEncoder,     // Pipe raw frames to ffmpeg
  detectGPU,         // Cross-platform GPU detection
  getConfig,         // Auto-tune workers, codec selection
  concatSegments,    // Stream-copy segment joining
  colorGrade,        // Apply color grades (presets or custom)
  mergeAudio,        // Combine video + audio
  startDashboard,    // Live progress dashboard
  saveCheckpoint,    // Checkpoint serialization
  loadCheckpoint,    // Checkpoint restoration
} = require('ffmpeg-render-pro');

renderParallel(options)

主要入口点。将渲染任务拆分到多个工作线程,显示实时仪表盘,并生成最终的 MP4 文件。

await renderParallel({
  workerScript: './my-worker.js',  // Your frame generator
  outputPath: './output.mp4',
  width: 1920,
  height: 1080,
  fps: 60,
  duration: 60,        // seconds
  title: 'My Render',
  autoOpen: true,      // auto-open dashboard in browser
});

编写工作线程 (Worker)

工作线程通过 workerData 接收帧范围,并将原始 BGRA 帧通过管道传输给 ffmpeg:

const { workerData, parentPort } = require('worker_threads');
const { spawn } = require('child_process');

const { width, height, fps, startFrame, endFrame, segmentPath, workerId } = workerData;

// Spawn ffmpeg encoder
const ffmpeg = spawn('ffmpeg', [
  '-y', '-f', 'rawvideo', '-pixel_format', 'bgra',
  '-video_size', `${width}x${height}`, '-framerate', String(fps),
  '-i', 'pipe:0',
  '-c:v', 'libx264', '-preset', 'fast', '-crf', '20',
  '-pix_fmt', 'yuv420p', '-movflags', '+faststart',
  segmentPath,
], { stdio: ['pipe', 'pipe', 'pipe'] });

const buffer = Buffer.alloc(width * height * 4);

for (let f = startFrame; f < endFrame; f++) {
  // Fill buffer with your frame data (BGRA format)
  renderMyFrame(f, buffer);

  // Write with backpressure
  const ok = ffmpeg.stdin.write(buffer);
  if (!ok) await new Promise(r => ffmpeg.stdin.once('drain', r));

  // Report progress
  parentPort.postMessage({ type: 'progress', workerId, pct: ..., fps: ..., frame: ..., eta: ... });
}

ffmpeg.stdin.end();
ffmpeg.on('close', () => parentPort.postMessage({ type: 'done', workerId }));

查看 examples/basic-worker.js 获取完整的运行示例。

模块

模块

用途

parallel-renderer

带有进度跟踪的 N 工作线程池

encoder

将原始帧通过管道传输给带有背压控制的 ffmpeg

gpu-detect

跨平台硬件编码器发现与验证

config

基于分辨率、内存、CPU 自动调整工作线程

concat

流拷贝分段拼接(即时完成)

color-grade

ffmpeg 视频滤镜预设 + 自定义链

audio-merge

支持响度标准化的视频与音频合并

dashboard-server

无依赖 HTTP 服务器,自动打开浏览器

progress

每个工作线程的终端 + JSON 进度跟踪

checkpoint

长时间渲染的状态序列化

基准测试

运行你自己的测试:

node examples/render-test.js --duration=5
node examples/render-test.js --duration=30
node examples/render-test.js --duration=60 --width=1080 --height=1920

测试

npm test

一套零依赖的冒烟测试套件,涵盖模块导出、输入验证、仪表盘路径安全(遍历 + 空字节 + 双重编码向量)、检查点往返以及 MCP 服务器 stdio 握手。

MCP 服务器

ffmpeg-render-pro 包含一个带有 6 个工具的 Model Context Protocol (MCP) 服务器。可与 Claude Code、Claude Desktop 及任何 MCP 客户端配合使用。

添加到 Claude Code

# After `npm install -g ffmpeg-render-pro` the MCP binary is on your PATH:
claude mcp add --transport stdio ffmpeg-render-pro -- ffmpeg-render-pro-mcp

# Or without global install (uses npx):
claude mcp add --transport stdio ffmpeg-render-pro -- npx --yes --package=ffmpeg-render-pro ffmpeg-render-pro-mcp

添加到 Claude Desktop

添加到你的 claude_desktop_config.json

{
  "mcpServers": {
    "ffmpeg-render-pro": {
      "command": "ffmpeg-render-pro-mcp"
    }
  }
}

或者,如果你不想全局安装:

{
  "mcpServers": {
    "ffmpeg-render-pro": {
      "command": "npx",
      "args": ["--yes", "--package=ffmpeg-render-pro", "ffmpeg-render-pro-mcp"]
    }
  }
}

MCP 工具

工具

描述

detect_gpu

探测硬件编码器 (NVENC, VideoToolbox, AMF, VA-API, QSV)

system_info

显示 CPU 核心数、内存、推荐工作线程数、ffmpeg 版本

render_video

使用实时仪表盘进行并行渲染

color_grade

应用预设(黑色电影、暖色、冷色、电影感、复古)或自定义滤镜

merge_audio

结合视频和音频并进行响度标准化

concat_videos

流拷贝拼接多个视频(即时完成,无需重新编码)

Claude Code 技能

此仓库包含一个即用型的 Claude Code 技能。要安装它,请将 skill 文件夹复制到你的 Claude 技能目录中:

# macOS / Linux
cp -r .claude/skills/ffmpeg-render-pipeline ~/.claude/skills/

# Windows
xcopy .claude\skills\ffmpeg-render-pipeline %USERPROFILE%\.claude\skills\ffmpeg-render-pipeline\ /E /I

安装后,当你要求 Claude Code 使用 ffmpeg 渲染视频或音频时,它会自动使用该技能。

安全说明

  • 仪表盘服务器仅绑定到 127.0.0.1 网络上的其他机器无法访问。

  • 无遥测、无回传、无 CDN 加载。 仪表盘完全使用系统字体从本地文件运行。

  • MCP 服务器是本地文件系统工具。 当连接到 AI 代理时,它将在当前用户有权访问的任何位置渲染、读取和写入文件。请像对待任何其他启用文件系统的工具一样对待它:仅在受信任的代理下运行,如果你在不受信任的提示词中使用它,请考虑限制进程的工作目录。

  • 流拷贝拼接使用 os.tmpdir() 下的临时文件。 你传递的输出路径将按原样写入——请确保你的输出路径是你想要的位置。

更新日志

查看 CHANGELOG.md 获取发布说明。最新版本:v1.2.0 — 加固更新(关键仪表盘修复、路径遍历防御、性能改进)。

许可证

MIT

作者

Beeswax Pat

Maintenance

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    A cinema-grade video production MCP server that enables automated website recording, editing, and AI-powered narration using ffmpeg and Playwright. It provides tools for color grading, captioning, and converting videos into social media formats through natural language commands.
    82
    5
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that provides 17 FFmpeg-based tools for video and audio processing, including conversion, compression, and editing. It enables AI assistants to perform complex media tasks like extracting audio, adding watermarks, and merging videos using natural language.
    168
    2

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/beeswaxpat/ffmpeg-render-pro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server