#7933 The maximum decoding length must be > 0:Traceback (most recent call last): File

59.36**9 Posted at: 1 hour ago

The maximum decoding length must be > 0:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 139, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1213, in generate_segments
File "faster_whisper\transcribe.py", line 1446, in generate_with_fallback
ValueError: The maximum decoding length must be > 0

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 71, in run
File "videotrans\task\_stage_recogn.py", line 63, in recogn
File "videotrans\recognition\__init__.py", line 141, in run
File "videotrans\recognition\_base.py", line 101, in run
File "videotrans\recognition\_whisper.py", line 39, in _exec
File "videotrans\recognition\_whisper.py", line 137, in _faster
File "videotrans\configure\base.py", line 277, in _new_process
videotrans.configure.excepts.VideoTransError: The maximum decoding length must be > 0:Tracebac
......
le "faster_whisper\transcribe.py", line 1446, in generate_with_fallback
ValueError: The maximum decoding length must be > 0

trk=[TransCreate]: uuid='b5c3f1d6d7', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/Administrator/Desktop/5 Critical Hydraulic Pump Noises Diagnosing Failure Fast [4K]-1920x1080-avc1-mp4a.mp4,
输出结果保存到文件夹: C:/Users/Administrator/Desktop/_video_out/5 Critical Hydraulic Pump Noises Diagnosing Failure Fast [4K]-1920x1080-avc1-mp4a-mp4,
临时文件夹: C:/Users/Administrator/Desktop/win-pyvideotrans-v4.15/win-pyvideotrans-v4.15/tmp/16512/b5c3f1d6d7
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语, LLM纠错
翻译渠道:智谱AI,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 已选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: 不嵌入字幕 , precent=4, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=True, do_diarize=True
trk.cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/Administrator/Desktop/5 Critical Hydraulic Pump Noises Diagnosing Failure Fast [4K]-1920x1080-avc1-mp4a.mp4,
输出结果保存到文件夹: C:/Users/Administrator/Desktop/_video_out/5 Critical Hydraulic Pump Noises Diagnosing Failure Fast [4K]-1920x1080-avc1-mp4a-mp4,
临时文件夹: C:/Users/Administrator/Desktop/win-pyvideotrans-v4.15/win-pyvideotrans-v4.15/tmp/16512/b5c3f1d6d7
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语, LLM纠错
翻译渠道:智谱AI,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 已选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: 不嵌入字幕
video_duration_ms=423000


=
system:Windows-10-10.0.19044-SP0
version:v4.15
frozen:True
language:zh_CN
root_dir:C:/Users/Administrator/Desktop/win-pyvideotrans-v4.15/win-pyvideotrans-v4.15

1 Replies

#1 DeepSeek reply at 1 hour ago

知识库中未收录该报错的确切成因,以下为基于报错堆栈和软件机制的可尝试方案:

该错误发生在 faster-whisper 的 restore_speech_timestamps(按字级时间戳重新断句)阶段,说明某个语音片段在解码时被计算出的最大解码长度 ≤ 0(通常是片段过短、切片异常或 VAD 切分产生的无效片段)。

按顺序尝试:

  1. 绕过重新断句阶段(最可能有效)
    在软件根目录(sp.exe 所在文件夹)新建空文件 no_resegment.txt,即可禁止 faster-whisper 按字级时间戳重新断句,直接使用模型识别结果作为字幕。
    注意:此功能需下载 v4.15 补丁包覆盖后生效(即便已是 v4.15 完整包,仍需再覆盖一次补丁包)。
  2. 调整 VAD 参数
    进入 菜单 → 工具/选项 → 高级选项 → 语音识别参数:

    • 将 最长语音持续(秒) 适当调大(如 8~10),避免过短切片
    • 将 最短语音持续(毫秒) 适当调小或保持 3000,避免产生极短无效片段
    • 注意 最长语音持续(秒)×1000 必须大于 最短语音持续(毫秒)
  3. 更换识别模型或渠道

    • 将 faster-whisper 模型由 large-v3-turbo 换成 large-v3 重试
    • 或改用 openai-whisper(内置) / Qwen-ASR(内置) 渠道对比测试
  4. 规范文件路径与名称
    当前文件名含空格、方括号 [4K] 等特殊符号,底层工具兼容性较差,建议重命名为纯英文数字下划线(如 pump_noise.mp4)并放到浅层目录(如 D:/)后重试。
  5. 重试时务必勾选 清理已生成,避免复用上次的临时切片。

若以上均无效,请将 logs/ 目录下最新日志文件的报错部分(约 30 行)提供以便进一步分析。

请查阅相关文档:

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