This error can be due to the fact that ImageMagick is not in
回答
收藏

This error can be due to the fact that ImageMagick is not in

本真小杨
2024-03-05 21:54·浏览量:514
本真小杨
发布于 2024-03-05 21:54514浏览

This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect


为什么还是报错,有哪位大神知道吗?

from moviepy.editor import VideoFileClip
from moviepy.video.VideoClip import TextClip

from xbot importprint
from
typing import *

defadd_subtitles_to_video(video_path, subtitles_path, output_path):
"""
   title: 合成视频和字幕文件
   description: 将字幕文件添加到视频中,并生成新的视频文件
   inputs:
       - video_path (file): 视频文件的路径,eg: "path/to/video.mp4"
       - subtitles_path (file): 字幕文件的路径,eg: "path/to/subtitles.srt"
       - output_path (file): 输出视频文件的路径,eg: "path/to/output.mp4"
   outputs:
       - None
   """

    video = VideoFileClip(video_path)

    subtitles = TextClip(subtitles_path, fontsize=24, color='white').set_position(('center', 'bottom')).set_duration(video.duration)

    video_with_subtitles = CompositeVideoClip([video, subtitles])

    video_with_subtitles.write_videofile(output_path, codec='libx264', audio_codec='aac')

    video.close()

    video_with_subtitles.close()

尝试过的方案

本地已经下载了

环境变量也设置了

收藏
全部回答1
最新
发布回答
回答