#4942 TaskCfgVTT(is_cuda=False, uuid='d8aab1b234', cache_folder='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234

240e:3b7* Posted at: 2 hours ago

语音识别阶段出错 [faster-whisper(本地)] Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero

Traceback (most recent call last):
File "videotrans\task\job.py", line 105, in run
File "videotrans\task\trans_create.py", line 390, in recogn
File "videotrans\recognition\__init__.py", line 293, in run
File "videotrans\recognition\_base.py", line 143, in run
File "videotrans\recognition\_overall.py", line 33, in _exec
File "videotrans\recognition\_overall.py", line 106, in _faster
File "videotrans\configure\_base.py", line 289, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero
TaskCfgVTT(is_cuda=False, uuid='d8aab1b234', cache_folder='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234', target_dir='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4', source_language='简体中文', source_language_code='zh-cn', source_sub='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/zh-cn.srt', source_wav='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234/zh-cn.wav', source_wav_output='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/zh-cn.m4a', target_language='英语', target_language_code='en', target_sub='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/en.srt', target_wav='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234/target.wav', target_wav_output='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/en.m4a', name='D:/short/zip/伺候老公白月光坐月子/63.mp4', noextname='63', basename='63.mp4', ext='mp4', dirname='D:/short/zip/伺候老公白月光坐月子', shound_del_name=None, translate_type=0, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=False, video_autorate=False, 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='tiqu', subtitles='', targetdir_mp4='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/63.mp4', novoice_mp4='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234/novoice.mp4', is_separate=False, embed_bgm=True, instrument=None, vocal='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234/vocal.wav', back_audio='', clear_cache=False, background_music=None, subtitle_type=0, only_out_mp4=False, recogn2pass=True, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8)


=
system:Windows-10-10.0.26200-SP0
version:v3.99
frozen:True
language:zh
root_dir:D:/short/app/win-pyvideotrans-v3.99-0508

3 Replies

faster-whisper在语音识别后的重新分段时遇到了除以零的错误。这通常由音频本身时长过短或VAD参数设置不当导致。

解决方案:

  1. 勾选“清理已生成”重新处理:主界面左上角勾选该选项,清除缓存后重新运行,避免缓存损坏的音频文件。
  2. 检查高级VAD参数:打开 菜单 → 工具 → 高级选项 → 语音识别参数,确保以下数值不为零且合理:

    • 最短语音持续毫秒:建议设为 1000
    • 最长语音持续秒数:建议设为 6
    • 静音分割持续毫秒:建议设为 500
    • 语音阈值:建议设为 0.5
  3. 检查源音频文件:确认 63.mp4 包含有效人声音轨且长度正常(至少几秒)。如果原视频极其短暂或纯无声,软件无法处理。
  4. 升级到最新版:当前版本为 v3.99,建议前往官网下载 v4.01 完整包覆盖安装,该版本已修复大量已知的边界情况崩溃。

若以上无效,请提供软件 logs/ 目录下最新日志文件底部约30行内容,以便进一步排查。

[DEBUG] 最终配置信息:self.cfg=TaskCfgVTT(is_cuda=False, uuid='d8aab1b234', cache_folder='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234', target_dir='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4', source_language='简体中文', source_language_code='zh-cn', source_sub='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/zh-cn.srt', source_wav='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234/zh-cn.wav', source_wav_output='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/zh-cn.m4a', target_language='英语', target_language_code='en', target_sub='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/en.srt', target_wav='D:/short/app/win-pyvideotrans-v3.99-0508/tmp/11056/d8aab1b234/target.wav', target_wav_output='D:/short/zip/伺候老公白月光坐月子/subtitles/63-mp4/en.m4a', name='D:/short/zip/伺候老公白月光坐月子/63.mp4', noextname='63', basename='63.mp4', ext='mp4', dirname='D:/short/zip/伺候老公白月光坐月子', shound_del_name=None, translate_type=0, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=Fals
......
_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero

Traceback (most recent call last):
File "videotrans\configure\_base.py", line 289, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero

[ERROR] new process:Traceback (most recent call last):
File "videotrans\configure\_base.py", line 289, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero

Traceback (most recent call last):
File "videotrans\configure\_base.py", line 289, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero

[DEBUG] [语音识别]渠道0,large-v3-turbo:共耗时:9s
[ERROR] Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero
Traceback (most recent call last):
File "videotrans\task\job.py", line 105, in run
File "videotrans\task\trans_create.py", line 390, in recogn
File "videotrans\recognition\__init__.py", line 293, in run
File "videotrans\recognition\_base.py", line 143, in run
File "videotrans\recognition\_overall.py", line 33, in _exec
File "videotrans\recognition\_overall.py", line 106, in _faster
File "videotrans\configure\_base.py", line 289, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero

[ERROR] Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero
Traceback (most recent call last):
File "videotrans\task\job.py", line 105, in run
File "videotrans\task\trans_create.py", line 390, in recogn
File "videotrans\recognition\__init__.py", line 293, in run
File "videotrans\recognition\_base.py", line 143, in run
File "videotrans\recognition\_overall.py", line 33, in _exec
File "videotrans\recognition\_overall.py", line 106, in _faster
File "videotrans\configure\_base.py", line 289, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 489, in faster_whisper
File "videotrans\process\stt_fun.py", line 188, in _resegment
ZeroDivisionError: division by zero

该错误核心原因是语音识别完成后的重新分段阶段出现了除零,通常是因为音频时长过短、静音过多或Whisper返回了无效/零时长的时间戳。

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

  1. 检查视频有效性
    确认 63.mp4 包含有效人声,且总时长至少有几秒。若视频极短(如1秒)或纯静音,软件无法处理。
  2. 调整“高级选项”中的语音识别参数
    打开 菜单 → 工具 → 高级选项 → 语音识别参数,确保以下值设置合理:

    • 最短语音持续毫秒:设为 1000
    • 最长语音持续秒数:设为 6
    • 静音分割持续毫秒:设为 500
    • 语音阈值:设为 0.5
    • 取消勾选 Whisper预分割音频?(如果已选中,尝试取消)
    • 取消勾选 合并过短字幕到邻近(若启用,先关闭)
  3. 更换识别模型
    尝试使用小模型如 basesmall,避免 large-v3-turbo 在短音频上产生无效时间戳。
    或切换到 openai-whisper(本地) + base 模型。
  4. 使用其他ASR渠道
    对中文视频,推荐改用 qwen-asr(本地)阿里FunASR(本地),它们对中文断句更稳定。
  5. 升级到最新版
    下载完整包覆盖安装至 v4.01,该版本已修复多处边界情况下的除以零崩溃。
  6. 强制清理缓存后重试
    勾选主界面“清理已生成”,重新执行,避免损坏的中间文件影响。

若上述步骤均无效,请提供视频时长、文件大小等信息,或尝试用其他工具(如格式工厂)将视频重新编码为 H.264 的 MP4 后再试。

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