#7461 配音阶段出错 [Edge-TTS(免费)] The srt subtitles were not read. The file may be empty or the format does not conform to the SRT s

117.182**1 Posted at: 1 hour ago

配音阶段出错 [Edge-TTS(免费)] The srt subtitles were not read. The file may be empty or the format does not conform to the SRT specification
:srtfile='G:/0.1 剪辑和样片/电力信息安全与攻防技术/原片/[3.5.3]数据类型白名单_Subtitle_Export/[3.5.3]数据类型白名单.srt'
content=''
Traceback (most recent call last):

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

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

File "videotrans\task\dubbing.py", line 56, in dubbing

File "videotrans\task\dubbing.py", line 175, in _tts

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='G:/0.1 剪辑和样片/电力信息安全与攻防技术/原片/[3.5.3]数据类型白名单_Subtitle_Export/[3.5.3]数据类型白名单.srt'
content=''
[DubbingSrt]语音合成: self.out_ext='wav',self.is_multi_role=False
[TaskCfgTTS]
原始输入文件名: G:/0.1 剪辑和样片/电力信息安全与攻防技术/原片/[3.5.3]数据类型白名单_Subtitle_Export/[3.5.3]数据类型白名单.srt,
输出结果保存到文件夹: G:/0.1 剪辑和样片/电力信息安全与攻防技术/原片/[3.5.3]数据类型白名单_Subtitle_Export,
临时文件夹: D:/win-pyvideotrans-v4.12-0913/tmp/16672/0a82b5ba1d
已启用CUDA加速
配音渠道:Edge-TTS(免费), 角色:WilliamMultilingual(Male/AU), 配音语言:en
音量:+0%, 语速:+2%, 已选 音频加速


=
system:Windows-10-10.0.19045-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:D:/win-pyvideotrans-v4.12-0913

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因:软件无法读取该 SRT 字幕文件,content='' 说明文件内容为空或格式不符合 SRT 规范,导致配音阶段无字幕可处理。

可能原因与解决办法:

  1. 文件路径含特殊符号:路径中包含 []空格、中文等多重特殊字符,极易导致解析异常。请将 SRT 文件及所在目录改为纯英文数字下划线的简单路径(如 G:/video/001.srt)后重试。
  2. SRT 文件内容为空:确认该 .srt 文件用记事本打开后是否有实际字幕内容。若为空,需重新生成或导入有效字幕。
  3. SRT 格式不规范:SRT 必须严格符合以下格式(序号、时间轴、文本各占一行,时间轴用 --> 连接,且为英文半角符号):

    1
    00:00:01,000 --> 00:00:03,000
    字幕文本内容
    
    2
    00:00:04,000 --> 00:00:06,000
    下一句字幕

    若格式有误(如缺序号、时间轴用中文冒号、缺少空行分隔等),软件会判定不合规而报错。可用支持 SRT 的编辑器(如 Subtitle Edit)重新另存为规范 SRT。

  4. 文件编码问题:建议将 SRT 另存为 UTF-8 编码,避免乱码导致解析失败。

建议优先执行第 1 条(简化路径)并核对该 SRT 内容是否为空。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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

Related resource