'convert: delegate library support not built-in '/usr/share/fonts/type1/gsfonts/n022003l.pfb' (Freetype) @ warning/annotate.c/RenderFreetype/1918

I'm trying to use moviepy to add subtitles to a video, but am getting an error when using Imagemagick:

OSError: MoviePy Error: creation of None failed because of the following error:

convert: delegate library support not built-in '/usr/share/fonts/type1/gsfonts/n022003l.pfb' (Freetype) @ warning/annotate.c/RenderFreetype/1918.
convert: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/422.
convert: no images defined `PNG32:/tmp/tmp04zb9u4d.png' @ error/convert.c/ConvertImageCommand/3322.
.

.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


This is my code:

def finish_video(self): 
        if self.video: 
            result = self.video.subclip(self.starttime, self.endtime).volumex(self.volume / 50)
        
            subs = []

            # add track for video
            if self.tracks: 
                for track in self.tracks: 
                    endTime = track['endTime']
                    startTime = track['startTime']
                    text = str(track['text'])
                    
                    textClip = TextClip(text, fontsize=30, color='red').set_position('bottom', 'center').set_duration(endTime-startTime)
            #         # result = CompositeVideoClip([result, textClip])
                
            return result
        
        return None

error in line textClip = TextClip(text, fontsize=30, color='red').set_position('bottom', 'center').set_duration(endTime-startTime) when I declare object TextClip.

Thanks you so much!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source