#7619 合并阶段出错 最后一步字幕配音嵌入时出错opening input: Invalid data found when processing input opening input file novoice.mp4. opening inpu

203.10**4 Posted at: 1 hour 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\util\_ffmpeg_runner.py", line 49, in runffmpeg

File "subprocess.py", line 526, in run

subprocess.CalledProcessError: Command '['ffmpeg', '-hide_banner', '-nostdin', '-ignore_unknown', '-threads', '0', '-y', '-progress', 'compose1790322932.812532.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', '20', '-preset', 'slow', '-movflags', '+faststart', '-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 276, 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 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\job.py", line 35, in run

File "videotrans\task\job.py", line 197, in process_task

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 novoice.mp4. opening input files: Invalid data found when processing input

self.cfg=[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式
原始输入文件名: G:/video/Karim/P06如何在UE5中创建室内写实灯光.mp4,
输出结果保存到文件夹: G:/video/Karim/_video_out/P06如何在UE5中创建室内写实灯光-mp4,
临时文件夹: F:/3ruanjian/pyVideoTrans/win-pyvideotrans-v4.12-0913/tmp/9656/36c37a8a38
未选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunjian(Male/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+6%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入硬字幕(双) 目标语言在上双字幕
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量1.0, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
代理地址:http://127.0.0.1:7890


=
system:Windows-10-10.0.22631-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:F:/3ruanjian/pyVideoTrans/win-pyvideotrans-v4.12-0913

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因是:原始视频编码为 VP9(webm系常见编码),在硬字幕烧录阶段生成的中间文件 novoice.mp4 与目标编码(libx264)不兼容,导致 FFmpeg 读取该中间文件时报 "Invalid data found"。

从日志可见:

  • video_codec_name: 'vp9',分辨率 3840x2160(4K)
  • 硬字幕双字幕烧录必须重新编码,而 VP9 → mp4(x264) 中间流的封装出现了兼容问题

解决方案(按顺序尝试)

1. 先用工具把原视频转码为标准的 H.264/MP4
使用格式工厂、HandBrake 或 FFmpeg 命令转码:

ffmpeg -i 原视频.mp4 -c:v libx264 -c:a aac -crf 20 转码后.mp4

转码后用新的 转码后.mp4 重新翻译。

2. 改用软字幕,避免重编码
主界面 → 字幕嵌入类型 改为 嵌入软字幕(双语)(Soft subtitles(Bilingual))。软字幕不需要重新编码视频,可绕开此问题。

注意:软字幕在网页播放器里不会显示,需要用 PotPlayer / VLC 等本地播放器。

3. 关闭"视频慢速",降低体积与重编码压力
日志显示未选视频慢速,此项已 OK。

4. 检查路径与文件名
当前路径较深且含中文:G:/video/Karim/P06如何在UE5中创建室内写实灯光.mp4。虽然本身可能不是主因,但建议把视频移到浅层英文目录(如 D:/v/test.mp4)再试。

5. 若要用硬字幕,可调低输出质量
菜单 → 工具/选项 → 高级选项 → 视频输出控制:

  • 视频输出质量控制(CRF) 调大到 25~30
  • 264/265编码 保持 264
  • 勾选 强制软编码视频?

推荐组合

4K + VP9 源视频 + 硬字幕双字幕 是风险最高的组合,最稳方案是 第1步(先转码为 H.264) 或 第2步(改用软字幕双语)。

请查阅相关文档:

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