#3995 RuntimeError: 最后一步字幕配音嵌入时出错

60.248* Posted at: 2 hours ago 👁6

合并阶段出错:运行时错误:最后一步字幕配音嵌入时出错:
Traceback (most recent call last):
File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/util/help_ffmpeg.py", line 274, in runffmpeg

subprocess.run(

File "/opt/homebrew/Cellar/[email protected]/3.10.19_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 526, in run

raise CalledProcessError(retcode, process.args,

subprocess.CalledProcessError: Command '['ffmpeg', '-hide_banner', '-ignore_unknown', '-threads', '0', '-y', '-progress', '/Users/peijingbo/MyCode/pyvideotrans/tmp45706/compose1775708764.3278441.txt', '-i', '/Users/peijingbo/MyCode/pyvideotrans/tmp45706/12f84ddbc9/novoice.mp4', '-i', '/Users/peijingbo/MyCode/pyvideotrans/tmp45706/12f84ddbc9/target.wav', '-c:v', 'h264_videotoolbox', '-c:a', 'aac', '-b:a', '128k', '-vf', 'subtitles=end.srt.ass', '-movflags', '+faststart', '-shortest', '/Users/peijingbo/Movies/翻译输出/08,09,10,11,12,13/11-Early Programming: Crash Course Computer Science #10/11-Early Programming: Crash Course Computer Science #10.mp4']' returned non-zero exit status 234.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/util/help_ffmpeg.py", line 274, in runffmpeg

subprocess.run(

File "/opt/homebrew/Cellar/[email protected]/3.10.19_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 526, in run

raise CalledProcessError(retcode, process.args,

subprocess.CalledProcessError: Command '['ffmpeg', '-hide_banner', '-ignore_unknown', '-threads', '0', '-y', '-progress', '/Users/peijingbo/MyCode/pyvideotrans/tmp45706/compose1775708764.3278441.txt', '-i', '/Users/peijingbo/MyCode/pyvideotrans/tmp45706/12f84ddbc9/novoice.mp4', '-i', '/Users/peijingbo/MyCode/pyvideotrans/tmp45706/12f84ddbc9/target.wav', '-c:v', 'libx264', '-c:a', 'aac', '-b:a', '128k', '-vf', 'subtitles=end.srt.ass', '-movflags', '+faststart', '-crf', '22', '-preset', 'fast', '-shortest', '/Users/peijingbo/Movies/翻译输出/08,09,10,11,12,13/11-Early Programming: Crash Course Computer Science #10/11-Early Programming: Crash Course Computer Science #10.mp4']' returned non-zero exit status 234.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/task/trans_create.py", line 1082, in _join_video_audio_srt

tools.runffmpeg(cmd)

File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/util/help_ffmpeg.py", line 314, in runffmpeg

return runffmpeg(fallback_args, noextname=noextname, uuid=uuid, force_cpu=True)

File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/util/help_ffmpeg.py", line 319, in runffmpeg

raise RuntimeError(err)

RuntimeError: Error opening output file /Users/peijingbo/Movies/翻译输出/08,09,10,11,12,13/11-Early Programming: Crash Course Computer Science #10/11-Early Programming: Crash Course Computer Science #10.mp4.
Error opening output files: Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/task/job.py", line 256, in run

trk.assembling()

File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/task/trans_create.py", line 508, in assembling

self._join_video_audio_srt()

File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/task/trans_create.py", line 1085, in _join_video_audio_srt

raise RuntimeError(msg)

RuntimeError: 最后一步字幕配音嵌入时出错


=
system:macOS-26.3.1-arm64-arm-64bit
version:v3.84
frozen:False
language:zh
root_dir:/Users/peijingbo/MyCode/pyvideotrans
Python: 3.10.19 (main, Oct 9 2025, 15:25:03) [Clang 17.0.0 (clang-1700.3.19.1)]

1 Replies

这是由于输出文件路径过长或包含特殊字符(冒号 :)导致的。macOS/Linux 系统对文件路径长度和字符有严格限制,路径中的冒号 : 是非法字符,会导致 ffmpeg 命令失败。

解决方案:

  1. 修改输出目录:将输出目录设置为一个更短、更简单的路径,例如 ~/Movies/out/Users/peijingbo/Desktop/out
  2. 修改视频文件名:将原始视频文件名重命名为简短、仅包含英文字母和数字的名称,例如 11.mp4。避免使用中文、空格、冒号、逗号等特殊字符。
  3. 清理已生成:在软件主界面左上角勾选 清理已生成 复选框,然后重新处理视频。

具体操作步骤:

  1. 在 pyVideoTrans 主界面,点击 输出到.. 按钮,选择一个更短、更简单的输出目录。
  2. 将待处理的视频文件重命名为简短英文名(如 11.mp4),并移动到浅层目录(如 ~/Downloads)。
  3. 在主界面左上角勾选 清理已生成
  4. 重新选择视频文件并开始翻译。

请查阅相关文档:

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