Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when running the first example of text overlay in ubuntu 16.04 with python3 #703

Closed
adiwithadidas opened this issue Jan 29, 2018 · 10 comments

Comments

@adiwithadidas
Copy link

adiwithadidas commented Jan 29, 2018

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
@adiwithadidas adiwithadidas changed the title Issue when running the first example of text overlay Issue when running the first example of text overlay in ubuntu 16.04 with python3 Jan 29, 2018
@lhammond
Copy link

lhammond commented Feb 6, 2018

same issue with dancing knights on
ubuntu 16.04
python 2.7.14

@speixoto
Copy link

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

@mattvenn
Copy link

this worked for me

@adiwithadidas
Copy link
Author

adiwithadidas commented Feb 15, 2018

@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 ?

@speixoto
Copy link

@adiwithadidas Well, yeah, in that case I would advice you to tweak policy to your needs. Check https://www.imagemagick.org/source/policy.xml

@adiwithadidas
Copy link
Author

@speixoto ohh great. Thanks again for your help

@nashory
Copy link

nashory commented Sep 26, 2018

@speixoto
It also helped me. thx

@sharunspi
Copy link

thanks it worked

@yourtechfriend
Copy link

yourtechfriend commented Jun 25, 2020

thanks @speixoto ..it helped me..

@KiLLAAA
Copy link
Contributor

KiLLAAA commented Aug 12, 2020

file /etc/ImageMagick/policy.xml here,
changed <policy domain="path" rights="none" pattern="@*" />
to <policy domain="path" rights="read,write" pattern="@*" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants