python - 使用moviepy.editor将文本放入视频中会出错
问题描述
我从互联网上的教程中尝试了这段代码
但它没有工作,错误是:
OSError: MoviePy Error: creation of None failed because of the following error:
[WinError 2] The system cannot find the file specified.
.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
PS C:\Users\Oren\Desktop\Movie>
我不明白我是否应该下载它ImageMagick
,我搜索它,但我没有找到。请帮忙。
# Import everything needed to edit video clips
from moviepy.editor import *
# loading video dsa gfg intro video
clip = VideoFileClip("cut_2.mp4")
# clipping of the video
# getting video for only starting 10 seconds
clip = clip.subclip(0, 10)
# Reduce the audio volume (volume x 0.8)
clip = clip.volumex(0.8)
# Generate a text clip
txt_clip = TextClip("GeeksforGeeks", fontsize = 75, color = 'black')
# setting position of text in the center and duration will be 10 seconds
txt_clip = txt_clip.set_pos('center').set_duration(10)
# Overlay the text clip on the first video clip
video = CompositeVideoClip([clip, txt_clip])
# showing video
video.ipython_display(width = 280)
解决方案
推荐阅读
- reactjs - 如何在带有 Deck-GL 层的 Mapbox-GL 静态地图组件中嵌入退出按钮
- c++ - 写入文件和标准输出,std::cout 未显示全部
- performance - 如何使用 FormApp...getResponses() 减少脚本执行时间?
- c# - 尝试使用 'dbcontext.tablename.local' 获取本地列表会引发错误
- handlebars.js - Handlebars - 在带有@root 的条件语句中访问“this”
- asp.net-core - 获取 ASP .NET Core 3.1 / Kestrel 中的连接数
- python - 优化归并排序
- c# - 工作系统,团结 | 包含不同类型的结构的本机数组。错误 InvalidOperationException
- python - 什么是根据另一列中的值填充列的更有效方法
- word2vec - In embedding using word2vec 中的表达式“binary=True”