Skills2026年3月29日·1 分钟阅读

Remotion AI Voiceover Skill — ElevenLabs TTS

AI skill for adding ElevenLabs text-to-speech voiceover to Remotion videos. Auto-sizes composition duration to match generated audio.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

npx skills add remotion-dev/skills
# Set your ElevenLabs API key
export ELEVENLABS_API_KEY=your_key

介绍

A Remotion skill for AI-generated voiceover using ElevenLabs TTS. Generate speech audio per scene, then use calculateMetadata to dynamically size the video composition to match. Perfect for automated video pipelines where narration needs to be generated programmatically. Part of the Remotion AI Skills collection.

Best for: Automated video narration, explainer videos, podcast visualizations Works with: Claude Code, OpenAI Codex, Cursor


How It Works

  1. Define your script — Text for each scene in a config file
  2. Generate audio — Script calls ElevenLabs API, writes MP3s to public/
  3. Dynamic durationcalculateMetadata reads audio duration, sizes composition accordingly
  4. Render — Remotion renders video with synced voiceover

Generating Audio with ElevenLabs

// generate-voiceover.ts
const response = await fetch("https://api.elevenlabs.io/v1/text-to-speech/{voice_id}", {
  method: "POST",
  headers: {
    "xi-api-key": process.env.ELEVENLABS_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: sceneText,
    model_id: "eleven_multilingual_v2",
  }),
});
// Write audio to public/voiceover-scene-1.mp3

Run: node --strip-types generate-voiceover.ts

Dynamic Composition Duration

export const calculateMetadata = async () => {
  const duration = await getAudioDurationInSeconds(staticFile("voiceover.mp3"));
  return { durationInFrames: Math.ceil(duration * 30) };
};

FAQ

Q: What TTS service does the Remotion voiceover skill use? A: ElevenLabs by default, but any TTS service that produces audio files can be substituted.

Q: Does the video duration auto-adjust to the voiceover? A: Yes. The skill uses Remotion's calculateMetadata to dynamically set composition duration based on the generated audio length.


🙏

来源与感谢

Created by Remotion. Licensed under MIT. remotion-dev/skills — Voiceover rule

相关资产