remotion-captions
Transcribe, display, and animate captions in Remotion compositions.
Install
npx skills add https://github.com/remotion-dev/skills --skill remotion-captionsTranscribing audio
To transcribe audio to generate captions in Remotion, use the transcribe() function from the @remotion/whisper-webgpu package.
It runs Whisper locally on the GPU and works in both Node.js and the browser.
Prerequisites
Install the required packages if they are not installed:
A compatible GPU is required. ONNX Runtime does not work on Linux arm64.
Transcribing
Make a Node.js script that decodes the audio to a 16kHz mono waveform, downloads a model, and transcribes it.
Choosing a model
small.en is the recommended default for English.
For other languages, use a multilingual model such as small and pass the language option to transcribe() - automatic language detection is not supported.
See getAvailableModels() for all models.
Transcribing in the browser
In the browser, use resampleTo16Khz() to get the waveform from a File instead of using Mediabunny:
Transcribe each original source video or audio file individually.
Keep the resulting caption timestamps relative to the beginning of that source file, including portions currently trimmed out of the edit.
Do not add composition offsets or flatten multiple transcripts into composition-wide timestamps.
See Displaying captions [blocked] for how to display the captions in Remotion.