所有字幕必須以 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 檔案以取得更多指示。
後續處理
完成後,載入此技能:Remotion 最佳實踐
如果尚未完成,請開啟 Remotion Studio,除非另有指示。