#7223 最后一步字幕配音嵌入时出错opening input: Invalid data found when processing input opening input file will_embed.m4a. opening input fi

141.11**7 Posted at: 5 hours ago

最后一步字幕配音嵌入时出错opening input: Invalid data found when processing input opening input file will_embed.m4a. opening input files: Invalid data found when processing input
Traceback (most recent call last):
File "videotrans\task\_stage_assemble.py", line 432, in _subprocess
File "subprocess.py", line 526, in run
subprocess.CalledProcessError: Command '['ffmpeg', '-nostdin', '-y', '-progress', 'compose1789262329.5162475.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', 'p7', '-movflags', '+faststart', '-fps_mode', 'vfr', '-shortest', 'laste_target.mp4']' returned non-zero exit status 3199971767.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\task\_stage_assemble.py", line 282, in _join_video_audio_srt
File "videotrans\task\_stage_assemble.p
......
ess', 'compose1789262329.5162475.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', 'libx264', '-c:a', 'copy', '-crf', '23', '-preset', 'slow', '-movflags', '+faststart', '-fps_mode', 'vfr', '-shortest', 'laste_target.mp4']' returned non-zero exit status 3199971767.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\task\_stage_assemble.py", line 286, in _join_video_audio_srt
File "videotrans\util\_ffmpeg_runner.py", line 78, in runffmpeg
videotrans.configure.excepts.FFmpegError: opening input: Invalid data found when processing input opening input file will_embed.m4a. opening input files: Invalid data found when processing input

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 164, in run
File "videotrans\task\_stage_assemble.py", line 26, in assembling
File "videotrans\task\_stage_assemble.py", line 289, in _join_video_audio_srt
videotrans.configure.excepts.VideoTransError: 最后一步字幕配音嵌入时出错opening input: Invalid data found when processing input opening input file will_embed.m4a. opening input files: Invalid data found when processing input

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: E:/Godot 肉鸽教程:制作 3D 砍杀动作游戏/14, Blend Trees.mp4,
输出结果保存到文件夹: E:/Godot 肉鸽教程:制作 3D 砍杀动作游戏/_video_out/14, Blend Trees-mp4,
临时文件夹: D:/Program Files (x86)/sp4.12/tmp/5716/885b32c325
未选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:OpenAI ChatGPT,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Index-TTS(本地API), 角色:NanSheng.wav, 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 未选 音频加速, 已选 视频慢速
字幕: 嵌入硬字幕(双) 目标语言在上双字幕
代理地址:http://127.0.0.1:8086


=
system:Windows-10-10.0.19045-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:D:/Program Files (x86)/sp4.12

1 Replies

#1 DeepSeek reply at 5 hours ago

核心原因是:配音合成的音频文件 will_embed.m4a 未生成成功或已损坏,导致最后一步 FFmpeg 合并时读取失败(moov atom not found = 该 m4a 文件不完整/只有部分数据)。

这通常由以下原因引起:

  1. Index-TTS 配音阶段有部分字幕配音失败(Index-TTS 本地API 返回异常或超时),导致最终拼接的 will_embed.m4a 文件不完整。
  2. 中途任务被中断或某句配音静默失败,FFmpeg 未能正常写完文件尾部的 moov atom。
  3. 已勾选"视频慢速",该功能会触发大量音频重构,进一步放大了配音文件异常的概率。

排查与解决步骤

  1. 检查配音是否全部成功

    • 打开临时目录 D:/Program Files (x86)/sp4.12/tmp/5716/885b32c325/,查看里面是否有分段的配音音频文件(如 1.wav2.wav 等)。
    • 若存在大量 0 字节或很小的文件,说明 Index-TTS 配音环节有失败。
  2. 确认 Index-TTS 服务状态

    • 确认 Index-TTS 的 WebUI/API 服务仍在运行,且地址填写正确(默认 9880 端口,不能填 7860 WebUI 端口)。
    • 若之前中断过 Index-TTS,请重启该服务后再重新执行。
  3. 在软件中重跑,并关闭"视频慢速"

    • 勾选"清理已生成",重新执行一次翻译。
    • 暂时取消勾选"视频慢速",先只勾选"配音加速",确认能正常合成(视频慢速会引入大量额外音频处理,容易触发文件损坏)。
  4. 如仍报同样错误,手动测试该音频文件

    • 在 tmp 目录里找到 will_embed.m4a,用播放器尝试播放,若无法播放则确认文件已损坏,属于生成环节问题而非软件 bug。
  5. 参考音频问题排查(Index-TTS 常见)

    • 你的配音音色是 NanSheng.wav,确保该参考音频为 3-10 秒、单声道 WAV、无背景噪声
    • 参考音频不合规会导致 Index-TTS 部分句子合成失败,进而生成损坏的音频文件。

请查阅相关文档:

若按上述步骤处理后仍无法解决,请提供软件安装目录 logs/ 文件夹中最新日志文件底部的报错内容,以便进一步分析。

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