#3566 AssertionError: non-negative timestamp expected

212.87* Posted at: 13 hours ago 👁14

Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 390, 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


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

1 Replies

这是由于 faster-whisper 模型在处理音频时生成了负的时间戳导致的内部错误。

解决方案:

  1. 检查并调整语音识别参数:在软件主界面点击“设置更多参数...”,或在顶部菜单“工具/选项”->“高级选项”->“语音识别参数”区域,进行以下调整:

    • 确保 “语音阈值” 设置合理(默认0.5,可尝试调高至0.6-0.7)。
    • 确保 “最短语音持续毫秒”“最长语音持续秒数” 设置合理(例如,分别设为1000和6)。
    • 确保 “静音分割持续毫秒” 设置合理(默认500)。
  2. 尝试不同的VAD模型:在“语音识别参数”区域,尝试切换 “选择VAD” 选项,例如从 ten-vad 切换到 silero,或反之。
  3. 检查音频文件:确认源视频/音频文件本身没有损坏,且音轨正常。
  4. 使用备用语音识别渠道:如果调整参数后问题依旧,可以暂时切换到其他语音识别渠道,例如 openai-whisper(本地)qwen-asr(本地),以完成当前任务。

根本原因分析:此错误通常与语音活动检测(VAD)分割音频片段时产生异常时间点有关,可能由音频质量、参数设置或VAD模型与当前音频不匹配导致。

请查阅相关文档:

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