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

2408:8234* Posted at: 11 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:/win-pyvideotrans-v4.08/4-5-1-mp4/en.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='D:/win-pyvideotrans-v4.08/4-5-1-mp4/en.srt'
content=''

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


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

1 Replies

这是由于目标语言字幕文件 en.srt 生成结果为空导致的,最终合成阶段读取字幕时找不到有效内容,因此报错。

根本原因在“字幕翻译”环节:您选择了 Google 翻译且未启用代理,或 Google 接口被限流/临时不可用,导致翻译接口返回了空白内容,生成的 en.srt 为空文件。

请依次尝试以下解决方案:

  1. 打开输出目录 D:/win-pyvideotrans-v4.08/4-5-1-mp4/,检查 en.srt 是否确实为空。若为空,说明翻译阶段未成功生成字幕。
  2. 在主界面勾选“清理已生成”,重新执行翻译任务,避免使用旧的空缓存文件。
  3. 删除翻译缓存目录 D:/win-pyvideotrans-v4.08/tmp/translate_cache/ 下的缓存文件,防止旧的空白翻译结果被复用。
  4. 切换翻译渠道:建议将“翻译渠道”从 Google(免费) 改为 Microsoft 翻译(免费),或配置可用的 AI 翻译渠道(如 DeepSeek、OpenAI)并勾选“发送完整字幕”。
  5. 若使用 Google 翻译,请确认主界面“网络代理”已正确填写可用的代理地址,例如 http://127.0.0.1:端口号

如果切换渠道并清理缓存后仍失败,请提供以下信息以便进一步定位:

  • 软件安装目录下 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