#6986 TranslateSubtitle Translation Stage[Failed] Task error: No this Translation Channel:5[Failed] Task error: No this Transl

89.116**0 Posted at: 1 hour ago

Translate
Subtitle Translation Stage
[Failed] Task error: No this Translation Channel:5
[Failed] Task error: No this Translation Channel:5
[root@iv-gwwh2ypxhnrg pyvideotrans-main]# uv run --no-sync cli.py --task vtv --name "en2.mp4" --translate_type 5 --source_language_code en --target_language_code zh-cn

提示没有翻译渠道5 设置deepseek

11 Replies

#1 DeepSeek reply at 1 hour ago

这是 CLI 模式中指定的翻译渠道编号不正确导致的。DeepSeek 的渠道编号并非固定为 5,它会根据软件中已注册的翻译渠道顺序动态变化。

请先运行以下命令,查看当前软件支持的所有翻译渠道及其对应编号:

uv run --no-sync cli.py --list providers

输出列表中找到 DeepSeek 对应的数字编号,然后将其填入 --translate_type 参数即可。例如如果 DeepSeek 显示为 8,则命令应改为:

uv run --no-sync cli.py --task vtv --name "en2.mp4" --translate_type 8 --source_language_code en --target_language_code zh-cn

注意:--translate_type 接受的是渠道编号(整数),不是渠道名称。此外,如果使用 DeepSeek 渠道,还需确保你已在 videotrans/ 目录下的配置中正确填写了 DeepSeek 的 API Key(可通过 GUI 的“菜单-翻译设置-DeepSeek”进行配置),否则翻译阶段仍会报错。

#2 89.116**0 reply at 1 hour ago


Translation

0 = Google Translate (Free)
1 = Microsoft Translate (Free)
2 = M2M100(Built-in)
3 = Hy-MT2-1.8B(Built-in)
4 = OpenAI ChatGPT
5 = DeepSeek
6 = Gemini AI
7 = Zhipu AI
8 = AzureGPT AI
9 = CompatibleAI/LocalModel
10 = OpenRouter
11 = SiliconFlow
12 = 302.AI
13 = Bailian API
14 = ByteDance Ark LLM
15 = Xiaomi
16 = MiniMax AI
17 = CAMB AI
18 = DeepL
19 = DeepLx
20 = Baidu Translate
21 = Alibaba Machine Translation
22 = LibreTranslate(LocalAPI)
23 = Tencent Translate
24 = Custom Translation API
25 = LiteLLM

能确认deepseek 就是5

#3 DeepSeek reply at 1 hour ago

根据你提供的渠道列表,DeepSeek 确实是编号 5,但报错 No this Translation Channel:5 说明运行时翻译渠道注册表中没有加载到编号为 5 的渠道,而不是编号写错了。这通常是因为渠道未成功注册(配置缺失或依赖未同步)。

请按以下步骤排查:

  1. 执行完整依赖同步:你使用了 --no-sync,可能跳过了必要的依赖安装。请在代码目录下执行:

    uv sync

    然后重新运行命令,不要加 --no-sync

  2. 在 GUI 中确认 DeepSeek 渠道可用

    • 启动 sp.py 图形界面(uv run sp.py
    • 进入 菜单 → 翻译设置 → DeepSeek,确认已填写正确的 API Key 并保存
    • 回到主界面,查看“翻译渠道”下拉框中是否能选中 DeepSeek
    • 如果下拉框中没有 DeepSeek,说明渠道注册失败,可能是配置文件损坏或缺少依赖
  3. 清理配置文件后重试:若上述步骤无效,可删除 videotrans 目录下的 cfg.jsonparams.json(会恢复默认配置),重新在 GUI 中配置 DeepSeek 后保存,再运行 CLI。
  4. 提供日志:若问题依旧,请提供 logs/ 目录下最新日志文件中底部约 30 行报错信息,以便进一步定位。

请查阅相关文档:

#4 89.116**0 reply at 1 hour ago

原始输入文件名: /usr/local/tinghaiyun/pyvideotrans-main/en2.mp4,
输出结果保存到文件夹: /usr/local/tinghaiyun/pyvideotrans-main/output/en2-mp4,
临时文件夹: /usr/local/tinghaiyun/pyvideotrans-main/tmp/22575/c0a6e326ab
已选 清理已存在
未启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), tiny, 发音语言: , 断句方式:默认断句
发音语言和目标语言相同,不翻译字幕
未选 配音角色,不进行配音
字幕: Hard Subtitles
[DEBUG] The file info after process:result={'video_fps': 25.0, 'r_frame_rate': 25.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 720, 'height': 720, 'time': 30000, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}

[DEBUG] [新进程任务 开始:title='Model: tiny']
[DEBUG] 新进程任务 参数:kwargs={'detect_language': 'en', 'model_name': 'tiny', 'logs_file': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/22575/c0a6e326ab/faster-en-1788176708.6486855.log', 'is_cuda': False, 'no_speech_threshold': 0.6, 'condition_on_previous_text': False, 'speech_timestamps': None, 'audio_file': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/22575/c0a6e326ab/en.wav', 'local_dir': '/usr/local/tinghaiyun/pyvideotrans-main/models/models--Systran--faster-whisper-tiny', 'compute_type': 'default', 'jianfan': False, 'audio_duration': 30059, 'hotwords': '', 'prompt': '', 'beam_size': 5, 'best_of': 5, 'temperature': '', 'repetition_penalty': 1.0, 'compression_ratio_threshold': 2.4, 'max_speech_ms': 5000, 'subtitle_srt': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/faster-20260831-19_45_08.srt'}
[DEBUG] CPU进程池:max_workers=1
[DEBUG] 开始加载 faster-whisper模型tiny,数据类型:default
[DEBUG] [faster_whisper]加载模型tiny: is_cuda=False,_compute_type='default'
[DEBUG] 直接传递完整音频,由faster-whisper内部VAD处理,返回字级时间戳数据
[DEBUG] faster-whisper模式下,对tiny模型返回的字级时间戳进行断句
[DEBUG] 断句完毕返回结果
[DEBUG] faster-whisper下已临时保存识别结果到 /usr/local/tinghaiyun/pyvideotrans-main/tmp/faster-20260831-19_45_08.srt,防止进程崩溃后永久等待
[DEBUG] [新进程任务 title='Model: tiny'] 已返回
[DEBUG] [新进程任务 结束:title='Model: tiny'],耗时5.0158703327178955s
[DEBUG] 开始移除每条字幕末尾标点

#5 DeepSeek reply at 1 hour ago

根据日志报错 No this Translation Channel:5 并结合你提供的渠道列表,此处并非渠道编号错误,而是 DeepSeek 渠道未能在当前运行环境中正确注册。原因可能有两类:① 执行 --no-sync 跳过了依赖更新,导致翻译渠道注册表未加载新版代码;② 配置文件(如 cfg.jsonparams.json)中未正确保存 DeepSeek 的 API Key,导致渠道被运行时禁用。请按以下顺序操作:1. 在代码目录下执行完整依赖同步:uv sync2. 启动 GUI 界面 (uv run sp.py),进入 菜单 → 翻译设置 → DeepSeek,确认已填写有效 API Key 并点保存,退出 GUI。3. 确认命令行参数完整,你的命令 --task vtv --name "en2.mp4" --translate_type 5 --source_language_code en --target_language_code zh-cn--source_language_code 必须正确传值。从日志的“发音语言: ”为空判断,可能是参数未成功传入,请检查是否拼写有误或缺少引号。4. 重新运行命令,不要加 --no-sync:uv run cli.py --task vtv --name "en2.mp4" --translate_type 5 --source_language_code en --target_language_code zh-cn若仍报相同错误,请将 logs/ 目录下最新的日志文件底部约 30 行报错信息提供给我,以便定位。### 请查阅相关文档:- DeepSeek 翻译渠道配置- CLI命令行模式

#6 89.116**0 reply at 1 hour ago

[DEBUG] The file info after process:result={'video_fps': 25.0, 'r_frame_rate': 25.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 720, 'height': 720, 'time': 30000, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}

[DEBUG] [新进程任务 开始:title='Model: tiny']
[DEBUG] 新进程任务 参数:kwargs={'detect_language': 'en', 'model_name': 'tiny', 'logs_file': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/22575/c0a6e326ab/faster-en-1788176708.6486855.log', 'is_cuda': False, 'no_speech_threshold': 0.6, 'condition_on_previous_text': False, 'speech_timestamps': None, 'audio_file': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/22575/c0a6e326ab/en.wav', 'local_dir': '/usr/local/tinghaiyun/pyvideotrans-main/models/models--Systran--faster-whisper-tiny', 'compute_type': 'default', 'jianfan': False, 'audio_duration': 30059, 'hotwords': '', 'prompt': '', 'beam_size': 5, 'best_of': 5, 'temperature': '', 'repetition_penalty': 1.0, 'c
......
in/en2.mp4,
输出结果保存到文件夹: /usr/local/tinghaiyun/pyvideotrans-main/output/en2-mp4,
临时文件夹: /usr/local/tinghaiyun/pyvideotrans-main/tmp/24522/c0a6e326ab
已选 清理已存在
未启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), tiny, 发音语言: , 断句方式:默认断句
发音语言和目标语言相同,不翻译字幕
未选 配音角色,不进行配音
字幕: Hard Subtitles
[DEBUG] The file info after process:result={'video_fps': 25.0, 'r_frame_rate': 25.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 720, 'height': 720, 'time': 30000, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}

[DEBUG] [新进程任务 开始:title='Model: tiny']
[DEBUG] 新进程任务 参数:kwargs={'detect_language': 'en', 'model_name': 'tiny', 'logs_file': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/24522/c0a6e326ab/faster-en-1788177290.2274585.log', 'is_cuda': False, 'no_speech_threshold': 0.6, 'condition_on_previous_text': False, 'speech_timestamps': None, 'audio_file': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/24522/c0a6e326ab/en.wav', 'local_dir': '/usr/local/tinghaiyun/pyvideotrans-main/models/models--Systran--faster-whisper-tiny', 'compute_type': 'default', 'jianfan': False, 'audio_duration': 30059, 'hotwords': '', 'prompt': '', 'beam_size': 5, 'best_of': 5, 'temperature': '', 'repetition_penalty': 1.0, 'compression_ratio_threshold': 2.4, 'max_speech_ms': 5000, 'subtitle_srt': '/usr/local/tinghaiyun/pyvideotrans-main/tmp/faster-20260831-19_54_50.srt'}
[DEBUG] CPU进程池:max_workers=1
[DEBUG] 开始加载 faster-whisper模型tiny,数据类型:default
[DEBUG] [faster_whisper]加载模型tiny: is_cuda=False,_compute_type='default'
[DEBUG] 直接传递完整音频,由faster-whisper内部VAD处理,返回字级时间戳数据
[DEBUG] faster-whisper模式下,对tiny模型返回的字级时间戳进行断句
[DEBUG] 断句完毕返回结果
[DEBUG] faster-whisper下已临时保存识别结果到 /usr/local/tinghaiyun/pyvideotrans-main/tmp/faster-20260831-19_54_50.srt,防止进程崩溃后永久等待
[DEBUG] [新进程任务 title='Model: tiny'] 已返回
[DEBUG] [新进程任务 结束:title='Model: tiny'],耗时4.015053033828735s
[DEBUG] 开始移除每条字幕末尾标点

#7 DeepSeek reply at 1 hour ago

从日志中明确看到:发音语言: 为空,且 发音语言和目标语言相同,不翻译字幕。这导致翻译阶段被跳过,DeepSeek 渠道未实际调用,但之前的 No this Translation Channel:5 报错正是因翻译渠道未加载或未注册而触发。核心问题是 --source_language_code 参数未正确传入。

请按以下步骤操作:

1. 确认参数完整传递

你的命令为:

uv run cli.py --task vtv --name "en2.mp4" --translate_type 5 --source_language_code en --target_language_code zh-cn

请检查是否有拼写错误,并将参数改用等号形式,避免 shell 解析歧义:

uv run cli.py --task vtv --name="en2.mp4" --translate_type=5 --source_language_code=en --target_language_code=zh-cn

2. 确保依赖已同步

不要使用 --no-sync,先执行:

uv sync

3. 确认 DeepSeek 配置已保存

DeepSeek 渠道需要在 GUI 中先配置 API Key 才能注册:

uv run sp.py

进入 菜单 → 翻译设置 → DeepSeek,填写有效 API Key 并保存,退出 GUI。

4. 重启 CLI 验证

重新运行完整命令(不加 --no-sync):

uv run cli.py --task vtv --name "en2.mp4" --translate_type 5 --source_language_code en --target_language_code zh-cn

5. 若仍报错

请提供 logs/ 目录下最新日志文件底部约 30 行报错内容,以便进一步定位。

#8 89.116**0 reply at 1 hour ago

[root@iv-gwwh2ypxhnrg pyvideotrans-main]# uv run cli.py --task vtv --name="en2.mp4" --translate_type=5 --source_language_code=en --target_language_code=zh-cn
error: Failed to generate package metadata for chatterbox-tts==0.1.7 @ direct+https://github.com/resemble-ai/chatterbox/archive/refs/heads/master.tar.gz
Caused by: Request failed after 3 retries in 75.5s
Caused by: Failed to fetch: https://github.com/resemble-ai/chatterbox/archive/refs/heads/master.tar.gz
Caused by: error sending request for url (https://github.com/resemble-ai/chatterbox/archive/refs/heads/master.tar.gz)
Caused by: client error (Connect)
Caused by: operation timed out
我去掉--no-sync 执行提示异常

#9 DeepSeek reply at 1 hour ago

日志显示当前无法访问 github.com,导致 uv run 尝试同步 chatterbox-tts 依赖时超时失败。这是网络环境问题,而非软件本身错误。由于你的任务未使用配音,其实不需要 chatterbox-tts 这个依赖,可以继续使用 --no-sync 运行,但必须确保以下两点:

1. 确认 DeepSeek 渠道代码存在

No this Translation Channel:5 的根源是 DeepSeek 翻译渠道没有被正确加载,并不是编号问题。请检查源码目录下是否存在 videotrans/translator/deepseek.py 文件:

ls videotrans/translator/deepseek.py

如果文件存在,再测试渠道是否能正常导入:

uv run --no-sync python -c "from videotrans.translator.deepseek import DeepSeek; print('OK')"

如果导入报错,说明缺少依赖(如 openai),手动安装:

uv pip install openai requests

2. 确认 DeepSeek API Key 已保存

DeepSeek 渠道必须在配置文件中保存了有效的 API Key,否则系统会在运行时将渠道视为不可用而跳过注册。先在 GUI 中配置并保存:

uv run --no-sync sp.py

进入 菜单 → 翻译设置 → DeepSeek,填写 API Key 并保存。然后退出 GUI。

3. 重新运行 CLI 命令

确认以上均正常后,不加 --no-sync 会触发完整同步导致 GitHub 超时,所以仍需使用 --no-sync

uv run --no-sync cli.py --task vtv --name="en2.mp4" --translate_type=5 --source_language_code=en --target_language_code=zh-cn
⚠️ 注意:如果你此前执行 uv sync 未成功,.venv 环境可能不完整。但只要 openai 等关键依赖已安装,翻译渠道即可正常工作。若仍然报错,请提供 logs/ 目录下最新日志文件底部 30 行内容,以便进一步定位。
#10 89.116**0 reply at 1 hour ago

[root@iv-gwwh2ypxhnrg pyvideotrans-main]# uv run --no-sync python -c "from videotrans.translator.deepseek import DeepSeek; print('OK')"
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'videotrans.translator.deepseek'

#11 DeepSeek reply at 1 hour ago

当前报错 ModuleNotFoundError: No module named 'videotrans.translator.deepseek' 表明你的本地源码中缺失 DeepSeek 翻译渠道的实现文件,并非渠道编号错误,也非依赖缺失。这通常有两种可能:① 源码版本过旧,早于 DeepSeek 渠道被加入的版本;② 源码下载不完整。

请按以下步骤排查:

  1. 确认当前源码版本
    在 pyvideotrans-main 目录下执行:
    grep -rn "__version__" sp.py videotrans/ | head -5
    或直接查看 sp.py 开头是否有类似 VERSION = "v4.11" 的常量。若版本低于 v4.11,说明渠道缺失是版本问题,必须升级。
  2. 查看翻译渠道目录实际内容
    执行:ls videotrans/translator/ | grep -i deep
    如果没有任何 deep 相关文件,证实源码中确实没有该渠道实现,必须重新下载完整源码。
  3. 重新下载最新源码(GitHub 无法访问时的替代方案)
    由于当前环境访问 github.com 超时,建议:
  4. 配置代理:export HTTPS_PROXY=http://你的代理地址:端口,然后执行 git clone https://github.com/jianchang512/pyvideotrans 重新获取源码。
  5. 或使用国内镜像加速:如 https://ghproxy.com/https://github.com/jianchang512/pyvideotrans 下载压缩包,再解压覆盖到当前目录。
  6. 也可从 pyvideotrans 官方文档站 https://pyvideotrans.com/downpackage 获取源码包。
  7. 重新同步依赖并验证
    源码更新后,执行 uv sync(若 GitHub 同步仍超时,可先用 uv sync --no-sync 仅确认导入):
    uv run --no-sync python -c "from videotrans.translator.deepseek import DeepSeek; print('OK')"
    若输出 OK,再运行 CLI 命令即可。

如果已经是最新版但文件依然缺失,请提供 ls -la videotrans/translator/ 的完整输出,以便进一步判断。

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource