#3888 TaskCfgVTT(is_cuda=False, uuid='e3900b846f', cache_folder='/Users/xiaohuo/Downloads/pyvideotrans-main/tmp/41313/e3900b84

175.197* Posted at: 1 day ago 👁27

合并阶段出错 最后一步字幕配音嵌入时出错
Traceback (most recent call last):
File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/util/help_ffmpeg.py", line 261, in runffmpeg

subprocess.run(

File "/Users/xiaohuo/.local/share/uv/python/cpython-3.10.19-macos-aarch64-none/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', 'compose1774970702.709567.txt', '-i', 'novoice.mp4', '-i', 'origin_audio.m4a', '-map', '0:v', '-map', '1:a', '-c:v', 'hevc_videotoolbox', '-c:a', 'copy', '-vf', "subtitles=filename='end.ass'", '-movflags', '+faststart', '-q:v', '56', '-t', '1174.799000', 'laste_target.mp4']' returned non-zero exit status 8.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/util/help_ffmpeg.py", line
......
ocessError: Command '['ffmpeg', '-hide_banner', '-ignore_unknown', '-threads', '0', '-y', '-progress', 'compose1774970702.709567.txt', '-i', 'novoice.mp4', '-i', 'origin_audio.m4a', '-map', '0:v', '-map', '1:a', '-c:v', 'libx265', '-c:a', 'copy', '-vf', "subtitles=filename='end.ass'", '-movflags', '+faststart', '-crf', '24', '-preset', 'veryfast', '-t', '1174.799000', 'laste_target.mp4']' returned non-zero exit status 8.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/task/trans_create.py", line 1514, in _join_video_audio_srt

tools.runffmpeg(cmd, cmd_dir=self.cfg.cache_folder, force_cpu=False)

File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/util/help_ffmpeg.py", line 302, in runffmpeg

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

File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/util/help_ffmpeg.py", line 307, in runffmpeg

raise RuntimeError(err)

RuntimeError: opening output file laste_target.mp4. opening output files: Filter not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/task/job.py", line 288, in run

trk.assembling()

File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/task/trans_create.py", line 789, in assembling

self._join_video_audio_srt()

File "/Users/xiaohuo/Downloads/pyvideotrans-main/videotrans/task/trans_create.py", line 1517, in _join_video_audio_srt

raise RuntimeError(msg)

RuntimeError: 最后一步字幕配音嵌入时出错
TaskCfgVTT(is_cuda=False, uuid='e3900b846f', cache_folder='/Users/xiaohuo/Downloads/pyvideotrans-main/tmp/41313/e3900b846f', target_dir='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计/_video_out/원가회계 3주 - 2-mp4', source_language='韩语', source_language_code='ko', source_sub='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计/_video_out/원가회계 3주 - 2-mp4/ko.srt', source_wav='/Users/xiaohuo/Downloads/pyvideotrans-main/tmp/41313/e3900b846f/ko.wav', source_wav_output='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计/_video_out/원가회계 3주 - 2-mp4/ko.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计/_video_out/원가회계 3주 - 2-mp4/zh-cn.srt', target_wav='/Users/xiaohuo/Downloads/pyvideotrans-main/tmp/41313/e3900b846f/target.wav', target_wav_output='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计/_video_out/원가회계 3주 - 2-mp4/zh-cn.m4a', name='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计/원가회계 3주 - 2.mp4', noextname='원가회계 3주 - 2', basename='원가회계 3주 - 2.mp4', ext='mp4', dirname='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计', shound_del_name=None, translate_type=10, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=False, video_autorate=False, remove_silent_mid=True, align_sub_audio=True, detect_language='ko', recogn_type=0, model_name='small', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=False, subtitle_language=None, app_mode='biaozhun', subtitles='', targetdir_mp4='/Users/xiaohuo/Library/Mobile Documents/com~apple~CloudDocs/大三下/成本会计/_video_out/원가회계 3주 - 2-mp4/원가회계 3주 - 2.mp4', novoice_mp4='/Users/xiaohuo/Downloads/pyvideotrans-main/tmp/41313/e3900b846f/novoice.mp4', is_separate=False, instrument=None, vocal=None, back_audio='', clear_cache=False, background_music=None, subtitle_type=1, only_out_mp4=False, recogn2pass=False, output_srt=0, copysrt_rawvideo=False)


=
system:macOS-26.4-arm64-arm-64bit
version:v3.98
frozen:False
language:zh
root_dir:/Users/xiaohuo/Downloads/pyvideotrans-main
Python: 3.10.19 (main, Feb 12 2026, 00:36:33) [Clang 21.1.4 ]

1 Replies

这是由于在 macOS 上使用 hevc_videotoolbox 硬件编码器或 libx265 软件编码器合成视频并嵌入字幕(ASS格式)时,FFmpeg 命令中的 subtitles 滤镜未能正确加载或处理字幕文件导致的。

解决方案:

  1. 检查字幕文件:确认临时文件夹(/Users/xiaohuo/Downloads/pyvideotrans-main/tmp/41313/e3900b846f/)下的 end.ass 字幕文件是否存在且格式正确。该文件可能因编码问题或路径过长导致滤镜无法读取。
  2. 简化文件路径:您的原始视频文件路径包含空格和特殊字符(如 원가회계 3주 - 2.mp4),且输出路径层级很深。这可能导致 FFmpeg 处理时出现问题。请尝试:

    • 将原始视频文件重命名为简单的英文或数字名称(例如 video.mp4)。
    • 将文件移动到较浅的目录(如 ~/Downloads/)下再进行处理。
  3. 修改高级编码设置:在软件中,进入 菜单 -> 工具 -> 高级选项,进行以下调整:

    • 视频输出控制 区域:

      • 264/265编码265 改为 264libx264 兼容性通常更好)。
      • 确保 强制软编码视频? 选项被选中(在 macOS 上,硬件编码器 hevc_videotoolbox 可能对字幕滤镜支持不佳)。
      • 输出视频压缩率 暂时改为 mediumfast,以降低编码复杂度。
  4. 更改字幕嵌入方式:如果问题依旧,可以尝试不嵌入硬字幕(subtitle_type 设为 02 即软字幕),先测试是否能成功合成视频和音频。或者,在 设置更多参数 中点击 修改硬字幕,检查并简化字幕样式(如字体),过于复杂的样式可能引发问题。
  5. 确保 FFmpeg 已正确安装:您使用的是源码部署,请确认已通过 brew install ffmpeg 安装了 FFmpeg,并且其路径已正确添加到系统环境变量中。可以在终端输入 ffmpeg -version 验证。

请查阅相关文档:

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