#6203 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, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:微软(免费),原始语言:简体中文,目标语言:英语, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入软字幕
代理地址:


=
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 为空导致的。该文件是“微软翻译”步骤的输出结果,content='' 表示翻译环节没有成功写入有效字幕内容,最终合成阶段读取空文件时报错。

解决办法:

  1. 查看翻译失败的具体原因:打开 D:/win-pyvideotrans-v4.08/logs/ 目录下最新的日志文件(按日期命名,如 20250622.log),查找“微软翻译”或“翻译”相关的错误信息。
  2. 删除无效输出文件:删除 D:/win-pyvideotrans-v4.08/4-5-1-mp4 文件夹(或至少删除其中的空 en.srt),然后重新运行任务。
  3. 降低限流风险:进入 菜单 → 工具 → 高级选项 → 字幕翻译调整,将“翻译后暂停秒”设置为 3~5,避免微软翻译因短时间频繁请求被限流返回空结果。
  4. 更换翻译渠道验证:如果仍失败,请将“翻译渠道”切换为 Google翻译DeepSeek 等其它渠道,以确认是否为微软渠道限流或网络问题。
  5. 检查代理设置:如启用了代理,请确认代理地址格式正确(如 http://127.0.0.1:7890);不需要代理时请清空代理文本框。

请查阅相关文档:

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