#4798 最后一步字幕配音嵌入时出错Traceback (most recent call last): File "videotrans\task\trans_create.py", line 1501, in _join_video_audio

103.172* Posted at: 6 hours ago

最后一步字幕配音嵌入时出错
Traceback (most recent call last):
File "videotrans\task\trans_create.py", line 1501, in _join_video_audio_srt
File "videotrans\task\trans_create.py", line 1747, in _subprocess
File "subprocess.py", line 526, in run
subprocess.CalledProcessError: Command '['ffmpeg', '-nostdin', '-y', '-progress', 'compose1780117282.7250571.txt', '-i', 'novoice.mp4', '-i', 'origin_audio.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', 'p4', '-movflags', '+faststart', '-t', '477.466000', '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 57, in runffmpeg
File "subprocess.py", line 526, in run
subprocess.CalledProcessError: Command '['ffmpeg', '-hide_banner', '-nostdin', '-ignore_unknown', '-threads', '0', '-y', '-progress', 'compose1780117282.7250571.txt', '-i', 'novoice.mp4', '-i', 'origin_audio.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', 'medium', '-movflags', '+faststart', '-t', '477.466000', 'laste_target.mp4']' returned non-zero exit status 3752568763.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\trans_create.py", line 1505, in _join_video_audio_srt
File "videotrans\util\help_ffmpeg.py", line 86, in runffmpeg
RuntimeError: submitting video frame to the encoder encoding a frame: Generic error in an external library submitting a packet to the muxer: Cannot allocate memory muxing a packet writing trailer: Cannot allocate memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\_mult_video.py", line 42, in run
File "videotrans\task\trans_create.py", line 822, in assembling
File "videotrans\task\trans_create.py", line 1510, in _join_video_audio_srt
RuntimeError: 最后一步字幕配音嵌入时出错

1 Replies

这是由系统内存(RAM)不足导致的 ffmpeg 编码失败(Cannot allocate memory)。视频合成阶段需要足够的内存来加载视频帧和字幕,当内存或磁盘空间不足时就会报错。

解决方案:

  1. 释放系统内存:关闭其他占用内存的软件,特别是大型应用(浏览器、IDE等)。
  2. 检查磁盘空间:确保软件所在盘和系统临时目录有至少等同于原视频大小数倍的剩余空间(尤其避免 C 盘爆满)。
  3. 降低视频输出质量:点击菜单栏 工具/选项 → 高级选项 → 视频输出控制,将 视频输出质量控制 调高(例如从 23 改为 30 或更大数字,数字越大文件越小、内存占用越低)。
  4. 使用更快的编码预设:在同一位置将 输出视频压缩率 改为 ultrafastveryfast,降低内存消耗。
  5. 减少并发任务:如果正在批量处理多个视频,在高级选项 → 通用设置中,将 批量翻译视频时每批数量 设为 1,逐个串行处理。
  6. 关闭不必要的功能:确保未启用“视频慢速”,并清除临时文件夹(关闭软件后删除软件根目录下的 tmp 文件夹)。

如果仍无法解决:

尝试更换编码方式为纯软编码(不依赖显卡),在高级选项中勾选 强制软编码视频,然后重启任务。同时确保显卡驱动和 CUDA 环境正常,但本次错误主要是内存问题。

请查阅相关文档:

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

Similar issues already exist