#6402 non-negative timestamp expected:Traceback (most recent call last): File

2408:**:2852 Posted at: 6 hours ago

non-negative timestamp expected:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 118, in faster_whisper
File "faster_whisper\transcribe.py", line 460, in transcribe
File "faster_whisper\utils.py", line 124, in format_timestamp
AssertionError: non-negative timestamp expected

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 62, in run
File "videotrans\task\_stage_recogn.py", line 62, in recogn
File "videotrans\recognition\__init__.py", line 206, in run
File "videotrans\recognition\_base.py", line 92, in run
File "videotrans\recognition\_whisper.py", line 41, in _exec
File "videotrans\recognition\_whisper.py", line 129, in _faster
File "videotrans\configure\base.py", line 267, in _new_process
videotrans.configure.excepts.VideoTransError: non-negative timestamp expected:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 118, in faster_whisper
File "faster_whisper\transcribe.py", line 460, in transcribe
File "faster_whisper\utils.py", line 124, in format_timestamp
AssertionError: non-negative timestamp expected

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: C:/Users/Administrator/Desktop/翻译片段/真千金第三十九集.mp4,
输出结果保存到文件夹: C:/Users/Administrator/Desktop/翻译片段/翻译输出/真千金第三十九集-mp4,
临时文件夹: D:/win-pyvideotrans-v4.08/tmp/34156/d0e5bfc3a3
未选 清理已存在
已启用CUDA加速
未选 降噪
已选 识别说话人,最大说话人数量不限制
语音识别:faster-whisper(内置), model_name: large-v3, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:简体中文,目标语言:英语, 已选 发送完整字幕
配音渠道:Qwen3-TTS(内置), 角色:clone, 配音语言:英语, 未选 二次语音识别
音量:+100%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入硬字幕
已选 仅输出mp4
代理地址:


=
system:Windows-10-10.0.19045-SP0
version:v4.08
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v4.08

3 Replies

该错误是 faster-whisper 在格式化字幕时间轴时触发的内部断言,常见原因是某段音频切片的时间戳出现负值。可能与音频流本身异常、VAD 预分割参数设置、或 large-v3 模型在显存不稳时计算异常有关。

请按以下顺序尝试:

  1. 关闭 VAD 预分割:进入 菜单 → 工具 → 高级选项 → 语音识别参数,取消勾选「Whisper预分割音频?」。若仍失败,尝试将「最长语音持续(秒)」设为 10、「最短语音持续(毫秒)」设为 1000
  2. 更换较小模型测试:在语音识别渠道模型选择中改为 smallmedium,排除 large-v3 显存不足导致的隐性计算错误。
  3. 检查源视频/音频完整性:确认该视频能否用播放器正常播放,并使用格式工厂等工具将原视频转为标准 H.264 / AAC 的 MP4 后重试。
  4. 检查模型文件是否损坏:删除 models/models--Systran--faster-whisper-large-v3 文件夹,重新下载模型。
  5. 降低识别资源占用:高级选项中把「计算数据类型」改为 int8,将「识别准确度beam_size」和「best_of」均设为 1

若以上步骤均无效,请提供 logs/ 目录下当天日志文件底部约30行错误信息,以及报错视频的名称和时长,以便进一步定位。

关闭预分割可行,但是分割的句子断句很随机,有什么解决办法吗

关闭预分割后断句随机,是因为音频未做VAD切片,直接由Whisper对整段长音频自行断句,导致句子边界不稳定。

建议重新启用「Whisper预分割音频」,同时配合正确的参数设置,既可避免负时间戳报错,也能让断句更合理:

  1. 菜单 → 工具 → 高级选项 → 语音识别参数

    • 勾选「Whisper预分割音频?」
    • 「最长语音持续(秒)」设为 10
    • 「最短语音持续(毫秒)」设为 3000
    • 「静音分割持续毫秒」可设为 500~1000
    • 勾选「合并过短字幕到邻近」
    • 「语音阈值」适当提高(如 0.5~0.7),「非语音阈值」适当降低(如 0.1~0.3),减少静音误分割
  2. 若仍出现 non-negative timestamp,可尝试将「最长语音持续(秒)」调小,或先切换为 medium 模型验证是否与 large-v3 显存占用有关。

如果不希望使用预分割,也可以尝试「LLM重新断句」:在主界面“断句方式”选择 LLM重新断句,并在“菜单 → 工具 → 高级选项 → 通用设置”中配置 DeepSeek 或 OpenAI 渠道。但注意:配音角色为 clone 时,不建议启用 LLM重新断句,因为它会重新划分时间轴,可能导致截取的参考音频错位。

此外,可以尝试切换其他识别渠道(如 openai-whisper(内置))观察断句是否更符合预期。

请查阅相关文档:

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