#3855 TaskCfgVTT(is_cuda=False, uuid='c13717f94e', cache_folder='/Users/zhushaowei/code/pyvideotrans/tmp/65556/c13717f94e', ta

38.180* Posted at: 3 days ago 👁29

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

subprocess.run(

File "/Users/zhushaowei/.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', 'compose1774775305.372693.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', '58', '-t', '263.930000', '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/zhushaowei/code/pyvideotrans/videotrans/util/help_ffmpeg.py", line 261, in runffmpeg

subprocess.run(

File "/Users/zhushaowei/.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', 'compose1774775305.372693.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', '23', '-preset', 'veryfast', '-t', '263.930000', '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/zhushaowei/code/pyvideotrans/videotrans/task/trans_create.py", line 1525, in _join_video_audio_srt

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

File "/Users/zhushaowei/code/pyvideotrans/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/zhushaowei/code/pyvideotrans/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/zhushaowei/code/pyvideotrans/videotrans/task/job.py", line 324, in run

trk.assembling()

File "/Users/zhushaowei/code/pyvideotrans/videotrans/task/trans_create.py", line 802, in assembling

self._join_video_audio_srt()

File "/Users/zhushaowei/code/pyvideotrans/videotrans/task/trans_create.py", line 1528, in _join_video_audio_srt

raise RuntimeError(msg)

RuntimeError: 最后一步字幕配音嵌入时出错
TaskCfgVTT(is_cuda=False, uuid='c13717f94e', cache_folder='/Users/zhushaowei/code/pyvideotrans/tmp/65556/c13717f94e', target_dir='/Users/zhushaowei/videoWithTrans/test_video-mp4', source_language='英语', source_language_code='en', source_sub='/Users/zhushaowei/videoWithTrans/test_video-mp4/en.srt', source_wav='/Users/zhushaowei/code/pyvideotrans/tmp/65556/c13717f94e/en.wav', source_wav_output='/Users/zhushaowei/videoWithTrans/test_video-mp4/en.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='/Users/zhushaowei/videoWithTrans/test_video-mp4/zh-cn.srt', target_wav='/Users/zhushaowei/code/pyvideotrans/tmp/65556/c13717f94e/target.wav', target_wav_output='/Users/zhushaowei/videoWithTrans/test_video-mp4/zh-cn.m4a', name='/Users/zhushaowei/videoExample/test_video.mp4', noextname='test_video', basename='test_video.mp4', ext='mp4', dirname='/Users/zhushaowei/videoExample', shound_del_name=None, translate_type=0, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='Yunyang(Male/CN)', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='en', recogn_type=0, model_name='large-v3-turbo', 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/zhushaowei/videoWithTrans/test_video-mp4/test_video.mp4', novoice_mp4='/Users/zhushaowei/code/pyvideotrans/tmp/65556/c13717f94e/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=True, output_srt=0, copysrt_rawvideo=False)


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

1 Replies

这是由于在 macOS 上使用 hevc_videotoolbox 硬件编码器嵌入字幕时,FFmpeg 的 subtitles 过滤器可能不兼容或未找到导致的。

解决方案:

  1. 强制使用软件编码:在软件中,进入 菜单 -> 工具/选项 -> 高级选项。在【视频输出控制】部分,勾选 强制软编码视频? 选项。这将避免使用 hevc_videotoolbox 硬件编码器,转而使用兼容性更好的软件编码器(如 libx264libx265)。
  2. 检查字幕文件:确保生成的 end.ass 字幕文件格式正确且路径无误。错误信息 Filter not found 也可能与字幕文件本身有关。
  3. 更新 FFmpeg:确保你的 macOS 系统上安装了最新版本的 FFmpeg(通过 brew install ffmpeg 安装或更新)。旧版本可能存在过滤器兼容性问题。
  4. 简化输出设置:在最终合成前,可以尝试暂时取消勾选“嵌入硬字幕”,先输出一个仅替换了音频的视频,以确认是否是字幕嵌入步骤的问题。

操作步骤总结:

  • 首选方案是执行第1步,勾选“强制软编码视频”。
  • 如果问题依旧,请检查 tmp 任务缓存文件夹中对应的 end.ass 文件是否能被其他播放器正常读取。
  • 作为临时测试,可以取消嵌入字幕,看合成步骤是否能通过。

请查阅相关文档:

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