feat(subtitle_rendering): WIP: 添加视频字幕样式和导出功能

This commit is contained in:
2025-01-06 02:18:06 +08:00
parent be1d072b13
commit e4917d0053
2 changed files with 83 additions and 45 deletions

View File

@@ -23,8 +23,8 @@ export interface SubtitleEmbeddingOptions {
blur: number;
color: string;
};
videoWidth: number;
videoHeight: number;
videoWidth?: number;
videoHeight?: number;
}
export const useVideoSubtitleEmbedding = async (
@@ -50,12 +50,14 @@ export const useVideoSubtitleEmbedding = async (
videoHeight: 1080,
fontSize: 36,
fontFamily: "Noto Sans SC",
strokeStyle: "none",
textShadow: {
offsetX: 2,
offsetY: 2,
blur: 4,
color: "rgba(0, 0, 0, 0.25)",
},
...options,
})
);
srtSprite.time = { duration: 10e6, offset: 0 };