#5471 TaskCfgVTT(uuid='c1366d8dcd', name='D:/A-sucai/0625/bagai/1/Lisa-260625-0002-ES-DJ-916-TT-BG-V.mp4', dirname='D:/A-sucai

107.151* Posted at: 1 day ago

语音识别阶段出错[faster-whisper(本地内置)] non-negative timestamp expected:Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 239, in faster_whisper
File "faster_whisper\transcribe.py", line 460, in transcribe
File "faster_whisper\utils.py", line 123, in format_timestamp
AssertionError: non-negative timestamp expected

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 100, in process_task

File "videotrans\task\trans_create.py", line 322, in recogn

File "videotrans\recognition\__init__.py", line 190, in run

File "videotrans\recognition\_base.py", line 94, in run

File "videotrans\recognition\_whisper.py", line 37, in _exec

File "videotrans\recognition\_whisper.py", line 120, in _faster

File "videotrans\configure\base.py", line 258, in _new_process

videotrans.configure.excepts.VideoTransError: non-negative timestamp expected:Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 239, in faster_whisper
File "faster_whisper\transcribe.py", line 460, in transcribe
File "faster_whisper\utils.py", line 123, in format_timestamp
AssertionError: non-negative timestamp expected
TaskCfgVTT(uuid='c1366d8dcd', name='D:/A-sucai/0625/bagai/1/Lisa-260625-0002-ES-DJ-916-TT-BG-V.mp4', dirname='D:/A-sucai/0625/bagai/1', noextname='Lisa-260625-0002-ES-DJ-916-TT-BG-V', basename='Lisa-260625-0002-ES-DJ-916-TT-BG-V.mp4', ext='mp4', target_dir='D:/A-sucai/0625/bagai/dc/Lisa-260625-0002-ES-DJ-916-TT-BG-V-mp4', cache_folder='D:/peiyin-xxx/win-pyvideotrans-v4.02-0612/tmp/23460/c1366d8dcd', is_cuda=True, source_language='西班牙语', source_language_code='es', source_sub='D:/A-sucai/0625/bagai/dc/Lisa-260625-0002-ES-DJ-916-TT-BG-V-mp4/es.srt', source_wav='D:/peiyin-xxx/win-pyvideotrans-v4.02-0612/tmp/23460/c1366d8dcd/es.wav', source_wav_output='D:/A-sucai/0625/bagai/dc/Lisa-260625-0002-ES-DJ-916-TT-BG-V-mp4/es.m4a', target_language='葡萄牙语', target_language_code='pt', target_sub='D:/A-sucai/0625/bagai/dc/Lisa-260625-0002-ES-DJ-916-TT-BG-V-mp4/pt.srt', target_wav='D:/peiyin-xxx/win-pyvideotrans-v4.02-0612/tmp/23460/c1366d8dcd/target.wav', target_wav_output='D:/A-sucai/0625/bagai/dc/Lisa-260625-0002-ES-DJ-916-TT-BG-V-mp4/pt.m4a', translate_type=0, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='Duarte(Male/PT)', voice_autorate=False, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='es', recogn_type=0, model_name='large-v3', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=0, subtitle_language=None, app_mode='biaozhun', subtitles='', targetdir_mp4='D:/A-sucai/0625/bagai/dc/Lisa-260625-0002-ES-DJ-916-TT-BG-V-mp4/Lisa-260625-0002-ES-DJ-916-TT-BG-V.mp4', novoice_mp4='D:/peiyin-xxx/win-pyvideotrans-v4.02-0612/tmp/23460/c1366d8dcd/novoice.mp4', is_separate=True, embed_bgm=True, instrument='D:/peiyin-xxx/win-pyvideotrans-v4.02-0612/tmp/23460/c1366d8dcd/instrument.wav', vocal='D:/peiyin-xxx/win-pyvideotrans-v4.02-0612/tmp/23460/c1366d8dcd/vocal.wav', clear_cache=True, background_music='', subtitle_type=1, only_out_mp4=True, recogn2pass=True, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.5)


=
system:Windows-10-10.0.26200-SP0
version:v4.02
frozen:True
language:zh
root_dir:D:/peiyin-xxx/win-pyvideotrans-v4.02-0612

1 Replies

这个错误是由于 faster-whisper 在处理音频时遇到非法负值时间戳导致的内部断言失败,常见于音频片段极短或 VAD 切分异常的场景。

解决方案(按优先级排序)

  1. 取消勾选“Whisper预分割音频”
    进入 菜单 → 高级选项 → 语音识别参数,找到“Whisper预分割音频?”并取消勾选。这能避免 VAD 切分产生异常时序片段。
  2. 更换更稳定的模型
    将语音识别模型从 large-v3 改为 large-v3-turbo(mobiuslabsgmbh 版本),该模型对边界情况处理更好。
  3. 降低搜索精度参数
    在同一高级选项页面,将 识别准确度beam_size识别准确度best_of 均设为 1,减少计算复杂度。
  4. 缩短最长语音持续时间
    最长语音持续(秒) 从默认值降为 6,避免过长片段引发时间戳溢出。
  5. 更新软件版本
    你当前版本为 v4.02,建议下载最新完整包 v4.03-0622(官网 2.6GB 完整包),该版本修复了多个 faster-whisper 兼容性问题。

如果以上操作仍无法解决,请将 logs/ 目录下的最新日志(约最后30行)粘贴给我,以便进一步排查音频文件本身是否损坏。

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