不乱于心,不困于情。
不畏将来,不念过往。如此,安好。

moviepy添加字幕报错解决方案

一、报错内容
OSError: MoviePy Error: creation of None failed because of the following error:

[WinError 2] 系统找不到指定的文件。.

.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

二、最终的解决方法:
1、安装 ImageMagick

https://www.imagemagick.org/script/download.php

安装时ImageMagick是一直next就行。
安装后设置MAGICK_HOME环境变量,值为imagemagick的安装路径,并将安装路径加入path。


2、安装成功之后,修改moviepy模块下的config_defaults.py文件
具体位置,可以参考的python安装位置:
对应的修改文件位置:\Lib\site-packages\moviepy\config_defaults.py修改修改的就是IMAGEMAGICK_BINARY的值,改为刚刚你安装ImageMagick的目录下。

FFMPEG_BINARY = os.getenv(‘FFMPEG_BINARY’, ‘ffmpeg-imageio’)
# IMAGEMAGICK_BINARY = os.getenv(‘IMAGEMAGICK_BINARY’, ‘auto-detect’)
# 修改为刚刚ImageMagic的安装路径
IMAGEMAGICK_BINARY = r”E:\ImageMagick-7.1.0-Q16\magick.exe”

赞(1) 打赏
未经允许不得转载:seo优化_前端开发_渗透技术 » moviepy添加字幕报错解决方案

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏