#7680 list index out of range:Traceback (most recent call last): File

2409**1684 Posted at: 1 hour ago

list index out of range:Traceback (most recent call last):
File "videotrans\process\stt_openai.py", line 97, in openai_whisper
File "videotrans\process\_stt_utils.py", line 290, in _resegment
IndexError: list index out of range

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 70, in run
File "videotrans\task\_stage_recogn.py", line 63, in recogn
File "videotrans\recognition\__init__.py", line 121, in run
File "videotrans\recognition\_base.py", line 99, in run
File "videotrans\recognition\_whisper.py", line 39, in _exec
File "videotrans\recognition\_whisper.py", line 87, in _openai
File "videotrans\configure\base.py", line 264, in _new_process
videotrans.configure.excepts.VideoTransError: list index out of range:Traceback (most recent call last):
File "videotrans\process\stt_openai.py", line 97, in openai_whisper
File "videotrans\process\_stt_utils.py", line 290, in _resegment
IndexError: list index out of range

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: D:/zimu/shuchu/VID_20161003_163531.mp4,
输出结果保存到文件夹: D:/zimu/shuchu/_video_out/VID_20161003_163531-mp4,
临时文件夹: D:/zimu/win-pyvideotrans-v4.14/tmp/30100/3e78b33e66
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:openai-whisper(内置), large-v3-turbo, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:微软(免费),原始语言:简体中文,目标语言:英语, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
video_duration_ms=4708


=
system:Windows-10-10.0.19045-SP0
version:v4.14
frozen:True
language:zh_CN
root_dir:D:/zimu/win-pyvideotrans-v4.14

1 Replies

#1 DeepSeek reply at 1 hour ago

list index out of range 出现在 _resegment(重断句)环节,通常是语音识别结果为空或异常导致后续重断句算法取不到数据。

结合你的配置,最可疑的两点是:视频时长仅 4708ms(约4.7秒)过短,以及发音语言为简体中文但未指定合适的识别模型。

请按以下顺序排查:

  1. 确认视频有有效人声:该视频仅 4.7 秒,若开头/结尾几乎全是静音或背景音,ASR 可能返回空结果,进而触发重断句越界。

    先用播放器确认视频确实有人说话。

  2. 更换语音识别渠道测试:openai-whisper 在极短音频下容易返回空片段。

    中文视频建议改用 Qwen-ASR(内置) 或 FunASR(内置),或暂时用 faster-whisper(内置) + large-v3 重试。

  3. 调整断句参数:进入 菜单 → 工具/选项 → 高级选项 → 语音识别参数,把 最长语音持续(秒) 调大(如 8~10)、最短语音持续(毫秒) 调小(如 1000),避免对短音频产生冲突性切分(注意最长值×1000 必须大于最短值)。

  4. 升级版本:v4.14 日志明确提到「优化 语音/字幕/画面 对齐算法」,但你当前正是 v4.14,仍出现该报错,可确认补丁包是否完整覆盖(尤其 videotrans 文件夹),若仅覆盖了 sp.exe 可能残留旧代码。

  5. 换一个稍长的视频测试:若长视频正常、仅此短片段报错,基本可判定为超短音频触发的边界问题,可通过叠加或先用工具对原视频补一段静音来规避。

请查阅相关文档:

若以上调整后仍报错,请提供软件安装目录 logs/ 文件夹中最新日志的完整报错段(约30行)。

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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

Related resource