#6206 合并阶段出错 The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification:sr

2602:2b5* Posted at: 10 hours ago

合并阶段出错 The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification
:srtfile='D:/media/_video_out/ml4t/CS7646 Lecture 00 Introduction [CiAUsfsRrek]-mp4/zh-cn.srt'
content=''
Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 196, in process_task

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='D:/media/_video_out/ml4t/CS7646 Lecture 00 Introduction [CiAUsfsRrek]-mp4/zh-cn.srt'
content=''
cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 批量翻译模式
原始输入文件名: D:/media/ml4t/CS7646 Lecture 00 Introduction [CiAUsfsRrek].mp4,
输出结果保存到文件夹: D:/media/_video_out/ml4t/CS7646 Lecture 00 Introduction [CiAUsfsRrek]-mp4,
临时文件夹: D:/tool/win-pyvideotrans-v4.08/tmp/24116/c080c6724a
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕(双) 目标语言在上双字幕
代理地址:http://127.0.0.1:7897


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

1 Replies

核心原因:zh-cn.srt 字幕文件内容为空(content=''),所以不是“合并阶段本身”出错,而是“翻译阶段没有成功生成字幕内容”,最终带着空字幕文件进入合并导致报错。

解决方案:

  1. 打开 D:/media/_video_out/ml4t/CS7646 Lecture 00 Introduction [CiAUsfsRrek]-mp4/zh-cn.srt,确认是否为 0KB。如果是,说明翻译环节没有写入有效字幕内容。
  2. 查看最新日志:打开 D:/tool/win-pyvideotrans-v4.08/logs/ 下最新日期的 .log 文件,重点看翻译步骤是否报错(Google 翻译网络失败、代理失败、限流等)。你当前设置的是 Google 翻译,但使用代理 http://127.0.0.1:7897,如果代理不稳定,很可能翻译请求失败。
  3. 先做以下调整后重试:

    • 取消勾选“发送完整字幕”:该选项主要用于 AI 翻译渠道(如 DeepSeek、OpenAI),传统翻译渠道使用它不一定合适,可能造成返回格式异常。
    • 取消勾选“清理已生成”:否则每次重试都会先清空输出目录,可能把已生成文件删掉或覆盖成空文件。
    • 如果仍失败,把翻译渠道从 Google 换成“Microsoft 翻译”再试,排除 Google 网络/代理问题。
  4. 如果确认是缓存导致翻译结果异常,可删除 D:/tool/win-pyvideotrans-v4.08/tmp/translate_cache/ 目录下的缓存文件后重试。
  5. 当前视频文件名较长且包含空格和方括号 [],这类路径可能增加后续 ffmpeg 处理风险。建议将视频改名为 01.mp4 这类简单英文名,放在浅层目录如 D:/media/ml4t/01.mp4 再试。

如果按上述步骤处理后仍然报同样错误,请提供 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