转录音频
🌐 Transcribing audio
Remotion 提供了几种内置选项用于将音频转录成字幕:
🌐 Remotion provides several built-in options for transcribing audio to generate captions:
@remotion/install-whisper-cpp- 使用 Whisper.cpp 在服务器上本地转录音频@remotion/whisper-web- 使用 WebAssembly 在浏览器中转录音频@remotion/openai-whisper- 使用 OpenAI Whisper API 进行基于云的转录
比较
🌐 Comparison
@remotion/install-whisper-cpp | @remotion/whisper-web | @remotion/openai-whisper | |
|---|---|---|---|
| Environment | Server (Node.js) | Client (Browser) | Cloud (API) |
| Speed | Fast (depends on hardware) | Slow (WASM overhead) | Fast |
| Cost | Free | Free | Paid (OpenAI API pricing) |
| Offline support | ✅ | ✅ | ❌ |
| No server needed | ❌ | ✅ | ✅ |
| Convert function | toCaptions() | toCaptions() | openaiWhisperApiToCaptions() |
Caption 类型
🌐 The Caption type
所有这些选项都可以以Caption类型格式输出字幕,推荐与Remotion一起使用。此格式:
🌐 All of these options can output captions in the Caption type format, which is recommended for use with Remotion. This format:
- 启用在
@remotion/captions中使用 API,例如createTikTokStyleCaptions() - 与 Remotion 编辑器入门 使用的格式匹配
- 与 Animated Captions 包兼容
替代方案
🌐 Alternatives
你可以使用其他音频转录方法,例如 ElevenLabs。
你也可以定义自己的字幕格式,而不依赖 Caption 类型——本页仅关于内置选项。
🌐 You can use other ways of transcribing audio, such as ElevenLabs.
You can also define your own caption format and not rely on the Caption type - this page is solely about the built-in options.
另请参阅
🌐 See also
Caption- 字幕数据结构@remotion/captions- 字幕操作工具