#5766 Traceback (most recent call last): File

2600:1f18* Posted at: 3 days ago

Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 397, 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\_only_one.py", line 44, in run
File "videotrans\task\trans_create.py", line 361, 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 105, 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 397, 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.26100-SP0
version:v3.99
frozen:True
language:zh
root_dir:D:/SetupFiles/pyvideotrans/win-pyvideotrans-v3.99-418

1 Replies

这是 faster-whisper 语音识别引擎内部的断言错误:non-negative timestamp expected,表明在处理音频片段时生成了负的时间戳。

原因分析:
最常见的是音频预处理(如 VAD 分割或 Whisper 预分割)导致某个片段的时间戳计算异常,例如音频开头被截取后留下负的起始时间。也可能是音频文件本身有损坏或格式特殊。你当前使用的是 v3.99 版本,该版本已较旧(最新 v4.05-0711),可能包含已修复的此类 Bug。

解决方案:

  1. 升级软件:下载最新完整版(v4.05-0711)并重新测试。
  2. 临时规避:在主界面取消勾选 设置更多参数 中的 分离人声背景声降噪;同时在 菜单-工具-高级选项-语音识别参数 中,取消勾选 Whisper预分割音频 以及 选择VAD 设为 ,以排除预处理导致的时间异常。
  3. 切换 ASR 渠道:尝试改用 openai-whisper(本地内置)Qwen-ASR(本地内置) 等渠道,看是否复现问题。
  4. 检查音频文件:用其他播放器播放该视频确认音频正常,或尝试用格式工厂等工具将视频重新转码为标准 MP4(H.264 + AAC)后再导入。

如果问题仍存在,请提供 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 via ko-fi.com

Dondate via PayPal

Related resource