packages/docs/docs/captions/caption.mdx
This is a simple data structure for a caption.
import type {Caption} from '@remotion/captions';
// ^?
By establishing a standard data structure, we allow many operations that involve captions to be interoperable:
@remotion/install-whisper-cpp, @remotion/openai-whisper, or @remotion/elevenlabs packagescreateTikTokStyleCaptions()parseSrt() function.srt file using serializeSrt()textThe text of the caption.
startMsThe start time of the caption in milliseconds.
endMsThe end time of the caption in milliseconds.
timestampMsThe timestamp of the caption as a singular timestamp in milliseconds.
When using @remotion/install-whisper-cpp, this the t_dtw value.
Otherwise, it is not defined, but may be the average of the start and end timestamps.
confidenceA number between 0 and 1 that indicates how confident the transcription is.
The text field is whitespace sensitive. You should include spaces in it, ideally before each word.
While rendering, apply the white-space: pre CSS property to the container of the caption to ensure that the spaces are preserved.