Unable to create a textclip in moviepy (imagemagick succesfully installed?) - got Utf8 Error

扶醉桌前 提交于 2019-12-08 08:57:42

问题


i got this error when using moviepy with "TextClip": 'utf8' codec can't decode byte 0x84 in position 5: invalid start byte

Imagemagick and wand are (proper?) installed. Does anybody knows a possible solution?


回答1:


Apparently moviePy expects non unicode strings (file moviepy/video/VideoClip.py, line 1095). the workaround for this would be to decode your unicode strings before passing them to the TextClip:

if isinstance(mytext, unicode):
    mytext = mytext.encode('latin1')

EDIT

MoviePy expects UTF8 strings (non unicode), so the above becomes

if isinstance(mytext, unicode):
    mytext_str = mytext.encode('utf8')


来源:https://stackoverflow.com/questions/28659955/unable-to-create-a-textclip-in-moviepy-imagemagick-succesfully-installed-go

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!