#5169 Exception: 字幕中不存在 time/startraw/start_time 任何有效时间戳形式

2401:e180* Posted at: 2 hours ago

:
Traceback (most recent call last):
File "videotrans\util\TestSTT.py", line 18, in run
File "videotrans\recognition\__init__.py", line 190, in run
File "videotrans\recognition\_base.py", line 94, in run
File "videotrans\recognition\_recognapi.py", line 84, in _exec
File "videotrans\util\help_srt.py", line 259, in get_srt_from_list
Exception: 字幕中不存在 time/startraw/start_time 任何有效时间戳形式


=
system:Windows-10-10.0.26200-SP0
version:v4.02
frozen:True
language:zh
root_dir:C:/Users/stanl/Desktop/win-pyvideotrans-v4.02-0612

1 Replies

该错误出现在使用“自定义语音识别API”渠道时,原因是您的API返回的字幕结果中缺少必要的时间戳字段(如 timestartrawstart_time)。

解决办法:

  1. 检查自定义API返回的JSON数据结构,确保每条字幕包含符合SRT格式的time字段(如 "00:00:01,000 --> 00:00:03,000"),或包含startraw/start_time(数值型毫秒)及endraw/end_time
  2. 确认API地址填写正确,且服务端正常返回数据。
  3. 如果API返回格式无误,请检查返回数据是否被额外包装,导致软件无法解析。

请查阅相关文档:

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