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

113.83**1 Posted at: 2 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:/视频制作/i/_video_out/I Built a Drone With Only One Motor-(1080p30)-mp4/zh-cn.srt'
content=''
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 165, in run
File "videotrans\task\_stage_assemble.py", line 26, in assembling
File "videotrans\task\_stage_assemble.py", line 122, in _join_video_audio_srt
File "videotrans\task\_stage_subtitle.py", line 30, in _process_subtitles
File "videotrans\util\_srt_parse.py", line 188, 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:/视频制作/i/_video_out/I Built a Drone With Only One Motor-(1080p30)-mp4/zh-cn.srt'
content=''

trk=[TransCreate]: uuid='0de60f80b2', proxy_str='http://127.0.0.1:10808', cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: D:/视频制作/i/I Built a Drone With Only One Motor-(1080p30).mp4,
输出结果保存到文件夹: D:/视频制作/i/_video_out/I Built a Drone With Only One Motor-(1080p30)-mp4,
临时文件夹: D:/Ruanjian-m/win-pyvideotrans-v4.08/tmp/38556/0de60f80b2
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), distil-large-v3.5, 发音语言: 英语,
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:F5-TTS(内置), 角色:clone, 配音语言:简体中文, 已选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: 嵌入软字幕
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
代理地址: http://127.0.0.1:10808, precent=95, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='D:/Ruanjian-m/win-pyvideotrans-v4.08/tmp/38556/0de60f80b2/vocal.wav', should_recogn2=True, do_diarize=True
video_duration_ms=563766


=
system:Windows-10-10.0.26300-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:D:/Ruanjian-m/win-pyvideotrans-v4.08

1 Replies

#1 DeepSeek reply at 2 hours ago

最终合成阶段读取目标语言字幕 zh-cn.srt 时,文件内容为空(content=''),说明翻译或二次识别环节没有产出有效的目标语言字幕,最后嵌入软字幕时直接抛出异常,因此这不是 FFmpeg 或路径编码问题。

从日志可定位到几个高风险点,请按顺序排查:

1. 先看 zh-cn.srt 到底是不是空的
打开 D:/视频制作/i/_video_out/I Built a Drone With Only One Motor-(1080p30)-mp4/zh-cn.srt:

  • 若文件里全是空白行/只有序号和时间码没有文字 → 是 AI 翻译时把相邻字幕合并了,导致后续行错位成空。处理:

    1. 菜单 → 工具/选项 → 高级选项 → 字幕翻译,把 AI翻译渠道每批字幕行数 改为 1(可再试 10/20 折中);
    2. 删除 软件目录/tmp/translate_cache/ 下的翻译缓存;
    3. 主界面勾选 清理已生成 后重跑。
  • 若文件原本有内容,但被二次识别覆盖成空(你已勾选 二次语音识别 + F5-TTS clone + 嵌入软字幕)→ 说明对配音音频的二次识别没有拿到有效语音(配音切片异常或全静音)。处理:先取消勾选 二次语音识别 重跑一次,确认输出文件夹内是否生成了正常的 target.wav;若配音本身就是空的,问题在 F5-TTS clone 参考音频(原视频人声片段可能过短/带噪),请把高级选项 最短语音持续(毫秒) 设为 >=3000、最长语音持续(秒) 设为 5~10 后再试。

2. 目录名与文件名不规范(极易连带出错)
I Built a Drone With Only One Motor-(1080p30)-mp4 含空格、括号、连字符,上级目录还有中文 D:/视频制作。请把视频移到浅层纯英文目录(如 D:/videos/video1.mp4)后重跑。

3. 版本与安装目录不一致,存在缓存残留
日志 version:v4.16 但 root_dir: D:/Ruanjian-m/win-pyvideotrans-v4.08,说明是在旧版本目录上覆盖升级。请在 _internal 和 videotrans 文件夹内搜索 __pycache__,全部删除后重新完整覆盖最新补丁包(完整包 2.6GB+,补丁包仅覆盖会缺运行时)。

4. 兜底方案
若不需要字幕,可先把 字幕嵌入类型 改为 不嵌入字幕,验证配音/画面流程是否正常,以区分是「翻译产出为空」还是「合成阶段问题」。

若以上操作后仍报同样错误,请提供 软件目录/logs/ 下当日日志文件末尾约 30 行,并附上 zh-cn.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