#2944 软件可以直接按照我提供的srt字幕文件进行配音吗?

94.177* Posted at: 3 hours ago 👁16

配音到中途,配音会把时间轴的数字给配出来。

7 Replies

可以直接使用已有的SRT字幕文件进行配音。配音中途读出时间轴数字的问题,是由于SRT字幕文件格式不规范,导致软件错误地将时间轴标记识别为待配音文本。

解决方案:

  1. 检查并清理SRT文件:使用文本编辑器(如记事本)打开你的SRT字幕文件,检查每一段字幕的格式是否正确。标准SRT格式应为:

    序号
    开始时间 --> 结束时间
    字幕文本
    (空行)

    确保时间轴行(如 00:00:01,000 --> 00:00:04,000)下方紧跟的是纯字幕文本,没有混入其他数字或标记。删除所有不属于字幕内容的额外数字或字符。

  2. 在软件中正确加载SRT文件

    • 在软件主界面,点击“选择视频或音频文件”按钮。
    • 在弹出的文件选择器中,将文件类型过滤器切换为“字幕文件 (*.srt)”,然后选择你清理过的SRT文件。
    • 软件会识别这是一个字幕文件,并自动进入“配音”任务流程。你只需配置好“配音渠道”和“目标语言”即可开始。

预防措施:

  • 确保你的SRT文件来自可靠的生成工具或经过人工校对。
  • 如果SRT文件是从其他格式(如ASS、VTT)转换而来,请使用专业的字幕编辑软件(如Aegisub)或pyVideoTrans自带的“字幕格式转换”工具进行转换和检查。

请查阅相关文档:

配音识别到序号34之后的字幕,就会把时间轴的数字配出来,前34条字幕是正常的

这是由于SRT字幕文件从第35条开始格式错误,导致软件将时间轴行误识别为待配音文本。

解决方案:

  1. 检查并修复SRT文件:使用文本编辑器(如记事本)打开出错的SRT字幕文件。
  2. 定位错误行:直接跳转到序号34和35附近。检查第34条字幕的格式是否正确,格式应为:

    34
    00:01:23,456 --> 00:01:25,789
    这是第34条正常的字幕文本。
    

    注意时间轴行和字幕文本行之间不能有空行,且每条字幕结束后应有一个空行

  3. 修正格式:从第35条开始,确保其格式严格遵循上述规则。最常见的问题是时间轴行(如 35 00:01:25,790 --> 00:01:28,123)与字幕文本行之间多了一个空行,或者序号、时间轴、文本三行之间出现了多余的换行或空格。删除所有多余的空行,确保结构紧凑正确。
  4. 重新加载文件:保存修改后的SRT文件。在pyVideoTrans中,重新选择该字幕文件进行配音任务。

如果手动修正麻烦,可以使用pyVideoTrans菜单栏的“工具”->“字幕格式转换”功能,将你的SRT文件重新规范格式化一次。

请查阅相关文档:

确定字幕格式正确

如果确认SRT字幕文件格式完全正确,但配音仍会读出时间轴数字,问题可能出在软件读取字幕时,错误地将时间轴行解析为了文本内容。这通常与文件编码或软件内部处理特定格式的bug有关。解决方案:尝试转换字幕编码:使用文本编辑器(如Notepad++)打开SRT文件,点击“编码”菜单,将文件编码转换为“UTF-8 with BOM”或“UTF-8”(如果当前不是),然后保存。使用软件内置工具重新格式化:在pyVideoTrans菜单栏,点击“工具” -> “字幕格式转换”。选择你的SRT文件,输出格式也选择SRT,然后进行转换。这个操作会强制按照标准格式重新生成文件。使用转换后的新文件进行配音。检查高级设置中的“配音前处理字幕”:在软件主界面,点击“菜单” -> “工具” -> “高级选项”。在“通用设置”或“配音设置”中,检查是否有“配音前清理字幕”、“移除字幕序号”或类似选项。如果有,请勾选。如果没有,可以尝试在“自定义处理命令”中寻找相关设置。如果以上方法均无效,请提供软件安装目录下 logs/ 文件夹中最新日志文件的底部约30行报错信息,以便进一步分析。


Application started at 2026-01-27 23:16:45

[DEBUG] 返回缓存的编解码器 Windows-264: h264_nvenc
[DEBUG] 返回缓存的编解码器 Windows-265: hevc_nvenc
First searching GPU...
Found 1 GPUs, cost=2s
start workers...
NVIDIA_GPU_NUMS=1
process_max_gpu=0
multi_gpus=False
Concurrent task_nums=1
process_max=2
start 8 jobs
ended workers
进入执行字幕翻译阶段
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='en' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='en' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[DEBUG] 以普通文本行按行翻译:原始行数:29,翻译后行数:29
[DEBUG] [字幕翻译]渠道0,:共耗时:1s
[DEBUG] 核对翻译结果前->原始语言字幕行数:29,目标语言字幕行数:29
进入执行完成阶段
[DEBUG] 最终配置信息:self.cfg=TaskCfg(cache_folder='A:/BaiduNetdiskDownload/py/tmp/12296/8b01936e59', target_di
......
16\n00:00:30,300 --> 00:00:32,666\nYet the massive egg got stuck in her throat\n17\n00:00:32,666 --> 00:00:34,266\nMaking her eyes roll back in her head\n18\n00:00:34,400 --> 00:00:35,700\nAfter finishing her meager meal\n19\n00:00:35,833 --> 00:00:37,600\nThe serpent maiden caught sight of two young women\n20\n00:00:37,600 --> 00:00:38,666\nBathing in the river nearby\n21\n00:00:38,766 --> 00:00:40,933\nShe seized the chance and stole their clothes\n22\n00:00:40,933 --> 00:00:42,866\nThen made her way toward a nearby village\n23\n00:00:42,900 --> 00:00:45,633\nThe village was in the midst of celebrating the Water-Splashing Festival\n24\n00:00:45,833 --> 00:00:48,133\nSuddenly, a man began playing a long flute\n25\n00:00:48,133 --> 00:00:50,266\nTrying to charm a snake with his tune\n26\n00:00:50,400 --> 00:00:52,800\nThe serpent maiden reacted to the sound in an instant\n27\n00:00:52,833 --> 00:00:54,400\nHer body swaying uncontrollably to the melody\n28\n00:00:54,500 --> 00:00:56,733\nBut two lewd thugs spotted her right away\n29\n00:00:56,733 --> 00:00:58,600\nThey threw a red cloth over her head\n30\n00:00:58,600 --> 01:01,100\nAnd dragged her to a lavish villa in the wilderness\n31\n01:01,200 --> 01:02,933\nJust as the thugs were about to act\n32\n01:03,000 --> 01:05,200\nThe serpent maiden suddenly began to mutate\n33\n01:05,366 --> 01:07,200\nFilled with terror, the thugs tried to run\n34\n01:07,266 --> 01:09,033\nBut she would not give them a single chance\n35\n01:09,066 --> 01:11,266\nIn the end, she devoured every last one of them\n36\n01:11,333 --> 01:12,000\nAfter her feast\n37\n01:12,000 --> 01:14,233\nThe serpent maiden fell into a hibernation state\n38\n01:14,233 --> 01:15,733\nPreparing for her next hunt', novoice_mp4='A:/BaiduNetdiskDownload/py/tmp/12296/8b01936e59/novoice.mp4', noextname='未改37', shibie_audio=None, targetdir_mp4='A:/卡司1111/_video_out/未改37-mp4/未改37.mp4', instrument=None, vocal=None, back_audio='', background_music=None, app_mode='biaozhun', subtitle_type=1, volume='+0%', pitch='+0Hz', voice_rate='+50%', voice_role='', copysrt_rawvideo=False, clear_cache=False, translate_type=8, tts_type=2, recogn_type=0, model_name='large-v3-turbo', voice_autorate=False, video_autorate=True, cuda=True, name='A:/卡司1111/未改37.mp4', basename='未改37.mp4', ext='mp4', dirname='A:/卡司1111', shound_del_name=None, uuid='8b01936e59', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=0, only_out_mp4=False, fix_punc=False, recogn2pass=False)
[DEBUG] cmd=['A:/BaiduNetdiskDownload/py/ffmpeg/ffmpeg.exe', '-hide_banner', '-ignore_unknown', '-threads', '0', '-y', '-i', 'A:/卡司1111/未改37.mp4', '-vn', '-ac', '1', '-ar', '16000', '-c:a', 'pcm_s16le', 'A:/BaiduNetdiskDownload/py/tmp/12296/8b01936e59/en.wav']
[DEBUG] cmd=['A:/BaiduNetdiskDownload/py/ffmpeg/ffmpeg.exe', '-hide_banner', '-ignore_unknown', '-threads', '0', '-y', '-fflags', '+genpts', '-i', 'A:/卡司1111/未改37.mp4', '-an', '-c:v', 'copy', 'novoice.mp4']

根据日志,问题根源在于SRT字幕文件第30条及之后的时间轴格式错误。日志显示,从第30条开始,时间格式从 时:分:秒,毫秒 错误地变成了 分:秒,毫秒(例如 01:01,100),这导致软件在解析时,将整个错误的时间轴行(如 30\n00:00:58,600 --> 01:01,100)当作了待配音的文本行。

解决方案:

  1. 手动修正SRT文件:用文本编辑器打开SRT文件,从第30条开始,修正所有错误的时间格式。例如:

    • 错误格式00:00:58,600 --> 01:01,100
    • 正确格式00:00:58,600 --> 00:01:01,100
    • 错误格式01:01,200 --> 01:02,933
    • 正确格式00:01:01,200 --> 00:01:02,933
      确保所有时间轴都遵循 HH:MM:SS,mmm 的格式。
  2. 使用软件工具修正:在pyVideoTrans菜单栏,点击“工具” -> “字幕格式转换”。选择你的SRT文件,输出格式也选择SRT,然后进行转换。这个工具通常会修正时间格式错误。
  3. 重新执行任务:保存修正后的SRT文件,在软件中重新加载该文件进行配音。

请查阅相关文档:

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.

Related resource