#4784 在使用“翻译视频或音频”时,我可以导入原始语言字幕和翻译后的语言字幕吗?

219.134* Posted at: 10 hours ago

我已经有原始语言字幕和翻译后的语言字幕了,我想看看克隆声音的效果

7 Replies

可以。你完全可以使用已有的原始语言字幕和翻译后字幕,跳过语音识别和翻译阶段,直接进入配音和合成环节,这样就能快速测试声音克隆效果。

操作步骤:

  1. 准备视频文件:假设视频为 video.mp4,放到不含中文和空格的路径下(如 D:/videos/)。
  2. 创建字幕目录:在视频所在目录下创建 _video_out 文件夹,再在里面创建 video-mp4 文件夹(注意:如果视频是 .avi 则为 video-avi,依此类推)。
  3. 放入字幕文件

    • 将原始语言(如英文)字幕命名为 en.srt
    • 将目标语言(如中文)字幕命名为 zh-cn.srt
    • 将这两个 .srt 文件放入 _video_out/video-mp4/ 目录。
  4. 在软件中配置

    • 在“翻译视频或音频”界面选择该视频。
    • 发音语言:选择与原始字幕对应的语言(如英语)。
    • 目标语言:选择与翻译字幕对应的语言(如简体中文)。
    • 翻译渠道:任意选择(软件检测到已有对应语言字幕时会跳过翻译)。
    • 配音渠道:选择支持克隆的渠道(如 F5-TTS、CosyVoice、GPT-SoVITS 等)。
    • 配音角色:选中 clone(系统会自动使用视频原始音色配音)。
    • 其他选项按需要设置(如是否嵌入字幕、是否分离背景音等)。
  5. 点击 开始执行

软件将自动检测到你已提供字幕,直接使用它们进行配音并合成最终视频,全程不会重新进行语音识别和翻译。

请查阅相关文档:

文档里说:注意:一定不要选择 保存目录哦,使用默认目录。这个要怎么设置

在软件主界面“翻译视频或音频”中,找到 “输出到..” 一行。保持其右侧显示的路径为默认值(通常是原视频目录下的 _video_out),不要点击该按钮去修改,这样就会自动使用默认输出目录。如果你之前点击并更改过,可以再次点击该按钮,在弹出的文件夹选择窗口中点击“取消”或重新选择原视频目录下的 _video_out 即可恢复默认。

No module named 'qwen_tts'
multiprocessing.sk


:
"""
Traceback (most recent call last):
File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/multiprocessing/pool.py", line 125, in worker

result = (True, func(*args, **kwds))

File "/Users/shenrong/pyvideotrans/videotrans/process/tts_fun.py", line 30, in qwen3tts_fun

from qwen_tts import Qwen3TTSModel

ModuleNotFoundError: No module named 'qwen_tts'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/shenrong/pyvideotrans/videotrans/task/only_one.py", line 85, in run

trk.dubbing()

File "/Users/shenrong/pyvideotrans/videotrans/task/trans_create.py", line 630, in dubbing

self._tts()

File "/Users/shenrong/pyvideotrans/videotrans/task/trans_create.py", line 931, in _tts

run_tts(

File "/Users/shenrong/pyvideotrans/videotrans/tts/__init__.py", line 181, in run

return _cls(**kwargs).run()  # type:ignore

File "/Users/shenrong/pyvideotrans/videotrans/tts/_base.py", line 90, in run

self._exec()

File "/Users/shenrong/pyvideotrans/videotrans/tts/_qwenttslocal.py", line 46, in _exec

self._new_process(callback=qwen3tts_fun,title=title,is_cuda=self.is_cuda,kwargs=kwargs)

File "/Users/shenrong/pyvideotrans/videotrans/configure/base.py", line 238, in _new_process

data,err = future.result()

File "/Users/shenrong/pyvideotrans/videotrans/process/signelobj.py", line 13, in result

return self.async_result.get(timeout=timeout)

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/multiprocessing/pool.py", line 774, in get

raise self._value

ModuleNotFoundError: No module named 'qwen_tts'
TaskCfgVTT(uuid='3127db9cda', name='/Users/shenrong/Downloads/video/yuan_video.mp4', dirname='/Users/shenrong/Downloads/video', noextname='yuan_video', basename='yuan_video.mp4', ext='mp4', target_dir='/Users/shenrong/Downloads/video/_video_out/yuan_video-mp4', cache_folder='/Users/shenrong/pyvideotrans/tmp/23316/3127db9cda', is_cuda=False, sosk


='英语', sosk
_code='en', source_sub='/Users/shenrong/Downloads/video/_video_out/yuan_video-mp4/en.srt', source_wav='/Users/shenrong/pyvideotrans/tmp/23316/3127db9cda/en.wav', source_wav_output='/Users/shenrong/Downloads/video/_video_out/yuan_video-mp4/en.m4a', task
='简体中文', task
_code='zh-cn', target_sub='/Users/shenrong/Downloads/video/_video_out/yuan_video-mp4/zh-cn.srt', target_wav='/Users/shenrong/pyvideotrans/tmp/23316/3127db9cda/target.wav', target_wav_output='/Users/shenrong/Downloads/video/_video_out/yuan_video-mp4/zh-cn.m4a', translate_type=0, tts_type=1, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='clone', vsk
=False, vsk
=False, remove_silent_mid=False, align_sub_audio=True, desk
='en', recogn_type=0, model_name='large-v3-turbo', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=False, subtsk
=None, app_mode='biaozhun', subtitles='', targetdir_mp4='/Users/shenrong/Downloads/video/_video_out/yuan_video-mp4/yuan_video.mp4', novoice_mp4='/Users/shenrong/pyvideotrans/tmp/23316/3127db9cda/novoice.mp4', sk
=False, embed_bgm=False, instrument=None, vocal='/Users/shenrong/pyvideotrans/tmp/23316/3127db9cda/vocal.wav', clear_cache=False, background_music='', subtitle_type=2, only_out_mp4=False, recogn2pass=False, output_srt=0, copsk
=False, sk
=1, backaudio_volume=0.8)

错误原因是缺少 qwen_tts 模块。你选择了“Qwen3-TTS(本地内置)”配音渠道,但该模块未正确安装。macOS 源码部署时需额外安装此依赖。

解决方案(在源码目录及 conda 环境下执行):

  1. 确保已执行 uv sync 同步所有依赖。
  2. 尝试手动安装:uv pip install qwen-tts
  3. 若失败,请检查你的 Python 环境是否已激活(conda activate pyvideotrans),并确保网络正常。

如果以上步骤仍无法解决,请提供 logs/ 目录下的最新日志文件(底部约 30 行),以便进一步分析。

ModuleNotFoundError: No module named 'qwen_tts'
[ERROR] 写入新进程日志时出错[Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk


.3906481.log'
Traceback (most recent call last):
File "/Users/shenrong/pyvideotrans/videotrans/process/stt_fun.py", line 644, in _write_log

Path(file).write_text(msg, encoding='utf-8')

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1154, in write_text

with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1119, in open

return self._accessor.open(self, mode, buffering, encoding, errors,

FileNotFoundError: [Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk


.3906481.log'
[ERROR] 写入新进程日志时出错[Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk
.3906481.log'
Traceback (most recent call last):
File "/Users/shenrong/pyvideotrans/videotrans/process/stt_fun.py", line 644, in _write_log

Path(file).write_text(msg, encoding='utf-8')

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1154, in write_text

with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1119, in open

return self._accessor.open(self, mode, buffering, encoding, errors,

FileNotFoundError: [Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk


.3906481.log'
[ERROR] 写入新进程日志时出错[Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk
.3906481.log'
Traceback (most recent call last):
File "/Users/shenrong/pyvideotrans/videotrans/process/stt_fun.py", line 644, in _write_log

Path(file).write_text(msg, encoding='utf-8')

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1154, in write_text

with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1119, in open

return self._accessor.open(self, mode, buffering, encoding, errors,

FileNotFoundError: [Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk


.3906481.log'
[ERROR] 写入新进程日志时出错[Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk
.3906481.log'
Traceback (most recent call last):
File "/Users/shenrong/pyvideotrans/videotrans/process/stt_fun.py", line 644, in _write_log

Path(file).write_text(msg, encoding='utf-8')

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1154, in write_text

with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:

File "/opt/miniconda3/envs/pyvideotrans/lib/python3.10/pathlib.py", line 1119, in open

return self._accessor.open(self, mode, buffering, encoding, errors,

FileNotFoundError: [Errno 2] No such file or directory: '/Users/shenrong/pyvideotrans/tmp/22981/3127db9cda/faster-sk


.3906481.log'

缺少 qwen_tts 模块,导致 Qwen3-TTS 本地配音无法运行。后续的日志写入错误 (No such file or directory) 是临时文件目录不完整的连锁反应。

请按以下步骤操作:

  1. 安装缺失模块:在源码目录(~/pyvideotrans)下,确认已激活 conda 环境,然后执行:

    uv pip install qwen-tts

    或使用 pip:

    pip install qwen-tts
  2. 清理临时目录:删除 ~/pyvideotrans/tmp/ 下的所有内容,避免残留文件冲突。
  3. 重新运行软件:启动、选择视频(或切换为其他不需 qwen_tts 的配音渠道如 Edge-TTS 先排除问题),再次开始执行。

如果仍报模块缺失,请提供 uv sync 时的完整输出或确认 pip list | grep qwen 是否显示已安装。

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