ImageMagick not detected by moviepy while using SubtitlesClip #693
Closed
Description
ubuntu 16.04
python3.6
- Install
apt-get -y install ffmpeg imagemagick
export FFMPEG_BINARY='/usr/bin/ffmpeg'
export IMAGEMAGICK_BINARY='/usr/bin/convert'
from moviepy.video.tools.subtitles import TextClip,SubtitlesClip
font="ArialUnicode"
color='white'
generator = lambda txt: TextClip(txt, font=font, fontsize=40, color=color)
subtitles = SubtitlesClip("big3.srt",generator)
- Error
[MoviePy] This command returned an error !--------------------------------------------------------
OSError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/moviepy/video/VideoClip.py in __init__(self, txt, filename, size, color, bg_color, fontsize, font, stroke_color, stroke_width, method, kerning, align, interline, tempfilename, temptxt, transparent, remove_temp, print_cmd)
1219 try:
-> 1220 subprocess_call(cmd, verbose=False )
1221 except (IOError,OSError) as err:
/usr/local/lib/python3.6/dist-packages/moviepy/tools.py in subprocess_call(cmd, verbose, errorprint)
48 verbose_print(errorprint, "\n[MoviePy] This command returned an error !")
---> 49 raise IOError(err.decode('utf8'))
50 else:
OSError: convert: not authorized `@/tmp/tmpatq66tt_.txt' @ error/property.c/InterpretImageProperties/3405.
convert: no images defined `PNG32:/tmp/tmp4uy8drq2.png' @ error/convert.c/ConvertImageCommand/3210.
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)
<ipython-input-3-923a31c238ba> in <module>()
----> 1 subtitles = SubtitlesClip("big3.srt",generator)
/usr/local/lib/python3.6/dist-packages/moviepy/video/tools/subtitles.py in __init__(self, subtitles, make_textclip)
84
85 self.make_frame = make_frame
---> 86 hasmask = (self.make_textclip('T').mask is not None)
87 self.mask = (VideoClip(make_mask_frame, ismask=True) if hasmask else None)
88
<ipython-input-2-31100183c052> in <lambda>(txt)
1 font="ArialUnicode"
2 color='white'
----> 3 generator = lambda txt: TextClip(txt, font=font, fontsize=40, color=color)
/usr/local/lib/python3.6/dist-packages/moviepy/video/VideoClip.py in __init__(self, txt, filename, size, color, bg_color, fontsize, font, stroke_color, stroke_width, method, kerning, align, interline, tempfilename, temptxt, transparent, remove_temp, print_cmd)
1227 "path to the ImageMagick binary in file conf.py, or."
1228 "that the path you specified is incorrect" ))
-> 1229 raise IOError(error)
1230
1231 ImageClip.__init__(self, tempfilename, transparent=transparent)
OSError: MoviePy Error: creation of None failed because of the following error:
convert: not authorized `@/tmp/tmpatq66tt_.txt' @ error/property.c/InterpretImageProperties/3405.
convert: no images defined `PNG32:/tmp/tmp4uy8drq2.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
What should I do ?