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

2408:824e* Posted at: 9 hours 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/Administrator/Desktop/翻译/中文第八集-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='C:/Users/Administrator/Desktop/翻译/中文第八集-mp4/en.srt'
content=''

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


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

1 Replies

问题核心原因:最终合成阶段需要读取翻译后的 en.srt,但该文件为空,导致硬字幕嵌入失败。这通常是因为“字幕翻译”步骤没有生成有效的英文字幕,或者源语言字幕(zh-cn.srt)本身就是空的。

请按下述步骤排查:

  1. 打开输出目录 C:/Users/Administrator/Desktop/翻译/中文第八集-mp4/,检查 zh-cn.srt 是否生成且非空。

    • 如果 zh-cn.srt 为空或不存在:说明语音识别环节没有识别出有效人声。请确认视频中确实有清晰的说话声,且“发音语言”选择正确;可换用 faster-whisper(内置) large-v3 再试,或先使用左侧“语音转录”功能单独验证。
  2. 如果 zh-cn.srt 正常,但 en.srt 为空:问题出在翻译渠道。

    • 你当前选择了 Google 翻译,但“网络代理”为空。Google 翻译在中国大陆无法直接访问,翻译失败时可能生成空字幕文件。
    • 先改用“微软翻译”(无需代理)重试。
    • 或在国内网络环境下,在主界面“网络代理”中填写可用的代理地址,格式如 http://127.0.0.1:7890
  3. 清理异常残留:删除整个输出文件夹 C:/Users/Administrator/Desktop/翻译/中文第八集-mp4,然后重新开始翻译,避免旧的空 en.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