video / by UGK Official

Video Zh Composer

给定视频、中文配音音频和中文字幕,产出中文配音软字幕版 MP4 与硬字幕版 MP4。

Install

ugk task install video-zh-composer

This task installs 7 files from the official manifest, including 2 script files.

Runtime input

videoPath必填,本地视频文件路径。必须原样提取为路径字符串。
audioPath必填,中文配音音频路径,通常来自 subtitle-to-speech 的 dub.zh.wav。
subtitlePath必填,中文字幕路径,支持 .srt 或 .vtt。会复制到 outputDir 后用于软字幕和硬字幕。
subtitleColor可选,硬字幕文字颜色。只允许 white、yellow、pink。用户说白色填 white,黄色填 yellow,粉色填 pink。默认 white。

Acceptance

checkfinal.zh.mp4 存在,ffprobe 可解析,且包含视频流、音频流和字幕流。
checkfinal.zh.hardsub.mp4 存在,ffprobe 可解析,且包含视频流和音频流。
checkfinal.zh.mp4 与 final.zh.hardsub.mp4 时长不得明显短于 compose-summary.videoDurationSeconds。
checkcompose-summary.json 存在且记录 videoPath、audioPath、subtitlePath、subtitleColor、hardsubSubtitlePath、finalVideoPath、hardsubVideoPath。