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

118.92* 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='C:/Users/zheng/Downloads/_video_out/eco-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='C:/Users/zheng/Downloads/_video_out/eco-mp4/zh-cn.srt'
content=''

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: C:/Users/zheng/Downloads/eco.mp4,
输出结果保存到文件夹: C:/Users/zheng/Downloads/_video_out/eco-mp4,
临时文件夹: D:/迅雷下载/win-pyvideotrans-v4.08/tmp/6968/09796d8e15
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), model_name: tiny, 发音语言: 英语, 断句方式:默认断句
翻译渠道:微软(免费),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
代理地址:


=
system:Windows-10-10.0.26200-SP0
version:v4.08
frozen:True
language:zh
root_dir:D:/迅雷下载/win-pyvideotrans-v4.08

1 Replies

这是目标字幕文件 zh-cn.srt 为空导致的。content='' 表示软件在最终合成时读到的 C:/Users/zheng/Downloads/_video_out/eco-mp4/zh-cn.srt 是空文件。问题不是出在“合成”这一步,而是前面的字幕翻译没有写出有效内容,或者已有字幕被勾选的“清理已生成”清空了。

处理步骤:

  1. 先打开 C:/Users/zheng/Downloads/_video_out/eco-mp4/zh-cn.srt,确认它是否确实为空。
  2. 如果这个文件是空的,说明“微软(免费)翻译 + 发送完整字幕”组合可能没有正确返回翻译结果。

    • 建议取消勾选“发送完整字幕”再重试;
    • 或改用 Google 翻译、DeepSeek、OpenAI 等支持完整字幕上下文的渠道。
  3. 如果你是想使用本地已有的 SRT 字幕,则一定不要勾选“清理已生成”,否则已有字幕会被清空。
  4. 重新执行后,观察日志中“字幕翻译”阶段是否成功;如果仍然生成空文件,请打开软件目录 logs/ 下最新的日志文件,复制底部约 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