#3466 TaskCfgVTT(is_cuda=False, uuid='933949caa5', cache_folder='D:/install/win-pyvideotrans-v3.97-0303/tmp/21952/933949caa5',

159.138* Posted at: 10 hours ago 👁11

配音阶段出错 [CosyVoice(本地)] timed out
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\connection.py", line 101, in handle_request
File "httpcore\_sync\http11.py", line 143, in handle_request
File "httpcore\_sync\http11.py", line 113, in handle_request
File "httpcore\_sync\http11.py", line 186, in _receive_response_headers
File "httpcore\_sync\http11.py", line 224, in _receive_event
File "httpcore\_backends\sync.py", line 124, in read
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ReadTimeout: timed out

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

Traceback (most recent call last):
File "videotrans\tts\_cosyvoice.py", line 58, in _item_task_cosyvoice2
File "gradio_client\client.py", line 162, in init
File "gradio_client\client.py", line 933, in _get_config
File "httpx\_api.py", line 195, in get
File "httpx\_api.py", line 109, in request
File "httpx\_client.py", line 825, in request
File "httpx\_client.py", line 914, in send
File "httpx\_client.py", line 942, in _send_handling_auth
File "httpx\_client.py", line 979, in _send_handling_redirects
File "httpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ReadTimeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 213, in run
File "videotrans\task\trans_create.py", line 702, in dubbing
File "videotrans\task\trans_create.py", line 977, in _tts
File "videotrans\tts\__init__.py", line 328, in run
File "videotrans\tts\_base.py", line 136, in run
File "videotrans\tts\_cosyvoice.py", line 26, in _exec
File "videotrans\tts\_base.py", line 205, in _local_mul_thread
File "videotrans\tts\_cosyvoice.py", line 156, in _item_task
File "videotrans\tts\_cosyvoice.py", line 60, in _item_task_cosyvoice2
videotrans.configure._except.StopRetry: timed out
TaskCfgVTT(is_cuda=False, uuid='933949caa5', cache_folder='D:/install/win-pyvideotrans-v3.97-0303/tmp/21952/933949caa5', target_dir='D:/project/ai/mini/E2FGVI/examples/_video_out/4_3-mp4', source_language='简体中文', source_language_code='zh-cn', source_sub='D:/project/ai/mini/E2FGVI/examples/_video_out/4_3-mp4/zh-cn.srt', source_wav='D:/install/win-pyvideotrans-v3.97-0303/tmp/21952/933949caa5/zh-cn.wav', source_wav_output='D:/project/ai/mini/E2FGVI/examples/_video_out/4_3-mp4/zh-cn.m4a', target_language='泰国语', target_language_code='th', target_sub='D:/project/ai/mini/E2FGVI/examples/_video_out/4_3-mp4/th.srt', target_wav='D:/install/win-pyvideotrans-v3.97-0303/tmp/21952/933949caa5/target.wav', target_wav_output='D:/project/ai/mini/E2FGVI/examples/_video_out/4_3-mp4/th.m4a', name='D:/project/ai/mini/E2FGVI/examples/4_3.mp4', noextname='4_3', basename='4_3.mp4', ext='mp4', dirname='D:/project/ai/mini/E2FGVI/examples', shound_del_name=None, translate_type=0, tts_type=11, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='clone', voice_autorate=True, video_autorate=True, remove_silent_mid=False, align_sub_audio=True, detect_language='zh-cn', 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, subtitle_language=None, app_mode='biaozhun', subtitles='', targetdir_mp4='D:/project/ai/mini/E2FGVI/examples/_video_out/4_3-mp4/4_3.mp4', novoice_mp4='D:/install/win-pyvideotrans-v3.97-0303/tmp/21952/933949caa5/novoice.mp4', is_separate=False, instrument=None, vocal=None, back_audio='', clear_cache=False, background_music=None, subtitle_type=1, only_out_mp4=False, recogn2pass=True, output_srt=0, copysrt_rawvideo=False)


=
system:Windows-10-10.0.26200-SP0
version:v3.97
frozen:True
language:zh
root_dir:D:/install/win-pyvideotrans-v3.97-0303

1 Replies

这是由于连接 CosyVoice 本地服务超时导致的。错误日志显示 httpx.ReadTimeout: timed out,表明 pyVideoTrans 在尝试连接 CosyVoice 的 API 服务时,在规定时间内未收到响应。

解决方案:

  1. 确保 CosyVoice 服务已正确启动并运行:检查你部署 CosyVoice WebUI 的终端窗口是否仍在运行,且没有报错。
  2. 验证 API 地址和端口:在 pyVideoTrans 的 CosyVoice 配音渠道设置中,确认 API 地址(例如 http://127.0.0.1:7860)与 CosyVoice 服务实际监听的地址和端口完全一致。
  3. 检查网络连接与防火墙:确保本地环回地址(127.0.0.1)未被防火墙或安全软件阻止。可以尝试在浏览器中访问 CosyVoice 的 WebUI 地址(如 http://127.0.0.1:7860),确认服务可正常访问。
  4. 调整超时设置(如可能):如果 CosyVoice 模型处理单次请求较慢(尤其是在处理长文本或使用高精度设置时),可能会导致默认超时。目前 pyVideoTrans 软件内部未提供直接调整此超时时间的选项。如果服务本身响应慢,可尝试重启 CosyVoice 服务,或检查其日志看是否有处理错误。
  5. 简化任务:如果正在处理大量字幕行,可以尝试先对少量字幕进行配音测试,以排除因任务过载导致服务响应缓慢的问题。
  6. 参考音频要求:你使用了 voice_role='clone'(克隆音色)。请确保在“高级选项”->“语音识别参数”中,已将“最短语音持续毫秒”设为 3000,“最长语音持续秒数”设为 10,并选中“Whisper预分割音频”和“合并过短字幕到相邻”,以确保提供给 CosyVoice 的参考音频时长在推荐的 3-10 秒之间。

请查阅相关文档:

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