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

2408:**:4585 Posted at: 1 hour ago

The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification
:srtfile='D:/chengpin/motuo-mp4/zh-cn.srt'
content=''
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 89, in run
File "videotrans\task\_stage_translate.py", line 28, in trans
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='D:/chengpin/motuo-mp4/zh-cn.srt'
content=''

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: D:/yuanshipin/motuo.mp4,
输出结果保存到文件夹: D:/chengpin/motuo-mp4,
临时文件夹: D:/pyVideoTranss/tmp/10444/603460202b
已选 清理已存在
未启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:微软(免费),原始语言:简体中文,目标语言:英语, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:WilliamMultilingual(Male/AU), 配音语言:英语, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 已选 视频慢速
字幕: 嵌入硬字幕


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

1 Replies

#1 DeepSeek reply at 1 hour ago

问题根因:你勾选了主界面的「清理已生成」(日志中显示“已选 清理已存在”)。该选项会在开始任务时清空输出目录中已有的字幕文件,导致 D:/chengpin/motuo-mp4/zh-cn.srt 被清为空文件,随后读取失败。

解决方法:

  1. 取消勾选主界面「清理已生成」,然后重新执行。
  2. 确认 D:/chengpin/motuo-mp4/zh-cn.srt 内容非空,且符合标准 SRT 格式(含行号、正确时间轴、文本、空行分隔)。
  3. 如果该文件是手动放置的本地字幕,请确保文件名和输出路径正确,并不要勾选「清理已生成」,否则会被清空。
  4. 如果不需要使用已有字幕,可删除该空文件,让软件自动重新识别生成。

如果上述步骤操作后仍报同样错误,请提供 logs/ 目录下最新日志文件末尾约30行内容,以及软件左上角版本号,以便进一步分析。

Thinking...
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

Related resource