- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 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, to_t), txt in subtitles]
File "D:\UserData\Desktop\Project\影片剪輯\關鍵字版本\make_media.py", line 318, in <listcomp>
annotated_clips = [annotate(video.subclip(from_t, to_t), txt) for (from_t, to_t), txt in subtitles]
File "D:\UserData\Desktop\Project\影片剪輯\關鍵字版本\make_media.py", 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
我尝试了多种方法来解决问题,例如检查
config-default.py
在moviepy安装目录下的文件,并且它指向的ImageMagick的路径没有错。我试图重新安装ImageMagick,它也没有用。我试图编辑
policy.xml
ImageMagick 目录中的文件来自
none
至
read|write
,但它也不起作用。任何人都可以提出其他可能的解决方案吗?
最佳答案
在 /etc/ImageMagick-6/policy.xml
尝试完全注释掉以下行:<policy domain="path" rights="none" pattern="@*" />
像这样:<!-- <policy domain="path" rights="none" pattern="@*" /> -->
关于python - 由于 Imagemagick 的错误,无法用 moviepy 编写文本剪辑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67128786/
**摘要:**python 中的视频处理模块,有一个叫做 moviepy,今天我们就来唠唠它。 本文分享自华为云社区《python moviepy 的用法,看这篇就能入门》,作者: 梦想橡皮擦。 py
我正在使用此代码 (moviepy) 调整 mp4 视频的大小: video_clip = VideoFileClip(url) resized = video_clip.resize(width=7
我想在视频中写入文本并让它在播放中更改,这是我尝试过的,但它会将每个文本叠加在彼此上并且只显示文本 5 秒? def generateVideo(initial_text, secondary_tex
我一直在尝试构建一个项目,其中 Flask 应用程序可以自动将选定数量的视频连接到“核心视频”。 用户可以上传视频,发送到亚马逊 s3 进行存储。 所有视频都由 Moviepy 预处理为 mp4 文件
我想将剪辑缩放到某个尺寸,然后停止进一步缩放。换句话说,剪辑在达到一定尺寸后停止进一步增加其尺寸,如果剪辑从其原始尺寸的小得多开始缩放到更大的版本则更好。我正在使用电影模块。使用以下代码,我可以逐步缩
我正在尝试在视频片段之间使用滑入和滑出过渡,但不幸的是我只能使用这样的交叉淡入淡出来使其工作: from moviepy.editor import VideoFileClip, concatena
有没有一种方法可以成功地将任何剪辑拼接在一起,从而防止出现奇怪的故障?我从较小的 .mp4 文件中整理了一个 .mp4,我得到了一个带有奇怪故障的最终视频。我通过 Sublime Text 3 在 W
我正在尝试编写一个调整视频文件大小的应用程序,最简单的方法是 moviepy。但是,我无法使用 moviepy 的调整大小功能。看来没有解决引用。我的部分代码在这里: 我尝试使用 ffmpeg 和子进
我使用 MoviePy 从图像创建视频,并在图像底部添加一些注释。问题是我要添加的文本是越南语(不是英语),因此 MoviePy 无法正确显示它。 具体来说,下面是我的代码 # -*- coding:
我有一个 720x1280 的 mp4 视频,我想要不同尺寸的视频,例如:0.66%、0.5% 和 0.33%。 对于我使用的每种尺寸: clip = mp.VideoFileClip(file) c
我有一个脚本,它将背景和句子组合成一张图像,然后从该图像创建一个 10 秒的剪辑。但是,即使正确创建了图像,大约 20% 的已创建剪辑已损坏。这是我使用的代码: file = open(f"quote
我将视频对象列表连接在一起,然后用 write_videofile 编写它们,奇怪的是,我第一次编写文件时,它在前半场播放良好,然后在卡住之前播放文件中每个剪辑的前几帧。但这是奇怪的部分,如果我在第一
我正在玩moviepy,目的是创建嵌入网页的视频。但是,我无法让我创建的视频在 chrome 和 firefox 中实际播放(它确实在 safari 中播放:/)。 Firefox 声称“文件已损坏”
我正在使用 moviepy 导入一些视频,但本应为纵向模式的视频却以横向模式导入。我需要检查旋转是否已更改,如果已更改,则将其旋转回来。 此功能是否内置于 moviepy 中?如果没有,我还能如何检查
我正在用moviepy制作视频。在本地创建的最终视频文件具有音频。当我在heroku上运行相同的代码时,最终视频没有音频。 首先,我认为不使用heroku上的/ tmp目录可能是问题所在。我还遵循建议
我正在尝试在基础视频上叠加图像。这是我目前的代码: clip = VideoFileClip("base_video.mp4") cat = (ImageClip("title.png")
我正在使用 pygame 制作游戏,我想为其添加过场动画。然而 pygame 电影模块不再工作,所以我不得不求助于使用 moviepy。从我所看到的来看,Moviepy 的记录并不充分,所以我在弄清楚
我正在尝试在基础视频上叠加图像。这是我目前的代码: clip = VideoFileClip("base_video.mp4") cat = (ImageClip("title.png")
在 MoviePy 中,有一个 API 可以从文本创建剪辑以及连接剪辑列表。 我正在尝试在循环中创建剪辑列表,然后尝试将它们连接起来。 问题是每次它都会创建一个 25 秒的视频文件,并且循环中仅包含最
我刚刚第一次尝试使用moviepy库。从 numpy 数组生成电影非常简单、直观并且开箱即用。这是我尝试过的: from moviepy.editor import VideoClip import
我是一名优秀的程序员,十分优秀!