#3552 我要用到配音渠道、说话人识别、模型等参数,完整命令。用微软的识别以及翻译

154.3* Posted at: 4 hours ago 👁33

我要用到配音渠道、说话人识别、模型等参数,完整命令。用微软的识别以及翻译

1 Replies

根据你的需求,你需要使用命令行模式(CLI)来执行一个完整的视频翻译任务,并指定使用微软的语音识别和翻译渠道。以下是基于知识库中 TaskCfgVTT 配置类和 CLI 使用说明构建的完整命令示例。

核心命令结构:

uv run cli.py --task vtv --name "你的视频文件路径" --source_language_code zh --target_language_code en --recogn_type 微软语音识别渠道代码 --translate_type 微软翻译渠道代码 --tts_type 你选择的配音渠道代码 --voice_role "配音角色名" --enable_diariz True

分步参数说明与构建:

  1. 基本任务参数

    • --task vtv:指定任务类型为视频翻译。
    • --name "D:/videos/myvideo.mp4":替换为你的视频文件绝对路径。
    • --source_language_code zh:指定源语言代码(例如:中文为zh,英文为en)。
    • --target_language_code en:指定目标语言代码。
  2. 指定微软渠道

    • 语音识别 (ASR):根据知识库,微软语音识别渠道可能对应 googlespeech 或需查看软件内实际代码。你需要从软件界面确认“语音识别”下拉列表中微软渠道对应的内部代码值。假设为 googlespeech,则参数为 --recogn_type googlespeech
    • 翻译:根据知识库,微软翻译渠道对应 microsoft。参数为 --translate_type microsoft
  3. 配音与说话人识别参数

    • --tts_type:指定配音渠道代码(例如:Edge-TTS为edgetts,Azure TTS为azuretts等)。
    • --voice_role "角色名":指定具体的配音角色(需与所选TTS渠道匹配)。
    • --enable_diariz True:启用说话人识别。
    • --nums_diariz 2:(可选)指定预计的说话人数,不指定则不限制。
  4. 其他可能用到的参数(根据知识库中TaskCfgVTT类):

    • --subtitle_type 1:嵌入硬字幕(1=硬,2=软,3=双硬,4=双软)。
    • --voice_autorate True:启用配音加速以对齐。
    • --video_autorate True:启用视频慢速以对齐。
    • --recogn2pass True:启用二次识别,确保字幕与配音精确对齐。
    • --remove_silent_mid True:移除字幕间的静音。
    • --is_separate True:分离人声和背景声(如果使用克隆配音建议开启)。

完整命令示例(假设使用Edge-TTS配音,并启用说话人识别):

uv run cli.py --task vtv --name "D:/videos/input.mp4" --source_language_code zh --target_language_code en --recogn_type googlespeech --translate_type microsoft --tts_type edgetts --voice_role "zh-CN-XiaoxiaoNeural" --enable_diariz True --nums_diariz 2 --subtitle_type 1 --voice_autorate True --video_autorate True --recogn2pass True

重要提示:

  1. 参数值确认--recogn_type--tts_type--voice_role 的具体值需从软件图形界面中对应下拉列表的选项背后获取(或查阅源码),以上示例为常见值,可能不完全准确。
  2. 运行环境:此命令需在软件源码目录下,使用 uv 环境执行。
  3. 查看所有参数:你可以运行 uv run cli.py --help 查看所有可用的命令行参数及其说明。

请查阅相关文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource