CODE:
from moviepy.editor import *
clip = VideoFileClip("video1.mp4").subclip(50, 60)
txt_clip = TextClip("My Holidays 2013", fontsize=70, color='white')
txt_clip = txt_clip.set_pos('center').set_duration(10)
video = CompositeVideoClip([clip, txt_clip])
video.write_videofile("output.mp4")
NOTE: Imagemagic is installed correctly as when i type convert in the terminal i get the version name.
Also i can perfectly run the other examples were there isn't a use of TextClip.
OUTPUT:
[MoviePy] This command returned an error !Traceback (most recent call last):
File "/home/vega6-x3/.local/lib/python3.5/site-packages/moviepy/video/VideoClip.py", line 1220, in __init__
subprocess_call(cmd, verbose=False )
File "/home/vega6-x3/.local/lib/python3.5/site-packages/moviepy/tools.py", line 49, in subprocess_call
raise IOError(err.decode('utf8'))
OSError: convert: not authorized `@/tmp/tmpfa42vkjy.txt' @ error/property.c/InterpretImageProperties/3405.
convert: no images defined `PNG32:/tmp/tmpevkkuuf5.png' @ error/convert.c/ConvertImageCommand/3210.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vega6-x3/python/hello.py", line 10, in <module>
txt_clip = TextClip("My Holidays 2013", fontsize=70, color='white')
File "/home/vega6-x3/.local/lib/python3.5/site-packages/moviepy/video/VideoClip.py", line 1229, in __init__
raise IOError(error)
OSError: MoviePy Error: creation of None failed because of the following error:
convert: not authorized `@/tmp/tmpfa42vkjy.txt' @ error/property.c/InterpretImageProperties/3405.
convert: no images defined `PNG32:/tmp/tmpevkkuuf5.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
same issue with dancing knights on
ubuntu 16.04
python 2.7.14
Check ImageMagick permissions on "/etc/ImageMagick-6/policy.xml" you should change the none to read,write, maybe run: cat /etc/ImageMagick-6/policy.xml | sed 's/none/read,write/g'> /etc/ImageMagick-6/policy.xml
this worked for me
@speixoto This also worked for me. Thanks a lot for your support. I have one more question, would you recommend this changes on a system that accepts files from the public ? Or May be in a server ?
@adiwithadidas Well, yeah, in that case I would advice you to tweak policy to your needs. Check https://www.imagemagick.org/source/policy.xml
@speixoto ohh great. Thanks again for your help
@speixoto
It also helped me. thx
thanks it worked
thanks @speixoto ..it helped me..
file /etc/ImageMagick/policy.xml here,
changed <policy domain="path" rights="none" pattern="@*" />
to <policy domain="path" rights="read,write" pattern="@*" />
Most helpful comment
Check ImageMagick permissions on "/etc/ImageMagick-6/policy.xml" you should change the none to read,write, maybe run: cat /etc/ImageMagick-6/policy.xml | sed 's/none/read,write/g'> /etc/ImageMagick-6/policy.xml