所有字幕必须以JSON格式处理。字幕必须使用Caption类型,定义如下:
import type { Caption } from "@remotion/captions";
具体类型定义:
type Caption = {
text: string;
startMs: number;
endMs: number;
timestampMs: number | null;
confidence: number | null;
pageBreakAfter?: boolean;
};
生成字幕
要转录音视频文件并生成字幕,请加载transcribe-captions.md文件获取更多说明。
显示字幕
要在视频中显示字幕,请加载display-captions.md文件获取更多说明。
导入字幕
要从.srt文件导入字幕,请加载import-srt-captions.md文件获取更多说明。