ImageMagick cannot be detected by moviepy?
I have the same problem and I also try both answer of pauljohn32 but it does not work. However, I have solved the problem.
First of all, I install libmagick++-dev
by using sudo apt install libmagick++-dev
. Secondly, I follow the suggestion from reddit. Specifically, I open policy.xml
of ImageMagick by using command: sudo vim /etc/ImageMagick-6/policy.xml
and then comment the @ policy by change from <policy domain="path" rights="none" pattern="@*" />
to <!--<policy domain="path" rights="none" pattern="@*" /> -->
.
I hope it works for your case
You may have ImageMagic VIEWER, but you probably lack the devel library that your Python program is looking for.
Here is the package listing from my system. You probably need several package. Look at the very end, for the Python bindings. I suspect if you install those, they will bring in the other requirements. I don't know how many other header files you need, but if you don't end up with libmagick++-dev, I'll be surprised.
$ dpkg -l | grep magic
ii file 1:5.28-2ubuntu1 amd64 Determines file type using "magic" numbers
ii imagemagick 8:6.8.9.9-7ubuntu8.2 amd64 image manipulation programs -- binaries
ii imagemagick-6.q16 8:6.8.9.9-7ubuntu8.2 amd64 image manipulation programs -- quantum depth Q16
ii imagemagick-common 8:6.8.9.9-7ubuntu8.2 all image manipulation programs -- infrastructure
ii libgraphicsmagick-q16-3 1.3.25-1 amd64 format-independent image processing - C shared library
ii libimage-magick-perl 8:6.8.9.9-7ubuntu8.2 all Perl interface to the ImageMagick graphics routines
ii libimage-magick-q16-perl 8:6.8.9.9-7ubuntu8.2 amd64 Perl interface to the ImageMagick graphics routines -- Q16 version
ii libmagic1:amd64 1:5.28-2ubuntu1 amd64 File type determination library using "magi" numbers
ii libmagick++-6-headers 8:6.8.9.9-7ubuntu8.2 all object-oriented C++ interface to ImageMagick - header files
ii libmagick++-6.q16-5v5:amd64 8:6.8.9.9-7ubuntu8.2 amd64 object-oriented C++ interface to ImageMagick
ii libmagick++-6.q16-dev:amd64 8:6.8.9.9-7ubuntu8.2 amd64 object-oriented C++ interface to ImageMagick - development files
ii libmagick++-dev 8:6.8.9.9-7ubuntu8.2 all object-oriented C++ interface to ImageMagick
ii libmagickcore-6-arch-config:amd64 8:6.8.9.9-7ubuntu8.2 amd64 low-level image manipulation library - architecture header files
ii libmagickcore-6-headers 8:6.8.9.9-7ubuntu8.2 all low-level image manipulation library - header files
ii libmagickcore-6.q16-2:amd64 8:6.8.9.9-7ubuntu8.2 amd64 low-level image manipulation library -- quantum depth Q16
ii libmagickcore-6.q16-2-extra:amd64 8:6.8.9.9-7ubuntu8.2 amd64 low-level image manipulation library - extra codecs (Q16)
ii libmagickcore-6.q16-dev:amd64 8:6.8.9.9-7ubuntu8.2 amd64 low-level image manipulation library - development files (Q16)
ii libmagickwand-6-headers 8:6.8.9.9-7ubuntu8.2 all image manipulation library - headers files
ii libmagickwand-6.q16-2:amd64 8:6.8.9.9-7ubuntu8.2 amd64 image manipulation library
ii libmagickwand-6.q16-dev:amd64 8:6.8.9.9-7ubuntu8.2 amd64 image manipulation library - development files
ii libvariable-magic-perl 0.59-2 amd64 module to associate user-defined magic to variables from Perl
ii python-magic 1:5.28-2ubuntu1 all File type determination library using "magi" numbers (Python bindings)
ii python3-magic 1:5.28-2ubuntu1 all File type determination library using "magi" numbers (Python 3 bindings
Rather than install manually one by one with apt-get, I recommend novices install program "synaptic". It offers much better view of what there is and what you can get.
I'm looking in synaptic now, appears to me there are several other imagicmagick<->python packages. Look for "python-pythonmagic" or "python-wand". Appears to me there is plenty to explore.
Here's a different non-answer. I feel your pain. I should not have been so confident about the missing python devel stuff, that is the usual thing for new users.
Same problem discussed in this Reddit thread:
https://www.reddit.com/r/moviepy/comments/2q4754/need_help_with_installationconfiguration/
That's about MS Windows
The moviepy page https://github.com/Zulko/moviepy has same advice for windows users, but says Linux should work out of the box. I was confident thinking "I can make this work for my new friend..."
I've installed moviepy to see what it does. I did not have your video, I found a small thing "toystory.mp4" for testing (put a copy in http://pj.freefaculty.org/scraps if you want to try). This code is an example on their homepage: https://github.com/Zulko/moviepy
from moviepy.editor import *
video = VideoFileClip("toystory.mp4").subclip(50,60)
# Make the text. Many more options are available.
txt_clip = ( TextClip("Toy",fontsize=70,color='white')
.set_position('center')
.set_duration(10) )
result = CompositeVideoClip([video, txt_clip]) # Overlay text on video
result.write_videofile("toy.webm",fps=25)
I get same error you do:
>>> txt_clip = ( TextClip("Toy",fontsize=70,color='white')
... .set_position('center')
... .set_duration(10) )
[MoviePy] This command returned an error !Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pauljohn/.local/lib/python2.7/site-packages/moviepy/video/VideoClip.py", line 1145, in __init__
raise IOError(error)
IOError: MoviePy Error: creation of None failed because of the following error:
convert: not authorized `@/tmp/tmp8uDl3E.txt' @ error/property.c /InterpretImageProperties/3405.
convert: no images defined `PNG32:/tmp/tmprHOK9n.png' @ error/convert.c/ConvertImageCommand/3210.
.
.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
I thought to myself, "maybe I need to fix this like the Windows user"
from moviepy.config import change_settings
change_settings({"IMAGEMAGICK_BINARY": r"/usr/bin/convert"})
That fails the same way.
So I have no answer.
But I have a new guess. Now I suspect that the ImageMagick version we have is behaving in a way that moviepy does not expect. This triggers that unhelpful error message.
The right place to ask for help is in the moviepy. As long as you do have convert installed.
$ ls -la /usr/bin/convert
lrwxrwxrwx 1 root root 25 Jun 11 2016 /usr/bin/convert -> /etc/alternatives/convert
$ ls -la /etc/alternatives/convert
lrwxrwxrwx 1 root root 20 Jun 11 2016 /etc/alternatives/convert -> /usr/bin/convert-im6
I've got convert-im6, that's pointed at by /usr/bin/convert. If that version is too new, that could cause problem you see. Sorry that's the best I can do.
If you get answer, don't forget to let us know the answer.