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

39.128* Posted at: 1 day ago

The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification
:srtfile='H:/shurou/www.98T.la@MomWantsToBreed.23.06.30.jennifer.white.stop.wasting.your.seed.4k.2160p-mp4/zh-cn.srt'
content=''
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 148, in run
File "videotrans\task\_stage_assemble.py", line 26, in assembling
File "videotrans\task\_stage_assemble.py", line 153, in _join_video_audio_srt
File "videotrans\task\_stage_subtitle.py", line 30, in _process_subtitles
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='H:/shurou/www.98T.la@MomWantsToBreed.23.06.30.jennifer.white.stop.wasting.your.seed.4k.2160p-mp4/zh-cn.srt'
content=''

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: H:/www.98T.la@MomWantsToBreed.23.06.30.jennifer.white.stop.wasting.your.seed.4k.2160p.mp4,
输出结果保存到文件夹: H:/shurou/www.98T.la@MomWantsToBreed.23.06.30.jennifer.white.stop.wasting.your.seed.4k.2160p-mp4,
临时文件夹: H:/AIfanyi/tmp/43104/611d9c4a24
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:Hy-MT2-1.8B(内置),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
已选 仅输出mp4
代理地址:http://127.0.0.1:17024


=
system:Windows-10-10.0.26200-SP0
version:v4.08
frozen:True
language:zh
root_dir:H:/AIfanyi

1 Replies

这个报错的直接原因是目标字幕文件 zh-cn.srt 内容为空,导致硬字幕合成阶段读取不到有效字幕。也就是翻译环节没有得到有效的翻译结果,或语音识别环节没有生成有效的源字幕。

排查与解决步骤

  1. 判断是“识别为空”还是“翻译为空”
    打开输出目录 H:/shurou/www.98T.la@MomWantsToBreed.23.06.30.jennifer.white.stop.wasting.your.seed.4k.2160p-mp4,查看 en.srt 是否存在且有内容。

    • 如果 en.srt 为空或不存在,说明语音识别没有识别到有效人声。请更换语音识别渠道/模型(如 openai-whisper),或在“设置更多参数”中勾选“降噪”和“分离人声背景声”,并确认视频中有清晰人声。
    • 如果 en.srt 有内容,但 zh-cn.srt 为空,则是翻译环节失败。
  2. 临时切换翻译渠道验证
    将翻译渠道从 Hy-MT2-1.8B(内置) 改为“微软翻译”或“Google翻译”重新运行。如果能正常生成 zh-cn.srt,则问题大概率出在 Hy-MT2 本地模型上。
  3. 检查 Hy-MT2-1.8B 模型是否完整
    确认 软件目录/models/models--tencent--Hy-MT2-1.8B 文件夹内是否包含全部模型文件。
    若文件不完整,请手动下载:https://huggingface.co/tencent/Hy-MT2-1.8B/tree/main ,将所有文件放入该目录后重试。
  4. 暂时取消勾选“仅输出mp4”
    这样可以保留中间生成的 SRT 文件,方便你查看是哪一步产生了空文件。
  5. 建议使用简单英文路径
    当前视频路径中包含 @ 和超长文件名,可能引发其他兼容性问题。建议将视频移动到类似 D:/videos/ 的纯英文短路径后重试。
  6. 若问题依旧
    请提供软件安装目录下 logs/ 文件夹中最新的日志文件(底部约30行报错内容),以及软件左上角版本号(当前为 v4.08)。

请查阅相关文档:

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