#8566 最后一步字幕配音嵌入时出错opening input: Invalid data found when processing input opening input file novoice.mp4. opening input files

120.225**8 Posted at: 2 hours ago

最后一步字幕配音嵌入时出错opening input: Invalid data found when processing input opening input file novoice.mp4. opening input files: Invalid data found when processing input
Traceback (most recent call last):
File "videotrans\task\_stage_assemble.py", line 248, in _join_video_audio_srt
File "videotrans\task\_stage_assemble.py", line 439, in _subprocess
RuntimeError: ffmpeg version 7.1.1-full_build-www.gyan.dev Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-lcms2 --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enab
......
', '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 253, in _join_video_audio_srt
File "videotrans\util\_ffmpeg_runner.py", line 95, in runffmpeg
videotrans.configure.excepts.FFmpegError: opening input: Invalid data found when processing input opening input file novoice.mp4. 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 165, in run
File "videotrans\task\_stage_assemble.py", line 26, in assembling
File "videotrans\task\_stage_assemble.py", line 256, in _join_video_audio_srt
videotrans.configure.excepts.VideoTransError: 最后一步字幕配音嵌入时出错opening input: Invalid data found when processing input opening input file novoice.mp4. opening input files: Invalid data found when processing input

trk=[TransCreate]: uuid='11bf4f63f5', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: F:/3 Part 1.mkv,
输出结果保存到文件夹: F:/_video_out/3 Part 1-mkv,
临时文件夹: F:/win-pyvideotrans-v4.17/tmp/19584/11bf4f63f5
已选 清理已存在
已启用CUDA加速
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 自动检测, , 数据类型:default
翻译渠道:微软(免费),原始语言:自动检测,目标语言:简体中文, 已选 发送完整字幕, settings.get('trans_thread')=5, settings.get('aitrans_thread')=1
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: 嵌入硬字幕 , precent=95, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=False, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=False, do_diarize=True
video_duration_ms=13088021


=
system:Windows-10-10.0.17134-SP0
version:v4.17
frozen:True
language:zh_CN
root_dir:F:/win-pyvideotrans-v4.17

1 Replies

#1 DeepSeek reply at 2 hours ago

核心原因:moov atom not found 表示临时文件 novoice.mp4(从源视频分离出的无声视频)没有写完整或被中途截断,是一个损坏/不完整的文件,所以最后一步合成时 ffmpeg 无法读取它。

本次任务源文件为 F:/3 Part 1.mkv,时长约 13088021ms(约 3.6 小时),属超长视频,分离出的 novoice.mp4 体积极大,最容易在写入阶段出问题。

按以下顺序排查处理:

  1. 检查磁盘空间(最常见)
    临时文件位于 F:/win-pyvideotrans-v4.17/tmp/19584/11bf4f63f5。请打开该目录,查看 novoice.mp4 的大小:

    • 若为 0 字节或明显偏小(远小于原视频体积)→ 就是写入失败/中断,确认 F 盘剩余空间是否足够(建议至少留出源视频体积的 3~5 倍)。空间不足时先清理,再勾选 清理已生成 重跑。
  2. 将源 mkv 先转码为标准 H.264 MP4
    mkv 常含 HEVC 10bit、AV1 等编码,硬件解码器处理长视频时可能中断并产出损坏的 mp4。

    • 菜单 → 工具/选项 → 音视频格式转换,把 3 Part 1.mkv 转为 H.264 + AAC 的 mp4;
    • 或用第三方工具转码后再导入软件重跑。
      这同时能规避 mkv 内部音轨/多流导致的分离异常。
  3. 勾选强制软编码
    菜单 → 工具/选项 → 高级选项 → 视频输出控制 → 勾选 强制软编码视频?(速度慢但兼容性好,不易出错);同时不要勾选 视频合成cuda硬解码。
  4. 规范文件名与路径
    3 Part 1.mkv 含空格。请改为纯英文数字短名(如 v1.mp4),放到浅层目录(如 F:/v1.mp4)后再处理。
  5. 关闭杀毒软件 / 加入白名单
    分离出的中间文件体积巨大、无数字签名,容易被 360、火绒、Defender 实时扫描锁定或隔离,导致写入不完整。请将软件目录整体加入信任名单,并确认处理期间没有启动第二个 sp.exe 实例(多实例会互相清空 tmp 目录)。
  6. 超长视频建议分段处理
    3.6 小时视频中途失败代价极高,建议先用 菜单 → 工具 → 按字幕剪辑视频 或第三方工具切成 20~30 分钟片段分别翻译,最后合并。

若按上述处理后仍报同样错误,请提供软件安装目录 logs/ 下对应日期的日志文件,复制其中分离无声视频阶段(提取 novoice.mp4 那一步)的 ffmpeg 输出约 30 行,以便定位是源编码问题还是写入中断。

请查阅相关文档:

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