#6376 The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification:srtfile='

66.90.**8 Posted at: 22 hours ago

The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification
:srtfile='C:/Users/86181/Desktop/音频/0805/0805_no_sub-mp4/en.srt'
content=''
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 92, in run
File "videotrans\task\_stage_dubbing.py", line 23, in dubbing
File "videotrans\task\_stage_dubbing.py", line 49, in _tts
File "videotrans\util\_srt_parse.py", line 187, in get_subtitle_from_srt
RuntimeError: The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification
:srtfile='C:/Users/86181/Desktop/音频/0805/0805_no_sub-mp4/en.srt'
content=''

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: C:/Users/86181/Desktop/音频/0805/0805_no_sub.mp4,
输出结果保存到文件夹: C:/Users/86181/Desktop/音频/0805/0805_no_sub-mp4,
临时文件夹: F:/Jiani_tools/win-pyvideotrans-v4.07/tmp/30408/19c312de8a
已选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
发音语言和目标语言相同,不翻译字幕
配音渠道:Index-TTS(本地API), 角色:1.wav, 配音语言:英语, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 已选 视频慢速
字幕: 嵌入软字幕(双) 目标语言在上双字幕
代理地址:http://127.0.0.1:7890


=
system:Windows-10-10.0.19045-SP0
version:v4.07
frozen:True
language:zh
root_dir:F:/Jiani_tools/win-pyvideotrans-v4.07

1 Replies

该报错发生在配音阶段(Index-TTS),直接原因是字幕文件 C:/Users/86181/Desktop/音频/0805/0805_no_sub-mp4/en.srt 存在但内容为空(content='')。

因你配置中“发音语言=目标语言=英语”,软件跳过了字幕翻译,配音阶段会直接读取语音识别生成的字幕文件作为配音文本来源。因此该文件为空,说明语音识别(faster-whisper large-v3-turbo)没有产出任何有效字幕

处理步骤:

  1. 打开输出目录 C:/Users/86181/Desktop/音频/0805/0805_no_sub-mp4/,确认 en.srt 是否为空;同时用播放器播放原视频,确认视频内确实有清晰人声,且发音语言确实是英语(选错源语言也可能导致识别结果为空或乱码)。
  2. 先用左侧「语音转录」面板单独对该视频做一次转录测试,或把识别渠道/模型换成 openai-whisper + base/small 验证。若单独转录也为空,说明问题出在视频源、模型或 CUDA/显存,而不是视频翻译流水线。
  3. 升级软件到最新版 v4.08-0802(你当前为 v4.07,该报错在新版本中有已知修复)。源码部署的请重新拉取源码覆盖,Windows 绿色版请下载最新完整包或补丁包覆盖。
  4. 检查 models/ 目录下 large-v3-turbo 模型文件是否完整。模型下载不完整或损坏会导致识别静默失败。
  5. 本次任务勾选了「清理已生成」,会先删除输出目录里已有的字幕文件;若重新识别失败就会留下空字幕。排查阶段先取消勾选「清理已生成」。
  6. 输出路径包含中文「音频」,虽不一定是直接原因,但为排除底层 FFmpeg 对非英文路径的兼容问题,建议将视频移动到纯英文路径(如 D:/test/no_sub.mp4)再试一次。

若以上操作后仍失败,请提供 logs/ 目录下最新日志中语音识别(recogn/ASR)阶段的最后约 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