#4917 为什么配音完的视频,声音要比字幕慢一些

2409:8a55* Posted at: 11 hours ago

为什么配音完的视频,声音要比字幕慢一些

18 Replies

这是由于配音时长超过原始语音时长,导致配音滞后于字幕。翻译后句子音节数变化,配音所需时间自然延长,因此声音落后于字幕是常见现象。

解决方法(按推荐顺序尝试):

  1. 启用“音频加速”:在主界面勾选“音频加速”,软件会自动加速配音以匹配原字幕时长。
  2. 调整“配音语速”:在“设置更多参数”中将“配音语速”设为正数(如 10~30),整体加快配音速度。
  3. 启用“视频慢速”:若加速后效果仍不佳,可同时勾选“视频慢速”,让视频片段放慢以等待配音。(注意会增大文件体积)
  4. 移除配音前后静音:在“菜单→工具→高级选项→字幕配音调整”中勾选“移除配音前后静音缓冲”,缩短配音占用的实际时长。
  5. 选中“二次识别”:若嵌入了单字幕,在主界面勾选“二次识别”,让软件对配音音频再次转录生成精确对齐的字幕。

请查阅相关文档:

[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\e7881c8a77020c078d864ce91c018fee032199952725e3c0d8c8f0b1eb460009\sk


.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts
[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\d1b09ee3eceb6df667fa59aec6ff69c8369bafa0c2c6be2e06feb3dd3b5649db\sk
.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts
[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\78654ec39dbbc8c8a87c912a8a95e14447f8388766ce399d995dedc7e771e002\sk
.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts
[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\d683dc3f3386adf88478cbe1211bac4032445442bb93d691597e83dbb6072a62\sk
.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts
[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\2407c6ed9cf9ceed3c791ce309e9fda6593b6d001c89684f249e9ed77ddf7402\sk
.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts
[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\6462d355748f6b2ab4363360f8b9122e3a1c9c8bb3ee9a6fc270b8bd5ff75c94\sk
.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts
[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\43bc1153f555b0b0a46d81a94397880505c05ba07d7eaee15adfc4cb42102350\sk
.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts
[DEBUG] 视频定格应延长60499ms,实际向上取整秒延长60.499s,操作成功。
[DEBUG] 原始hw_type='h264_nvenc'
[DEBUG] 整理后hw_type='nvenc'
[DEBUG] [尝试硬件编解码执行命令]
-y -progress compose1780489267.0523465.txt -i novoice.mp4 -i will_embed.m4a -filter_complex [0:v]subtitles=filename='shuang.ass'[v_out] -map [v_out] -map 1:a -c:v h264_nvenc -c:a copy -cq 23 -preset p4 -movflags +faststart -t 2727.533000 laste_target.mp4

[DEBUG] result={'visible': True, 'value': 'C:\Users\new\AppData\Local\Temp\gradio\5c07122ad48c44cfaa9b4b32e439e78c9872def582822f52068cd48f1b3a99a8\sk


.wav', '__type__': 'update'}
[INFO] Starting call to 'videotrans.tts._grsk
._send', this is the 1st time calling it.
[DEBUG] TTS-name=indextts

日志显示配音时使用了 Index-TTS 渠道,最终软件为匹配配音时长将视频延长了 60.5 秒。这说明配音总时长远远超过了原始语音,即使开启视频慢速也无法弥补近一分钟的差异,因此声音滞后于字幕是必然结果。

根本原因:Index-TTS 合成的配音速度过慢,每句话的时长远大于原始语音,导致整个配音音频很长。

建议调整方案

  1. 降低最短语音时长:在“菜单→工具→高级选项→语音识别参数”中将“最短持续时间/毫秒”设为 3000,将“最长语音持续时间秒”设为 10,避免产生过短或过长的字幕,减少因长句导致的配音时长暴增。
  2. 启用音频加速:在主界面勾选“音频加速”,强制加速配音以匹配原字幕时长。高级选项中的“音频加速最大倍数”可设为 200~300(默认 100)。
  3. 更换 TTS 渠道:Index-TTS 对长句合成速度偏慢,可尝试改用 Edge-TTS(免费且快速)或 OmniVoice-TTS(短参考音频下表现更好)。
  4. 精简译文:在单视频交互模式下,可在翻译后编辑字幕,手动缩短过长译文(如将“我一生都在研究宇宙”改为“Cosmology is my life's work”)。

如果以上调整仍不满意,建议在“设置更多参数”中不勾选“视频慢速”,仅靠音频加速处理,避免生成巨大的慢放视频文件。

请查阅相关文档:

我发现了问题,最开始STT转出来的英文初始字幕的时间轴是没问题的,但当翻译过后,生成了中文字幕,会发现有些中文字幕的时间轴的时候跟英文字幕匹配不上,比如:

155
00:07:03,001 --> 00:08:06,001
就在你的大纲视图里。

155
00:07:06,000 --> 00:07:09,000
in your Outliner.

这是翻译阶段导致的时间轴错乱,常见原因如下:原始英文字幕的多行间空行、格式异常(如多余空格、BOM头)被翻译渠道误处理,或 AI 翻译时返回了不标准的时间轴格式(例如误修改了 SRT 时间戳部分)。解决方案:务必勾选“清理已生成”:在主界面左上角勾选“清理已生成”复选框,清除所有历史缓存,确保重新进行完整转录和翻译。切换到传统翻译渠道:将翻译渠道从 AI 模型(如 DeepSeek/GPT)暂时切换为“微软翻译(免费)”或“Google翻译”,这两种渠道仅处理文本,不会触碰时间轴。如果问题消失,说明是 AI 翻译渠道的 prompt 或返回格式异常。检查原始字幕格式:在语音识别完成后,点击弹出的编辑窗口,检查是否有异常的时间轴(如数值超过 99:59:59 或格式缺少逗号)。若发现异常,手动修改 STT 参数(如模型设为 large-v3 或开启降噪)后重新识别。取消“发送完整字幕”:在 AI 翻译设置中取消勾选“发送完整字幕”,改为按行翻译(分批发送纯文本),避免 AI 接触到时间轴内容。调整后重新处理,如果问题依然存在,请提供详细的日志(logs/ 文件夹下最新日志文件底部 30 行),以便进一步定位是否是某些渠道特有的 bug。请查阅相关文档:翻译结果有空白行或输出了提示词为什么识别出的字幕长短不一乱七八糟

AI 翻译渠道的 prompt在哪里可以看到

AI翻译渠道的prompt文件位于软件安装目录下的 videotrans/prompts/ 文件夹内。具体路径及文件说明:videotrans/prompts/srt/:存放开启“发送完整字幕”时发给AI的提示词模板(文件名对应不同渠道,如 chatgpt.txtdeepseek.txt)。videotrans/prompts/text/:存放未开启“发送完整字幕”(按行翻译)时的提示词模板。如需自定义,直接修改对应txt文件即可,修改后重启软件生效。请查阅相关文档:修改 AI翻译提示词prompt

[DEBUG] LLM重新断句:self.ainame='deepseek',model_name='deepseek-v4-flash',api_url='https://sk


.com/v1/'
[INFO] Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
[DEBUG] 新进程执行结束结束timeout=2
[INFO] Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
[INFO] Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
[DEBUG] LLM重新断句完成,用时:238.39227628707886s
[ERROR] 重新断句失败,已恢复原样

Logging error

Traceback (most recent call last):
File "logging\__init__.py", line 1103, in emit
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
File "videotrans\task\job.py", line 35, in run
File "videotrans\task\job.py", line 100, in process_task
File "videotrans\task\trans_create.py", line 396, in recogn
File "logging\__init__.py", line 1506, in error
File "logging\__init__.py", line 1624, in _log
File "logging\__init__.py", line 1634, in handle
File "logging\__init__.py", line 1696, in callHandlers
File "logging\__init__.py", line 968, in handle
File "logging\__init__.py", line 1108, in emit
Message: '重新断句失败,已恢复原样'
Arguments: ()

[DEBUG] 开始字幕翻译: 渠道4
[INFO] Starting call to 'videotsk


._openaicosk
._item_task', this is the 1st time calling it.
[DEBUG] 字幕翻译:[self.ainame='deepseek',self.model_name='deepseek-v4-flash',self.api_url='https://sk
.com/v1/',sk
_effort=None]
[DEBUG] 开始语音识别:渠道0
[DEBUG] Before VAD silero,_min_speech=300ms,_max_speech=10000ms,_min_silence=100ms

根据日志,LLM 重新断句失败的原因是 API URL 配置错误:你填写的是 https://sk.com/v1/,这显然不是有效的 DeepSeek API 地址。正确地址应为 https://api.deepseek.com/v1/(或官方指定的其他镜像)。请按以下步骤排查:1. 确认 API URL 和模型名称:进入菜单 → “翻译设置” → “DeepSeek”,将 API 地址修正为 https://api.deepseek.com/v1/(注意末尾的 /v1)。模型名称填写正确的模型名(如 deepseek-chat,而非 deepseek-v4-flash,该名称并非官方公开模型)。2. 测试连接:修改后点击“测试”按钮确认连接成功。3. 暂时关闭 LLM 重新断句:如果不需要此功能,可在“菜单 → 工具 → 高级选项 → 通用设置”中将“LLM 重新断句所用 AI 渠道”设为空或关闭,仅使用默认断句。4. 清理已生成:重新执行前勾选主界面“清理已生成”,避免使用失败时的缓存。若问题仍存在,请在日志文件夹中提供最新完整日志。

[DEBUG] [新进程任务 结束:恢复标点],耗时2.8392608165740967s
[DEBUG] LLM重新断句:self.ainame='deepseek',model_name='deepseek-v4-flash',api_url='https://sk


.com/v1/'
[INFO] Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
[DEBUG] 新进程执行结束结束timeout=2
[INFO] Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
[INFO] Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
[DEBUG] LLM重新断句完成,用时:238.39227628707886s
[ERROR] 重新断句失败,已恢复原样

你仍然在使用错误的 API URL 和模型名称:

  • API 地址:https://sk.com/v1/ 是无效地址,应改为 https://api.deepseek.com/v1/
  • 模型名称:deepseek-v4-flash 不是官方公开模型,应改为 deepseek-chat(或 deepseek-v3 等官方列表中的名称)。

请按以下步骤修正:

  1. 打开菜单 → “翻译设置” → “DeepSeek”。
  2. API 地址 修改为 https://api.deepseek.com/v1/
  3. 模型名称 修改为 deepseek-chat
  4. 点击“测试”按钮确保连接成功。
  5. 返回主界面,勾选“清理已生成”后重新执行。

修正后如果再遇到失败,请提供最新的日志底部 30 行以便进一步分析。

[新进程任务 结束:恢复标点],耗时2.8392608165740967s
LLM重新断句:self.ainame='deepseek',model_name='deepseek-v4-flash',api_url='https://sk


.com/v1/'
Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
新进程执行结束结束timeout=2
Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
Starting call to 'videotsk
._openaicosk
.llm_segment.._send', this is the 1st time calling it.
LLM重新断句完成,用时:238.39227628707886s
重新断句失败,已恢复原样

日志显示你的 DeepSeek 配置仍然是错误的:

  • API URL:https://sk.com/v1/(应改为 https://api.deepseek.com/v1/
  • 模型名称:deepseek-v4-flash(应改为 deepseek-chat 等有效模型)

请严格按以下步骤操作:

  1. 菜单 → 翻译设置 → DeepSeek,将 API 地址 粘贴为 https://api.deepseek.com/v1/(注意末尾 /v1 不能少)。
  2. 模型名称 修改为 deepseek-chat
  3. 点击“测试”按钮确认返回成功。
  4. 返回主界面,勾选 清理已生成
  5. 重新执行任务。

修改后再看日志,问题应解决。若仍失败,请提供修改后的完整新日志。

没有API地址项

你遇到的问题是 DeepSeek 设置界面缺少“API 地址”字段,这可能是由于软件版本差异导致面板未显示该选项。按以下两种方案解决:

方案一:改用“兼容AI/本地模型”渠道

  1. 在主界面翻译渠道中选择 兼容AI/本地模型
  2. 进入菜单 → 翻译设置 → 本地大模型(或兼容 AI 设置)。
  3. 填写:

    • API 地址:https://api.deepseek.com/v1
    • 模型名称:deepseek-chat
    • API Key:你的 DeepSeek 密钥
  4. 返回主界面,勾选“清理已生成”后执行。

方案二:手动修改配置文件

  1. 关闭软件。
  2. 打开软件安装目录下的 params.json 文件(通常位于 videotrans/params.json)。
  3. 找到以下字段并修改:

    "deepseek_key": "你的 DeepSeek 密钥",
    "deepseek_api": "https://api.deepseek.com/v1",
    "deepseek_model": "deepseek-chat"
  4. 若不存在 deepseek_api 字段,请手动添加该行。
  5. 保存文件,重启软件。

修改后,DeepSeek 渠道即可正常使用。如果问题依然存在,尝试重新下载完整软件包(可能是旧版 missing 字段),或者直接使用方案一代理解决。

而且我用的deepseek的V4模型,也要使用"https://sk


.com/v1"这个地址吗

你的 DeepSeek API 地址 不应该https://sk.com/v1/。无论你使用 DeepSeek 的哪个模型(包括 V4),官方 API 地址都是:https://api.deepseek.com/v1/软件中若没有直接的“API 地址”输入框,是因为你的版本界面布局不同,并非不需要填写。请按以下步骤操作:菜单 → 翻译设置 → 翻译渠道设置 → 选择 DeepSeek。如果界面上没有出现 API URL 输入框,请检查是否有“服务地址”或“Base URL”之类的字段(不同版本显示名称可能不同),将其修改为:https://api.deepseek.com/v1关于模型名称:不要填写 deepseek-v4-flash(该名字不是公开官方模型名)。请填写官方支持的模型名,例如:deepseek-chat(通用对话模型,兼容所有翻译任务)。填写完以上两项后,务必点击“测试”按钮确认连接成功。修改完成后,返回主界面勾选“清理已生成”,再重新执行。如果仍找不到 API 地址设置项,建议改用“兼容AI/本地模型”渠道,在对应的设置界面中填写上述地址和模型名。

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: ko-fi.com/jianchang512

Related resource