问题描述
我正在尝试将 TextClip 写入带有 moviepy 的视频。它一直在工作,但在我重新安装 ffmpeg 后,它不再工作(我不确定是否是它造成的,但我提到了它以防万一)。一些 TextClip 对象是纯空间。
我收到以下错误消息:
Traceback (most recent call last):
File "C:\Users\USER\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\python38\site-packages\moviepy\video\VideoClip.py",line 1137,in __init__
subprocess_call(cmd,logger=None)
File "C:\Users\USER\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\python38\site-packages\moviepy\tools.py",line 54,in subprocess_call
raise IOError(err.decode('utf8'))
OSError: magick.exe: no images for write '-write' 'PNG32:C:\Users\USER\AppData\Local\Temp\tmpmnf0fkb5.png' at CLI arg 14 @ error/operation.c/CLINoImageOperator/4893.
During handling of the above exception,another exception occurred:
Traceback (most recent call last):
File "media_main_user.py",line 79,in <module>
insert_audio_and_subtitles(input_clip,'output.mp4','text.mp3',subtitles,fontsize=subtitles_font_size,File "D:\UserData\Desktop\Project\影片剪輯\關鍵字版本\make_media.py",line 318,in insert_audio_and_subtitles
annotated_clips = [annotate(video.subclip(from_t,to_t),txt) for (from_t,txt in subtitles]
File "D:\UserData\Desktop\Project\影片剪輯\關鍵字版本\make_media.py",in <listcomp>
annotated_clips = [annotate(video.subclip(from_t,line 311,in annotate
txtclip = TextClip(txt,fontsize=fontsize,font=font,color=txt_color)
File "C:\Users\USER\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\python38\site-packages\moviepy\video\VideoClip.py",line 1146,in __init__
raise IOError(error)
OSError: MoviePy Error: creation of None Failed because of the following error:
magick.exe: no images for write '-write' 'PNG32:C:\Users\USER\AppData\Local\Temp\tmpmnf0fkb5.png' at CLI arg 14 @ error/operation.c/CLINoImageOperator/4893.
.
.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
我尝试了多种方法来解决问题,例如检查moviepy安装目录中的config-default.py
文件,并且它指向的ImageMagick路径没有错误。我尝试重新安装ImageMagick,它也没有用。我尝试将 ImageMagick 目录中的 policy.xml
文件从 none
编辑为 read|write
,但它也不起作用。任何人都可以提出其他可能的解决方案吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)