#5164 TaskCfgVTT(uuid='25c753db82', name='D:/aaa/Documents/13425831819605875.mp4', dirname='D:/aaa/Documents', noextname='1342

2409:8a70* Posted at: 1 hour ago

最后一步字幕配音嵌入时出错submitting video frame to the encoder encoding a frame: Generic error in an external library[Qwen-ASR(本地内置), 微软(免费), Edge-TTS(免费)]
Traceback (most recent call last):
File "videotrans\task\trans_create.py", line 1633, in _subprocess
File "subprocess.py", line 526, in run
subprocess.CalledProcessError: Command '['ffmpeg', '-nostdin', '-y', '-progress', 'compose1781370120.5931172.txt', '-i', 'novoice.mp4', '-i', 'will_embed.m4a', '-filter_complex', "[0:v]subtitles=filename='end.ass'[v_out]", '-map', '[v_out]', '-map', '1:a', '-c:v', 'h264_nvenc', '-c:a', 'copy', '-cq', '23', '-preset', 'p4', '-movflags', '+faststart', '-t', '551.533000', 'laste_target.mp4']' returned non-zero exit status 4294967284.

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

Traceback (most recent call last):
File "videotrans\task\trans_create.py", line 1451, in _join_video_audio_srt
File "videotrans\task\trans_create.py", line 1647, in _subprocess
videotrans.co
......
other streams:0KiB global headers:0KiB muxing overhead: 1.800094%
frame=15361 fps=708 q=19.0 Lsize= 31244KiB time=00:08:32.03 bitrate= 499.9kbits/s speed=23.6x
Conversion failed!

,Command '['ffmpeg', '-nostdin', '-y', '-progress', 'compose1781370120.5931172.txt', '-i', 'novoice.mp4', '-i', 'will_embed.m4a', '-filter_complex', "[0:v]subtitles=filename='end.ass'[v_out]", '-map', '[v_out]', '-map', '1:a', '-c:v', 'h264_nvenc', '-c:a', 'copy', '-cq', '23', '-preset', 'p4', '-movflags', '+faststart', '-t', '551.533000', 'laste_target.mp4']' returned non-zero exit status 4294967284.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\help_ffmpeg.py", line 59, in runffmpeg
File "subprocess.py", line 526, in run
subprocess.CalledProcessError: Command '['ffmpeg', '-hide_banner', '-nostdin', '-ignore_unknown', '-threads', '0', '-y', '-progress', 'compose1781370120.5931172.txt', '-i', 'novoice.mp4', '-i', 'will_embed.m4a', '-filter_complex', "[0:v]subtitles=filename='end.ass'[v_out]", '-map', '[v_out]', '-map', '1:a', '-c:v', 'libx264', '-c:a', 'copy', '-crf', '23', '-preset', 'medium', '-movflags', '+faststart', '-t', '551.533000', 'laste_target.mp4']' returned non-zero exit status 3752568763.

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

Traceback (most recent call last):
File "videotrans\task\trans_create.py", line 1455, in _join_video_audio_srt
File "videotrans\util\help_ffmpeg.py", line 88, in runffmpeg
videotrans.configure.excepts.FFmpegError: submitting video frame to the encoder encoding a frame: Generic error in an external library

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

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 128, in run
File "videotrans\task\trans_create.py", line 745, in assembling
File "videotrans\task\trans_create.py", line 1458, in _join_video_audio_srt
videotrans.configure.excepts.VideoTransError: 最后一步字幕配音嵌入时出错submitting video frame to the encoder encoding a frame: Generic error in an external library
TaskCfgVTT(uuid='25c753db82', name='D:/aaa/Documents/13425831819605875.mp4', dirname='D:/aaa/Documents', noextname='13425831819605875', basename='13425831819605875.mp4', ext='mp4', target_dir='13425831819605875-mp4', cache_folder='D:/BaiduNetdiskDownload/win-pyvideotrans-v4.02-0612/tmp/18416/25c753db82', is_cuda=True, source_language='简体中文', source_language_code='zh-cn', source_sub='13425831819605875-mp4/zh-cn.srt', source_wav='D:/BaiduNetdiskDownload/win-pyvideotrans-v4.02-0612/tmp/18416/25c753db82/zh-cn.wav', source_wav_output='13425831819605875-mp4/zh-cn.m4a', target_language='韩语', target_language_code='ko', target_sub='13425831819605875-mp4/ko.srt', target_wav='D:/BaiduNetdiskDownload/win-pyvideotrans-v4.02-0612/tmp/18416/25c753db82/target.wav', target_wav_output='13425831819605875-mp4/ko.m4a', translate_type=1, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='InJoon(Male/KR)', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='zh-cn', recogn_type=2, model_name='1.7B', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=0, subtitle_language=None, app_mode='biaozhun', subtitles='', targetdir_mp4='13425831819605875-mp4/13425831819605875.mp4', novoice_mp4='D:/BaiduNetdiskDownload/win-pyvideotrans-v4.02-0612/tmp/18416/25c753db82/novoice.mp4', is_separate=False, embed_bgm=True, instrument=None, vocal='D:/BaiduNetdiskDownload/win-pyvideotrans-v4.02-0612/tmp/18416/25c753db82/vocal.wav', clear_cache=True, background_music='', subtitle_type=1, only_out_mp4=True, recogn2pass=False, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8)


=
system:Windows-10-10.0.26200-SP0
version:v4.02
frozen:True
language:zh
root_dir:D:/BaiduNetdiskDownload/win-pyvideotrans-v4.02-0612

1 Replies

这是由硬件编码器 h264_nvenc 在合成视频时显存耗尽导致的错误。最后一步使用 NVIDIA NVENC 硬件编码,但编码过程中系统或显存不足,触发了 Cannot allocate memory 错误。

解决方案:强制切换为软编码(使用 libx264 软件编码器)

  1. 打开软件主界面,进入 菜单 -> 工具/选项 -> 高级选项
  2. 找到 【视频输出控制】 区域。
  3. 勾选 强制软编码视频?(或等效选项,描述为“强制ffmpeg使用软编解码?”)。
  4. 点击保存或关闭高级选项窗口,重新执行当前任务。

如果上述选项不可见,也可尝试在主界面取消勾选 CUDA加速 再执行,但会同时禁用 GPU 加速的语音识别和配音部分,速度会明显下降。推荐只强制软编码视频合成部分。

其他辅助措施(如仍失败):

  • 在高级选项中将 视频输出质量控制(CRF)从 23 增大到 28~30,减少编码负担。
  • 如果同时运行了其他 GPU 程序(如浏览器、游戏),关闭它们释放显存。

请查阅相关文档:

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

Similar issues already exist