Ffmpeg Render Pro

io.github.beeswaxpat由 GitHub 帳號 beeswaxpat 發布v1.5.2更新於 Oct 24, 2026

Parallel video rendering tools: detect GPU encoders, render, color grade, merge audio, concat.

發布方自己的服務:Brontide agent arena

已驗證STDIO僅桌面開發者工具媒體與設計

概覽

AI 產生的概覽

讓助理透過 worker 指令碼平行渲染影片,並偵測 GPU 編碼器、調色、合併音訊與串接片段。

可以做什麼
透過 stdio 提供七個工具:get_worker_template 回傳 worker 契約與起始原始碼,render_video 依 worker 指令碼平行渲染並支援進度通知與取消,detect_gpu 探測硬體編碼器,system_info 回報核心數與記憶體,color_grade、merge_audio 與 concat_videos 負責後製處理。渲染會把影格範圍拆分到多個工作執行緒,各自編碼一個 MP4 分段,再以串流複製合併。工具會回傳帶輸出結構描述的 structuredContent。
適用情境
適合助理需要在本地產生或後製影片檔案的情境:程式化或程式碼驅動的渲染、GPU 編碼器偵測、調色、加入配樂,或串接同編碼片段。也適用於無介面的代理流程,由助理撰寫或重複使用 worker 指令碼後再渲染。
執行需求
以 stdio 在本機執行,可透過 npx(套件名稱 ffmpeg-render-pro)或全域安裝啟動;需要 Node.js 18 或更新版本,以及位於 PATH 中的 ffmpeg。選用環境變數 FFMPEG_RENDER_PRO_FFMPEG、FFMPEG_RENDER_PRO_FFPROBE 與 FFMPEG_RENDER_PRO_CACHE_DIR 可指定非 PATH 的執行檔與 GPU 探測快取。未宣告帳號、金鑰或標頭。
安裝前請注意
render_video 與 renderParallel 會以目前使用者的權限執行指定的 worker 指令碼,因此只應執行自己撰寫或信任的 worker。此伺服器可讀寫目前使用者能存取的任何檔案,寫入類工具會覆寫 output_path。自訂 filter 字串等同於檔案存取,因為 movie=、subtitles= 等 ffmpeg 濾鏡會讀取本機檔案。儀表板僅綁定 127.0.0.1,且沒有遙測。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ffmpeg Render Pro,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[ffmpeg-render-pro]

ffmpeg-render-pro

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

Render video from code, in parallel. You write one function that paints a frame; ffmpeg-render-pro splits the frame range across worker threads, encodes one MP4 segment per worker, joins the segments with stream copy (no re-encode), and shows a live dashboard in your browser while it runs. It also detects GPU encoders, grades color, merges audio, and ships as a CLI, a Node library, an MCP server for AI agents, and a Claude Code skill.

Built by Beeswax Pat. Free and open source.

Start here

Three commands. You need Node.js 18 or newer and ffmpeg on your PATH.

bash
# 1. Prove the setup works: a 5 second test render. The dashboard opens in your browser.npx ffmpeg-render-pro benchmark
# 2. Write a starter worker script into the current folder.npx ffmpeg-render-pro init my-worker.js
# 3. Render it. Output lands in output.mp4.npx ffmpeg-render-pro render my-worker.js --duration=5

Open my-worker.js. The only function you need to change is renderFrame(frameNum, buffer): fill the buffer with your pixels (B, G, R, A, one row after another) and everything else is already done. Derive any randomness from the seed it receives and parallel output stays identical to a sequential render.

Install it globally if you would rather not type npx:

bash
npm install -g ffmpeg-render-pro

Using an ffmpeg that is not on PATH

bash
FFMPEG_RENDER_PRO_FFMPEG=/opt/ffmpeg/bin/ffmpeg     # ffmpeg binaryFFMPEG_RENDER_PRO_FFPROBE=/opt/ffmpeg/bin/ffprobe   # optional; the sibling ffprobe is found automaticallyFFMPEG_RENDER_PRO_CACHE_DIR=~/.ffmpeg-render-pro    # optional; where GPU probe results are cached

The variables are read at call time, so a long-running process such as the MCP server picks up changes without a restart.

CLI

bash
ffmpeg-render-pro init [my-worker.js]   # write the starter worker (--force overwrites)ffmpeg-render-pro benchmark             # 5 second test render with the bundled workerffmpeg-render-pro render <worker.js>    # render with your workerffmpeg-render-pro info                  # cores, RAM, recommended workers, ffmpeg version, GPUffmpeg-render-pro detect-gpu            # probe hardware encoders (--cpu / --gpu force a mode)ffmpeg-render-pro version

Render and benchmark flags: --width=1920 --height=1080 (must be even), --fps=60, --duration=60 (fractions allowed), --output=out.mp4, --workers=N, --max-workers=8, --seed=42, --title="...", --crf=20 (0-51, lower is higher quality), --encoder-preset=fast (any x264 preset). Dashboard flags: --no-dashboard, --no-open, --port=8080, --linger-ms=30000 (0 exits as soon as the render finishes). Run ffmpeg-render-pro with no arguments for the full list.

An unknown flag warns and continues. A value that does not parse, such as --fps=abc, exits 1 instead of rendering at the default.

Installed binaries: ffmpeg-render-pro (this CLI) and ffmpeg-render-pro-mcp (the MCP server). The older ffmpeg-render-mcp name still works so existing MCP configs never break.

How a render works

  1. renderParallel checks ffmpeg, validates the resolution, and picks a worker count from your CPU cores and RAM (never more workers than frames).
  2. It starts the dashboard server on 127.0.0.1 and opens your browser.
  3. Each worker thread runs your script with a frame range in workerData, pipes raw BGRA frames into its own ffmpeg process, and writes one MP4 segment.
  4. Segments are joined with the concat demuxer and -c copy, which takes seconds regardless of length.
  5. Temp files are removed. A failed worker's range is retried once before the render fails.

Your worker

A worker is a Node script that runs in a worker_threads thread. init gives you one where only renderFrame needs editing; examples/basic-worker.js in the installed package is a larger reference with a particle system and seeded RNG.

Fields the renderer injects through workerData:

FieldMeaning
width, height, fpsFrame size and rate
seedDerive every random value from this
startFrame, endFrameRender exactly [startFrame, endFrame)
segmentPathWrite this worker's MP4 here
workerIdInclude it in every message you post
totalFrames, durationWhole-video totals, for global effects such as a progress bar
anything in renderParallel({ workerData })Your own extra keys (the bundled workers honor codecArgs)

Messages the worker posts with parentPort.postMessage:

MessageWhenFields
{ type: 'progress' }periodicallyworkerId, pct, fps, frame, eta
{ type: 'fast-forward-start' }optional, before replaying state to reach startFrameworkerId, frames
{ type: 'done' }once, after the segment is fully writtenworkerId
{ type: 'error' }on failure, never followed by doneworkerId, error

Every worker must encode with the same codec, resolution, framerate, and pixel format, because the segments are stream-copied together.

Library

js
const {  renderParallel,       // the render engine  createEncoder,        // pipe raw frames into ffmpeg with backpressure  detectGPU,            // hardware encoder discovery, cached 7 days  getConfig,            // worker count and codec choice for a resolution  computeTotalFrames,   // float-safe fps x duration  concatSegments,       // stream-copy join (validates inputs by default)  colorGrade,           // presets or a custom -vf chain  mergeAudio,           // add a soundtrack without re-encoding video  startDashboard,       // the local progress server  ProgressTracker,      // per-worker progress plus dashboard JSON  saveCheckpoint, loadCheckpoint, restoreCheckpoint, generateCheckpoints,  getEncoderIO,         // encoder recipe as { inputArgs, filter, outputArgs }  getCodecArgs,         // the same recipe as one flat array  ffmpegBin, ffprobeBin // resolved binaries, env-var aware} = require('ffmpeg-render-pro');

renderParallel(options)

js
const controller = new AbortController();
const result = await renderParallel({  workerScript: './my-worker.js',   // required  outputPath: './output.mp4',       // required  width: 1920, height: 1080,        // even numbers, up to 7680x4320  fps: 60, duration: 60,  seed: 42,  title: 'My Render',               // shown in the dashboard  workerCount: undefined,           // exact count; omit to auto-detect  maxWorkers: 8,                    // cap for auto-detect  dashboard: true, autoOpen: true, dashboardPort: 8080,  dashboardLingerMs: 0,             // 0 resolves as soon as the render ends (the CLI keeps it up 30s)  quiet: false,                     // true keeps stdout byte-clean; status goes to stderr  signal: controller.signal,        // abort() stops workers and removes temp files  workerData: {},                   // extra keys for your worker});// result: { outputPath, elapsed, totalFrames, avgFps }

Abort rejects with an error whose name is 'AbortError'. In library use set dashboardLingerMs: 0 so the call returns without holding the process open. Set FFMPEG_RENDER_PRO_DEBUG=1 for full stack traces from the CLI.

Post-processing

js
// Color grade with a preset (noir, warm, cool, cinematic, vintage) or a custom -vf chainawait colorGrade({ inputPath: 'raw.mp4', outputPath: 'graded.mp4', preset: 'cinematic' });await colorGrade({ inputPath: 'raw.mp4', outputPath: 'graded.mp4', filter: 'eq=contrast=1.08:saturation=0.9', crf: 18 });await colorGrade({ inputPath: 'final.mp4', outputPath: 'graded.mp4', preset: 'noir', keepAudio: true }); // default strips audio
// Merge audio: video is stream-copied, audio becomes AAC. loop and normalize (loudnorm) are optional.await mergeAudio({ videoPath: 'graded.mp4', audioPath: 'track.mp3', outputPath: 'final.mp4', bitrate: 320, loop: true, normalize: true });
// Join same-codec, same-size videos with stream copy. Inputs are probed with ffprobe first; pass { validate: false } to skip.await concatSegments(['part-000.mp4', 'part-001.mp4'], 'joined.mp4');

colorGrade accepts any encoder name in codec; encoders that need their own filter (VA-API) get it merged into the grade chain automatically.

Checkpoints for long renders

For multi-hour renders, snapshot your simulation state every N frames once, so each worker replays only the frames since the nearest snapshot instead of starting from frame 0.

js
generateCheckpoints({ systems, totalFrames: 432000, fps: 60, checkpointDir: './.checkpoints', interval: 60000 });
// inside a workerconst cp = loadCheckpoint('./.checkpoints', startFrame);if (cp) {  const resumeFrame = restoreCheckpoint(cp, systems);  // fast-forward from resumeFrame to startFrame, then render}

systems is an object of named modules with getState(), setState(), and update(dt). A checkpoint labeled frame F holds exactly F updates. _frame and _timestamp are reserved keys.

MCP server (for AI agents)

Seven tools over stdio, usable from Claude Code, Claude Desktop, or any MCP client.

bash
# Claude Code, no install neededclaude mcp add --transport stdio ffmpeg-render-pro -- npx --yes --package=ffmpeg-render-pro ffmpeg-render-pro-mcp
# Claude Code, after npm install -g ffmpeg-render-proclaude mcp add --transport stdio ffmpeg-render-pro -- ffmpeg-render-pro-mcp

Claude Desktop (claude_desktop_config.json):

json
{  "mcpServers": {    "ffmpeg-render-pro": {      "command": "npx",      "args": ["--yes", "--package=ffmpeg-render-pro", "ffmpeg-render-pro-mcp"]    }  }}
ToolWhat it does
get_worker_templateReturns the worker contract, the starter worker source, and paths to both bundled workers. Start here.
render_videoParallel render from a worker script, with progress notifications and cancellation
detect_gpuProbe hardware encoders (NVENC, VideoToolbox, AMF, VA-API, QSV)
system_infoCores, RAM, recommended worker count, ffmpeg version
color_gradePresets or a custom filter
merge_audioAdd a soundtrack, video stream-copied
concat_videosStream-copy join, inputs validated by default

The agent recipe: call get_worker_template, copy starterSource to a file and replace renderFrame, then call render_video with that file as worker_script (dashboard: false, auto_open: false for headless runs). To render without writing code, pass the returned starterPath or templatePath straight to render_video. Post-process with color_grade, merge_audio, and concat_videos.

Every tool declares an outputSchema and returns structuredContent, so parse JSON instead of text. Writers overwrite output_path. render_video defaults to 30 fps (the CLI defaults to 60), emits notifications/progress every 2 seconds when the client sends a progressToken (turn on resetTimeoutOnProgress for long renders), and stops all workers on client cancellation. stdout carries only JSON-RPC frames. Missing ffmpeg returns an error that names the install page and the env var.

The tarball also ships llms.txt at the package root and a Claude Code skill:

bash
# from a global install (macOS / Linux)cp -r "$(npm root -g)/ffmpeg-render-pro/.claude/skills/ffmpeg-render-pipeline" ~/.claude/skills/# from a repo clone (Windows)xcopy .claude\skills\ffmpeg-render-pipeline %USERPROFILE%\.claude\skills\ffmpeg-render-pipeline\ /E /I

NVENC quick reference

The renderer detects NVENC by itself. For one-off encodes outside it:

bash
# confirm the encoder exists before relying on itffmpeg -y -f lavfi -i testsrc=size=256x256:rate=30:d=1 -c:v h264_nvenc -cq 23 probe.mp4
# encode: presets p1 (fastest) to p7 (best); -cq works like CRF, lower is betterffmpeg -i in.mp4 -c:v h264_nvenc -preset p5 -cq 21 -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart out.mp4

h264_nvenc rejects very narrow frames (145px minimum on a Turing card) by writing a zero-byte file and exiting, so keep probes at 256x256. Both commands come from the ffmpeg Render Cookbook ($12): 29 recipes, each run on ffmpeg 8.0.1 before publication.

Security notes

  • Releases are published to npm by GitHub Actions through npm trusted publishing (OIDC). There is no publish token, and every version from 1.5.2 on carries a provenance attestation that ties the tarball on npm to the exact commit and workflow run that built it (see the Provenance panel on the npm page).
  • The dashboard binds to 127.0.0.1 only and loads nothing from the network. No telemetry.
  • render_video and renderParallel execute the worker script you name with the privileges of the current user. Only run workers you wrote or trust.
  • The MCP server reads and writes files anywhere the current user can. Run it with a trusted agent, and consider restricting its working directory when prompts are untrusted.
  • A custom filter string is file access: ffmpeg filters such as movie= and subtitles= read local files. Treat filter input the way you treat a file path.
  • Concat list files are written under os.tmpdir(); output paths are written exactly where you point them.

Tests

npm test runs 12 zero-dependency suites (255 checks): unit, smoke, a real MCP session over stdio with a byte audit of stdout, and end-to-end renders verified with ffprobe and framemd5. It skips the render suites cleanly on machines without ffmpeg. CI runs the same on Ubuntu, Windows, and macOS against Node 18, 20, 22, and 24.

Changelog and license

See CHANGELOG.md. MIT.

來源:README.md,提交 6f75cff

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.5.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Brontide 整合