Communitygithub.com

CleanExpo/Pi-Dev-Ops - Remotion 渲染流水线

最终步骤。合成 ElevenLabs 语音旁白、运行 `npx tsx render/render.ts` 生成 MP4、验证时长/编码/分辨率/大小、上传至 Supabase 存储、通过 Telegram 发送结果并创建 Linear 工单。在 remotion-composition-builder 报告就绪后触发。失败模式(超时、卡死、类型错误)升级至 Linear。

Pi-Dev-Ops - Remotion 渲染流水线 是什么?

这是一个 AI 智能体技能,专注于将 Remotion 合成项目自动化地转换为可交付的 MP4 文件。它在 `remotion-composition-builder` 报告完成时被触发,适用于所有调用项目(如 Synthex、Pi-SEO、RestoreAssist)。该技能包含一个完整的流水线:首先进行 TypeScript 类型检查(`tsc --noEmit`),失败时退回给构建器;然后合成 ElevenLabs 语音旁白至每场景 MP3 文件(支持缓存),若无 API 密钥则静默降级为纯文本渲染;接着执行 Remotion 渲染(含 600 秒超时和一次重试);之后验证文件存在、时长(误差 ±0.5 秒)、编码(h264)、分辨率及大小(<100MB);最后执行分发:上传至 Supabase 存储(90天保留)、通过 Telegram 发送(>45MB 发送链接后缀)、并创建 Linear 工单(含渲染 URL、品牌 GIT SHA 等关键信息)。每个项目通过自身 `.env` 文件提供所需的 API 密钥(ElevenLabs、Telegram、Supabase、Linear、Remotion 许可证),技能从不读取 Pi-Dev-Ops 自身的密钥。输出文件默认写入调用项目的 `.remotion-renders/` 目录(已 gitignore),保持各项目资产独立。失败时按优先级创建 Linear 工单(超时/卡死为优先级2,验证失败为优先级3),并记录完整摘要至 `.research/renders/{jobId}.json`。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/CleanExpo/Pi-Dev-Ops/tree/HEAD/skills/remotion-render-pipeline

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

remotion-render-pipeline

将合成项目转换为可交付的 MP4。

触发器

  • remotion-composition-builder 报告 ready: true。
  • 用户说“渲染”/“交付”并附带已知的作业 ID。

输入参数

  • jobId
  • composition — 与 src/Root.tsx 匹配的 ID(例如 Explainer)
  • outputPath — 相对于 remotion-studio/output/ 的路径
  • props — 完整的输入属性(品牌 + 故事板 + ...)以 JSON 形式提供
  • linear — {teamId, projectId} 用于工单路由

方法

  1. 前置类型检查 — cd remotion-studio && npx tsc --noEmit。失败时,将错误返回给 remotion-composition-builder。
  2. 语音旁白合成 — render/voiceover.ts 将每场景的 MP3 写入 public/audio/{jobId}/scene-N.mp3(位于 public/ 下以便 staticFile() 解析)。使用缓存键 sha1(voiceId|style|text)。如果缺少 ELEVENLABS_API_KEY,则跳过——合成项目仍可仅以屏幕文本运行。
  3. 渲染 — npx tsx render/render.ts --comp={composition} --out={outputPath} --props='{...}' --jobId={jobId}。包装为 600 秒超时;卡死/崩溃时重试一次。
  4. 验证 — 文件存在,时长与预期相差 ±0.5 秒,编码为 h264,分辨率与合成项目匹配,大小小于 100MB。
  5. 交付:
    • 上传至 Supabase 存储桶 remotion-renders — 签名 URL,保留 90 天。
    • 通过 app.server.telegram_video.send_telegram_video()(共享工具)发送 Telegram。若文件大于 45MB,则发送签名 URL 链接而非内联上传(Telegram 上限为 50MB)。
    • 在 {teamId}/{projectId} 中创建 Linear 工单,包含:渲染 URL、源摘要、BrandConfig 版本(src/brands/{slug}.ts 的 Git SHA)、合成文件路径。
  6. 状态 — 将摘要写入 .research/renders/{jobId}.json。

输出

{
  "jobId": "ra-nir-explainer-2026-04-28T15-30-00",
  "mp4Path": "remotion-studio/output/ra-nir-explainer-2026-04-28T15-30-00.mp4",
  "supabaseUrl": "https://<project>.supabase.co/storage/v1/object/sign/remotion-renders/...",
  "telegramSent": true,
  "linearIssue": "RA-2049",
  "validation": { "durationSec": 60.0, "codec": "h264", "resolution": "1920x1080", "sizeMB": 12.4 }
}

边界约束

  • 绝不要在 tsc --noEmit 失败时运行渲染——这会浪费 2-5 分钟保证产生坏输出。
  • 在渲染验证通过前,绝不要自动合并源 PR(合成 + 品牌变更)。
  • 绝不要将带有 [DRAFT] 标记的渲染上传到正式品牌存储桶——草稿应上传至 remotion-drafts。

失败升级

  • 超时/卡死 → 终止进程,重试一次 → 若再次失败,创建 Linear 工单,优先级为 2,并附加标准错误输出。
  • 验证失败(时长/编码错误)→ 创建 Linear 工单,优先级为 3,并附上差异与预期对比。
  • Telegram 失败 → 降级为 send_telegram_document(),以 .mp4 作为附件发送。

复用组件

每项目 API 密钥

此技能从调用项目内部(Synthex、Pi-SEO、RestoreAssist 等)被调用。每个项目通过其自身的 .env / .env.local 提供密钥。技能从不读取 Pi-Dev-Ops 的密钥。

渲染时必需或可选的 env 变量:

  • ELEVENLABS_API_KEY — 语音旁白合成。缺失 = 静默渲染,仅显示屏幕文本(记录警告,渲染继续)。
  • TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID — Telegram 交付。缺失 = 跳过 Telegram 步骤(MP4 仍写入磁盘,若配置了 Supabase 则也上传)。
  • SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY — 签名 URL 上传。缺失 = 跳过 Supabase 步骤。
  • LINEAR_API_KEY — 工单创建。缺失 = 跳过 Linear 步骤。
  • REMOTION_LICENSE_KEY — 在 Remotion 公平源码许可下任何商业渲染所必需。

从项目 shell 调用的示例:

cd ~/Pi-CEO/Synthex
source .env.local                     # 项目自身的密钥
cd ~/Pi-Dev-Ops/remotion-studio
npx tsx render/render.ts \
  --comp=Explainer \
  --out=$OLDPWD/.remotion-renders/synthex-launch.mp4 \
  --jobId=synthex-launch-$(date +%s) \
  --props='{"brand":"synthex","hookSec":8,"ctaSec":8,"storyboard":[...]}'

或者通过 Pi-Dev-Ops 编排器 API 调用,该 API 在会话生成时会继承调用项目的环境变量。

输出约定:默认将 MP4 写入 <调用项目>/.remotion-renders/ 目录(已 gitignore)——使每个项目的产物保留在其自身目录树中。可通过 --out=... 覆盖。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

CleanExpo/Pi-Dev-Ops

Produce one or many consistent, on-brand faceless marketing videos from a topic: script, ElevenLabs voiceover with timestamps, one styled illustration per beat, ffmpeg stitch to 1080p, optional Unlisted YouTube upload. The look is a named style from styles.md (flat-line, hand-doodle, bold-kinetic, cinematic-photoreal, minimal-corporate, retro-print), so one command yields repeatable output per brand. The automated pipeline; distinct from faceless-video and video-director.

CleanExpo/Pi-Dev-Ops

Produce a faceless YouTube-style video (hand-drawn doodle / simple-illustration channels like Zen, Nick Invest) end-to-end from a single topic. ASKS FACT-vs-STORY mode first (non-fiction educational vs fiction storytelling) and branches the whole run — built to serve multiple clients/channels, not one fixed format. Reverse-engineers a proven reference video's script format, writes a new script in that format, generates an ElevenLabs voiceover with timestamps, creates one styled Artlist (AI Toolkit) image per timestamp, and stitches everything with FFmpeg — fully automated, no human recording. Use when the user says "faceless video", "/faceless-video", "doodle video", "make a YouTube short/long-form in the Zen style", or wants an organic faceless-channel content piece. Composes with video-distribution-strategist (channel/launch) and video-director (when motion/edit polish is wanted instead of stills).

CleanExpo/Pi-Dev-Ops

The 15+ year brand director extension of `brand-guardian` specifically for video — frame-by-frame audit of brand-mark integrity, Gun Metal `#1a1a1a` + Candy Red `#dc143c` consistency, NO AI slop, NO Lucide icons, custom geometric marks ONLY, real logos correctly placed. PASS / FAIL gate before any client-facing video ships. Use after `video-colorist` completes the grade pass.

CleanExpo/Pi-Dev-Ops

The 15+ year Director-of-Photography persona (Roger Deakins / Emmanuel Lubezki / Hoyte van Hoytema-tier) that owns shot composition, lens psychology, motion language, and the decision of which source (Remotion / Hyperframes / stock cinematic) each scene uses. Extends the existing `remotion-designer` + `remotion-motion-language` skills with a frame-by-frame shot-language framework. Use when the user says "cinematography", "shot list", "framing", "DoP", "lens choice", or invoked by `video-director` Phase 2.

CleanExpo/Pi-Dev-Ops

The 15+ year colorist persona (Light Iron / Company 3 / The Mill-tier) that applies per-brand LUT + grade pass to every Unite-Group video. Closes the "raw Remotion render colours" gap — today Remotion outputs whatever colours BrandConfig declares with zero cinematic grade. Use when the user says "colour", "grade", "LUT", "look", "cinematic finish", or invoked by `video-director` Phase 3 (post-production) after `video-sound-designer` mixes audio.

CleanExpo/Pi-Dev-Ops

The Creative Director persona that owns brief intake, composition selection and narrative POV for every Unite-Group video. ENTRY POINT for the Video Agency: use for any video creation brief (explainer, promo, social cut, demo reel, case study, testimonial, client video). Dispatches the full production team: script-writer, cinematographer, editor, sound designer, colorist, brand-guardian.

CleanExpo/Pi-Dev-Ops

The 15+ year platform-native distribution expert (early TikTok creator economy + YouTube algorithm + LinkedIn organic reach + IG Reels native specialist) that owns per-platform aspect ratio + duration cap + caption format + hook density + thumbnail composition. Extends `remotion-marketing-strategist` with platform-native specs locked per BrandConfig. Use when the user says "which platform", "distribution", "channel-fit", "thumbnail", "captions", or invoked by `video-director` Phase 4 (QA + Delivery) for per-platform cuts.

CleanExpo/Pi-Dev-Ops

The 15+ year screenwriter persona (Pixar / Apple keynote / Nike spot tier) that engineers hooks (0-3s), retention beats (7-15s), narrative tension curves, and CTA placement. Extends the existing `remotion-screen-storyteller` skill with a structural framework lifted from Pixar's 22 Rules + Apple keynote architecture. Use when the user says "script", "voiceover", "narration", "hook", "story arc", or invoked by `video-director` Phase 2.

CleanExpo/Pi-Dev-Ops

The 15+ year sound designer persona (Skywalker Sound / Sound Lounge / Audio Network-tier) that mixes ElevenLabs voiceover with music bed, sound effects, ambient texture, and audio polish. Closes the single biggest gap in the existing Remotion pipeline — today voiceover is the ONLY audio; this skill adds music + SFX + mix. Use when the user says "sound design", "audio mix", "music bed", "SFX", "score this", or invoked by `video-director` Phase 3 (post-production).

CleanExpo/Pi-Dev-Ops

Converts a BrandResearch dossier into THREE artifacts — (1) typed BrandConfig TypeScript at Synthex/packages/brand-config/src/brands/{slug}.ts (runtime/behaviour — voice, voiceover, motion, audience, channel, forbiddenWords); (2) spec-conformant {slug}.design.md at Synthex/packages/brand-config/src/brands/{slug}.design.md (visual tokens — colour, typography, spacing, components, layout, elevation); (3) human-readable 9-section .md projection at Pi-Dev-Ops/remotion-studio/src/brands/{slug}.md derived from BOTH. Boundary contract at Pi-Dev-Ops/remotion-studio/src/brands/CONTRACT.md. Triggered after remotion-brand-research, or when the user pastes brand assets and says "codify". PRs are auto-merge:false — a human reviews before merge.

CleanExpo/Pi-Dev-Ops

Researches a portfolio company's visual identity from public sources (homepage, about page, marketing copy, GitHub README) and produces a structured BrandResearch dossier. Triggered when `Synthex/packages/brand-config/src/brands/{slug}.ts` (canonical home per RA-1985 / Synthex SYN-897) is missing, older than 90 days, or the user explicitly says "refresh brand for {brand}". Output feeds remotion-brand-codify.

CleanExpo/Pi-Dev-Ops

Generates a complete, accessible palette (primary, secondary, accent, 4-step neutral, semantic, and dark variant) from one to three hex anchors plus a colour-family classification. Validates WCAG-AA contrast for all text-on-background pairs. Triggered when a BrandConfig has fewer than 5 defined colours or contrast fails.

CleanExpo/Pi-Dev-Ops

Authors or extends a Remotion composition (.tsx) wired to BrandConfig + Storyboard + layout spec + motion. The actual builder skill — runs as a Sonnet-tier worker. Triggered after brand, storyboard, designer, and motion-language outputs are ready. Produces the file under remotion-studio/src/compositions/ and registers it in src/Root.tsx.

CleanExpo/Pi-Dev-Ops

Visual-design specialist for Remotion compositions. Sets layout grid, typography hierarchy, white-space, scene framing, and visual rhythm for a given composition + brand. Triggered after remotion-composition-builder for QA, or upfront when authoring a new composition type. Produces a layout spec consumed by remotion-composition-builder.

CleanExpo/Pi-Dev-Ops

Use when a Remotion video needs creative direction — hook, visual sequence, scene purpose, motion restraint, and CTA direction before render.

CleanExpo/Pi-Dev-Ops

Use when a Remotion video has timing, sync, transition, caption, pacing, or audio-fit risk and needs editing discipline before render.

CleanExpo/Pi-Dev-Ops

Use when /remotion-video needs existing Synthex ElevenLabs, brand-config, Remotion, output storage, Claude, or Hermes integration without adding vendors.

CleanExpo/Pi-Dev-Ops

Tunes a video's format and message for the target channel — LinkedIn, YouTube, Instagram Reel, internal training. Sets aspect ratio, total duration, hook timing, CTA timing, and pacing. Triggered when the brief mentions a specific channel or campaign goal. Output feeds remotion-screen-storyteller and remotion-composition-builder.

CleanExpo/Pi-Dev-Ops

Designs a brand-specific motion vocabulary — easing curves, default scene durations, signature entry/exit, transition frames. Each brand gets one signature move (rise / sweep / pulse / iris / whip) that recurs across compositions to build motion-recognition. Triggered when BrandConfig.motion is empty.

CleanExpo/Pi-Dev-Ops

/remotion-video one-shot Remotion command skill and ENTRY POINT for the Remotion Skills Package. Use for video, explainer, ad, promo, reel, intro, social cut, marketing, training, or launch videos. Reads the brief, classifies intent, enforces one single Synthex ElevenLabs voice, emits a production/wave plan, and dispatches the right sub-skills in topological order. Always invoked first.

相关技能