#5073 TaskCfgVTT(uuid='b058e688b1', name='C:/Users/ENG TEALENG/Desktop/new movie/1/1-1.mp4', dirname='C:/Users/ENG TEALENG/Des

96.9* Posted at: 4 hours ago

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8188, prompt_tokens=2307, total_tokens=10495, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=0, reasoning_tokens=7869, rejected_prediction_tokens=None, text_tokens=0, image_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0, text_tokens=2307, image_tokens=0), input_tokens=0, output_tokens=0, input_tokens_details=None, claude_cache_creation_5_m_tokens=0, claude_cache_creation_1_h_tokens=0)语音识别阶段出错:openai-whisper(本地), 翻译字幕阶段出错: OpenAI ChatGPT, 配音阶段出错:Edge-TTS(免费)
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 68, in run
File "videotrans\task\trans_create.py", line 585, in trans
File "videotrans\translator\__init__.py", line 858, in run
File "videotrans\translator\_base.py", line 72, in run
File "videotrans\translator\_base.py", line 142, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 84, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8188, prompt_tokens=2307, total_tokens=10495, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=0, reasoning_tokens=7869, rejected_prediction_tokens=None, text_tokens=0, image_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0, text_tokens=2307, image_tokens=0), input_tokens=0, output_tokens=0, input_tokens_details=None, claude_cache_creation_5_m_tokens=0, claude_cache_creation_1_h_tokens=0)
TaskCfgVTT(uuid='b058e688b1', name='C:/Users/ENG TEALENG/Desktop/new movie/1/1-1.mp4', dirname='C:/Users/ENG TEALENG/Desktop/new movie/1', noextname='1-1', basename='1-1.mp4', ext='mp4', target_dir='C:/Users/ENG TEALENG/Desktop/new movie/1/_video_out/1-1-mp4', cache_folder='E:/pyvideotrans/tmp/20952/b058e688b1', is_cuda=True, source_language='简体中文', source_language_code='zh-cn', source_sub='C:/Users/ENG TEALENG/Desktop/new movie/1/_video_out/1-1-mp4/zh-cn.srt', source_wav='E:/pyvideotrans/tmp/20952/b058e688b1/zh-cn.wav', source_wav_output='C:/Users/ENG TEALENG/Desktop/new movie/1/_video_out/1-1-mp4/zh-cn.m4a', target_language='高棉语', target_language_code='km', target_sub='C:/Users/ENG TEALENG/Desktop/new movie/1/_video_out/1-1-mp4/km.srt', target_wav='E:/pyvideotrans/tmp/20952/b058e688b1/target.wav', target_wav_output='C:/Users/ENG TEALENG/Desktop/new movie/1/_video_out/1-1-mp4/km.m4a', translate_type=3, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='Piseth(Male/KH)', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='zh-cn', recogn_type=1, model_name='large-v3-turbo', shibie_audio=None, remove_noise=False, enable_diariz=True, nums_diariz=1, rephrase=0, fix_punc=False, subtitle_language=None, app_mode='biaozhun', subtitles='', targetdir_mp4='C:/Users/ENG TEALENG/Desktop/new movie/1/_video_out/1-1-mp4/1-1.mp4', novoice_mp4='E:/pyvideotrans/tmp/20952/b058e688b1/novoice.mp4', is_separate=False, embed_bgm=True, instrument=None, vocal='E:/pyvideotrans/tmp/20952/b058e688b1/vocal.wav', clear_cache=True, background_music='', subtitle_type=0, only_out_mp4=False, recogn2pass=False, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8)


=
system:Windows-10-10.0.26200-SP0
version:v4.01
frozen:True
language:zh
root_dir:E:/pyvideotrans

1 Replies

语音识别和配音的错误是翻译失败导致的连锁反应。根本原因是 OpenAI ChatGPT 翻译时输出内容被截断LengthFinishReasonError),因为一次性发送了大量字幕(发送完整字幕 开启),超出了模型的最大 token 限制(当前输出已达 8188 tokens)。

解决方法(按推荐顺序尝试):

  1. 取消“发送完整字幕”
    在主界面中取消勾选 发送完整字幕,改为按行翻译。这会让每批只发送少量字幕行,避免超出上下文窗口。
  2. 降低“AI翻译渠道每批字幕行数”
    点击 菜单 → 工具/选项 → 高级选项,在 字幕翻译调整 中将 AI翻译渠道每批字幕行数 从默认值改为 5~10 行。
  3. 更换为更长上下文的模型
    菜单 → 翻译设置 → OpenAI ChatGPT 中,将模型名称改为支持更长上下文的版本,如 gpt-4-32kgpt-4-turbo(需确认 API Key 有使用权限)。
  4. 临时换用非 AI 翻译渠道
    如使用 微软翻译(免费)DeepL 等传统翻译渠道,它们没有 token 限制,可绕过此问题。

请查阅相关文档:

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. Dondate: ko-fi.com/jianchang512

Related resource