#3470 STT模式运行成功,vtv模式打印出参数列表后就没反应了

36.7* Posted at: 7 hours ago 👁26

(pyvideotrans) D:\pyvideotrans-main>uv run cli.py --task vtv --name "D:\723495053.mp4" --source_language_code pt --target_language_code zh-cn --voice_role "no" --is_separate --recogn2pass --subtitle_type 1
Checking GPUs...
First searching GPU...

[执行任务] 视频翻译 (VTV)
[处理文件] D:\723495053.mp4
[参数列表] {'name': 'D:\723495053.mp4', 'cache_folder': 'D:/pyvideotrans-main/tmp/13192/ad22f7af4f', 'target_dir': 'D:/pyvideotrans-main/output/723495053-mp4', 'dirname': 'D:/', 'basename': '723495053.mp4', 'noextname': '723495053', 'ext': 'mp4', 'uuid': 'ad22f7af4f', 'source_language_code': 'pt', 'target_language_code': 'zh-cn', 'recogn_type': 0, 'model_name': 'tiny', 'is_cuda': False, 'remove_noise': False, 'enable_diariz': False, 'nums_diariz': -1, 'rephrase': 0, 'fix_punc': False, 'tts_type': 0, 'voice_role': 'no', 'voice_rate': '+0%', 'volume': '+0%', 'pitch': '+0Hz', 'voice_autorate': False, 'video_autorate': False, 'align_sub_audio': False, 'translate_type': 0, 'is_separate': True, 'recogn2pass': True, 'subtitle_type': 1, 'clear_cache': True}

(pyvideotrans) D:\pyvideotrans-main>

10 Replies

这是由于命令行模式(CLI)在视频翻译(vtv)任务中,未指定必要的语音识别、翻译和配音渠道参数,导致任务无法启动。

根据日志,参数列表中 recogn_typetts_typetranslate_type 均为 0,这表示使用了默认或未配置的渠道。在命令行模式下,必须明确指定这些核心渠道。

解决方案:

  1. 补充必要参数:在现有命令基础上,添加 --recogn_type--tts_type--translate_type 参数,并为其指定有效的渠道编号。渠道编号可在软件GUI界面中查看,或参考知识库文档。
  2. 示例命令(假设使用 faster-whisper 识别、Edge-TTS 配音、DeepSeek 翻译):

    uv run cli.py --task vtv --name "D:\723495053.mp4" --source_language_code pt --target_language_code zh-cn --voice_role "no" --is_separate --recogn2pass --subtitle_type 1 --recogn_type 1 --tts_type 1 --translate_type 1
    • --recogn_type 1:对应 faster-whisper(本地) 语音识别渠道。
    • --tts_type 1:对应 Edge-TTS 配音渠道。
    • --translate_type 1:对应 DeepSeek 翻译渠道(需提前在GUI中配置好API Key和URL)。
  3. 验证渠道配置:确保在GUI界面中已正确配置你打算使用的渠道(如DeepSeek的API Key、Edge-TTS的角色等),因为CLI会读取这些全局配置。
  4. 查看所有可用参数:运行 uv run cli.py --help 可以查看 vtv 任务支持的所有参数及其说明。

请查阅相关文档:

vtv任务可以不要配音吗

可以。在命令行模式(CLI)的视频翻译(vtv)任务中,可以通过设置 --tts_type 0--voice_role "no" 来跳过配音步骤。

根据你的原始命令,你已经设置了 --voice_role "no",这表示“不配音”。但是,日志显示 tts_type 参数被默认设置为 0。在 pyVideoTrans 中,tts_type=0 通常表示“未选择”或“无”,这会导致任务流程不完整而无法启动。

解决方案:
要正确执行一个“仅翻译字幕、不生成配音”的视频翻译任务,你需要明确指定一个有效的、但实际不生成音频的配音渠道配置。有两种方法:

  1. 明确设置 --tts_type 0 并保持 --voice_role "no":虽然你的命令已有 --voice_role "no",但为了确保 CLI 正确解析,建议同时显式设置 tts_type。同时,必须指定一个有效的翻译渠道

    uv run cli.py --task vtv --name "D:\723495053.mp4" --source_language_code pt --target_language_code zh-cn --voice_role "no" --tts_type 0 --translate_type 1 --recogn_type 1 --is_separate --recogn2pass --subtitle_type 1
    • --tts_type 0:明确表示不使用配音功能。
    • --translate_type 1--recogn_type 1:必须指定有效的翻译和语音识别渠道(此处为示例,请根据你的配置调整编号)。
  2. 使用 --only_translate 参数(如果版本支持):更简洁的方式是使用专门控制“仅翻译”的参数。请查阅 uv run cli.py --help 的输出,确认是否存在 --only_translate 或类似参数。如果存在,可以这样使用:

    uv run cli.py --task vtv --name "D:\723495053.mp4" --source_language_code pt --target_language_code zh-cn --only_translate --recogn_type 1 --translate_type 1 --is_separate --recogn2pass --subtitle_type 1

    (注意:此参数需确认你的软件版本是否支持,知识库未明确提及,建议优先使用方法1)。

关键点:

  • CLI 任务要求所有核心功能(识别、翻译、配音)的渠道参数都必须被明确指定(即使指定为“无”),任务流程才能正确初始化。
  • 即使不配音,--subtitle_type 1(硬字幕)依然有效,最终输出的是带有翻译后硬字幕的视频。

请查阅相关文档:

(pyvideotrans) D:\pyvideotrans-main>uv run cli.py --task vtv --name "D:\723495053.mp4" --source_language_code pt --target_language_code zh-cn --recogn2pass --subtitle_type 1 --model_name large-v3 --translate_type 13 --recogn_type 1 --tts_type 0 --voice_role "no"
Checking GPUs...
First searching GPU...

[执行任务] 视频翻译 (VTV)
[处理文件] D:\723495053.mp4
[参数列表] {'name': 'D:\723495053.mp4', 'cache_folder': 'D:/pyvideotrans-main/tmp/24940/f90e4e0a90', 'target_dir': 'D:/pyvideotrans-main/output/723495053-mp4', 'dirname': 'D:/', 'basename': '723495053.mp4', 'noextname': '723495053', 'ext': 'mp4', 'uuid': 'f90e4e0a90', 'source_language_code': 'pt', 'target_language_code': 'zh-cn', 'recogn_type': 1, 'model_name': 'large-v3', 'is_cuda': False, 'remove_noise': False, 'enable_diariz': False, 'nums_diariz': -1, 'rephrase': 0, 'fix_punc': False, 'tts_type': 0, 'voice_role': 'no', 'voice_rate': '+0%', 'volume': '+0%', 'pitch': '+0Hz', 'voice_autorate': False, 'video_autorate': False, 'align_sub_audio': False, 'translate_type': 13, 'is_separate': False, 'recogn2pass': True, 'subtitle_type': 1, 'clear_cache': True}

(pyvideotrans) D:\pyvideotrans-main>

命令已成功解析并开始执行视频翻译(VTV)任务。根据参数列表,任务配置为:使用 faster-whisper (recogn_type=1) 和 large-v3 模型进行葡萄牙语(pt)语音识别,使用 translate_type=13(请确认这是你配置的翻译渠道,例如 DeepSeek)翻译为简体中文(zh-cn),不进行配音(tts_type=0, voice_role="no"),启用二次识别(recogn2pass=True),并输出硬字幕视频(subtitle_type=1)。任务已进入处理流程,请等待其完成。如果任务在后续步骤(如下载模型、识别、翻译)中失败,请提供 logs 文件夹中最新日志文件的底部约30行错误信息。

任务实际没有进行,logs文件中也没有报错

从 github 拉取最新代码 git pull

这是由于命令行任务在初始化后,因缺少必要的配置或环境问题,导致任务进程未能实际启动。参数列表显示正常,但进程立即结束且无日志,通常是因为核心依赖(如模型、API配置)未就绪,或任务在准备阶段遇到了静默失败。解决方案:检查翻译渠道配置:你指定的 --translate_type 13 需要对应的翻译渠道(如 DeepSeek、Google等)已在软件的图形界面(GUI)中正确配置(API Key、URL等)。请打开 sp.exe/sp.py 的图形界面,进入“菜单-设置-翻译渠道”,确认编号13的渠道已正确填写并测试可用。检查语音识别模型:你指定了 --model_name large-v3。如果是首次使用,faster-whisper 需要下载该模型。由于未启用CUDA(is_cuda=False),下载或加载大型模型可能因网络或内存问题静默失败。请尝试在GUI中手动使用一次 faster-whisper large-v3 模型,确保它能正常下载并运行。检查命令行任务队列:CLI 任务可能被添加到后台队列但未立即执行。尝试在命令中添加 --test 参数(如果支持)或运行一个更简单的任务(如 stt 语音转录)来测试CLI功能是否正常。查看临时文件夹:检查参数中 cache_folder 指向的临时目录(D:/pyvideotrans-main/tmp/24940/f90e4e0a90)是否被创建以及其中是否有文件。如果文件夹为空或不存在,说明任务在创建临时环境阶段就已失败。启用CUDA加速(如可用):如果拥有NVIDIA显卡,请安装 CUDA 12.8 和 cuDNN 9.x,并在命令中添加 --is_cuda 参数以显著提升处理速度并避免内存问题。请查阅相关文档:命令行模式使用 pyVideoTransfaster和openai识别模式windows上安装CUDA12.8和cuDNN9.11

感谢大佬,可以了

问题已解决。如果后续使用中遇到其他问题,可随时提供日志信息进行分析。

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