Agent-driven Remotion video generation service — MCP Server + SQLite + Provider system + TTS + Web Console

Remotion Video — Agent 驱动的视频生成项目服务

English

Remotion Video 项目配图

把带时间码的 SRT 字幕拆成分镜,生成 React 动画场景并渲染为 MP4。Agent 可以通过模型上下文协议(MCP)提交任务,用户可以在本机控制台查看进度和产物。

改编自 B 站 YangAgent 分享的 Remotion 视频生成方案,扩展了 MCP 和异步任务队列。

快速开始

需要 Node.js 18 或更新版本。可选配音依赖 Python 3.9 或更新版本,合并语音需要 ffmpeg。服务端使用 SQLite(better-sqlite3)、Express 和 @modelcontextprotocol/sdk。

安装

git clone https://github.com/techdou/remotion-video.git
cd remotion-video
npm install
cd web-ui && npm install && cd ..
cd template && npm install && cd ..

构建

npm run build
npx esbuild web-ui/public/app.jsx --bundle --format=iife --jsx=transform \
  --outfile=web-ui/public/app.js

启动

在一个终端运行 node dist/index.js,启动 API、Worker 和 Web 控制台,打开 http://127.0.0.1:3210。Agent 从另一进程运行 node dist/mcp.js,通过标准输入输出连接 MCP 服务。

从字幕到视频

将 SRT 文件的绝对路径交给 Agent。Agent 按 SKILL.md 初始化项目,生成 storyboard.json 和各分镜的 SceneXXX.tsx,生成场景注册表并校验。默认模板为 1920 × 1080、30 fps。校验通过后,在生成的项目目录中渲染。

npx remotion render Main out/output.mp4

Main.tsx 和 Root.tsx 属于宿主层,常规流程应保留。generated-scenes.ts 由脚本生成。改模板或重渲染时,参见模板切换和调试与重渲染。

可选配音

复制 .env.example 为本机 .env,按服务设置 TTS_PROVIDER。启用配音时,字幕文本会交给所选服务。

Provider 配置
openai(默认) OpenAI 语音接口或兼容平台,设置 TTS_API_KEY、TTS_BASE_URL,按需设置 TTS_MODEL 和 TTS_VOICE
mimo 小米 MiMo Chat Completions 接口,设置 MIMO_API_KEY,其余选项见配置模板
edge 本机安装 edge-tts 客户端,无需 API Key,输出 MP3

语音合成和合并脚本按 SRT 的起始时间放置各段配音。配音超出该段时长会提示,音频保留原长。

服务与产物

  • MCP 服务提供 17 个工具,包括 get_project_context、get_capabilities、start_run、get_run_status、cancel_run、list_artifacts、set_artifact_status 和 test_provider。长任务提交后返回 runId,可查状态或取消。
  • 核心服务把任务保存在 SQLite,记录 Worker 租约和心跳,并在重启时恢复或标记超时任务。脚本、配音和渲染由各自的 Provider 封装。
  • Web 控制台显示项目、流程、任务和产物版本,也能查看服务能力并配置配音。产物记录其来源任务、父版本和当前状态。
  • 项目模板、工作流脚本和 Remotion 编写规则用于创建和校验项目。

Domain Service 仅绑定 127.0.0.1,跨源请求仅允许本机来源。服务校验项目路径,读取配置时对密钥脱敏。

测试

npx tsx --test server/core/tests/storage.test.ts server/core/tests/advanced.test.ts

覆盖项目存储、任务生命周期、并发版本校验、Worker 租约、崩溃恢复及 Provider 错误处理。

许可

MIT © 2026 techdou

MCP Server · Populars

    REA: Reverse Engineer Anything

    Reverse engineer anything, Reimagine everything. RE anything from app behavior down to native binaries. Discord: https://discord.gg/GkcryMnJDM

    Community morluto

    🦞 OpenClaw — Personal AI Assistant

    Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

    Community openclaw

    MarkItDown-MCP

    An MCP server for the "markitdown" library.

    Community microsoft

    MarkItDown

    Python tool for converting files and office documents to Markdown.

    Community microsoft

    graphify

    Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

    Community Graphify-Labs

MCP Server · New

    tokensave-dev

    tokensave-cli

    Local code intelligence MCP server and CLI for AI coding agents. Indexes your repository into a knowledge graph of symbols, calls and types, so agents explore code with fewer tokens and tool calls. 80+ tools, 50+ languages, 12+ agent integrations. Your code never leaves your machine.

    Community tokensave-dev
    ordewell

    ordewell

    Open source agent orchestrator. One goal becomes an editable plan of tasks that run in parallel on Claude Code, Codex, OpenCode and more, each on its own git branch.

    Community ordewell
    goodnight000

    api-anything

    Turn any website into an API your agent can call. Learns from the site's own frontend, heals itself when the site changes.

    Community goodnight000
    shuttle-browser

    Shuttle

    A Chromium fork built for AI agents: built-in MCP server, per-agent logged-in identities, sessions as tab groups

    Community shuttle-browser
    synectus

    OpenGMB

    Open-source Google Business Profile manager: reviews, posts, profile edits, rank tracking and keyword research for every location, with approval rules before anything goes live and an MCP server for AI agents. Self-host with Docker.

    Community synectus