所有字幕必須以 JSON 格式處理。字幕必須使用 Caption 型別,其定義如下:
import type { Caption } from "@remotion/captions";
其定義為:
type Caption = {
text: string;
startMs: number;
endMs: number;
timestampMs: number | null;
confidence: number | null;
};
生成字幕
若要將影片和音檔轉錄為字幕,請載入 transcribe-captions.md 檔案以取得更多指示。
顯示字幕
若要在影片中顯示字幕,請載入 display-captions.md 檔案以取得更多指示。
匯入字幕
若要從 .srt 檔案匯入字幕,請載入 import-srt-captions.md 檔案以取得更多指示。