2016-05-15 125 views
0

我想創建一個與棒 視頻縮略圖和我嘗試運行,下面的命令:如何使用魔杖爲視頻創建縮略圖?

>>> from wand.image import Image 
>>> vid = Image(filename='example.mp4') 

,但我得到一個錯誤信息:

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/home/leiz/.local/lib/python2.7/site-packages/wand/image.py", line 2534, in __init__ 
    self.read(filename=filename, resolution=resolution) 
    File "/home/leiz/.local/lib/python2.7/site-packages/wand/image.py", line 2601, in read 
    self.raise_exception() 
    File "/home/leiz/.local/lib/python2.7/site-packages/wand/resource.py", line 222, in raise_exception 
    raise e 
wand.exceptions.BlobError: unable to open image `/tmp/magick-24346h472NGIWl2wR.pam': No such file or directory @ error/blob.c/OpenBlob/2709 

我敢肯定,文件「的例子。 mp4'存在,它讓我困惑不已。

回答

0

看起來您需要安裝應用程序。 ImageMagick的經過.mp4文件通過調用以下

"ffmpeg" -nostdin -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z" 

因此,如果沒有安裝ffmpeg,那麼唯一的中間文件不存在委託,你會看到消息

unable to open image [PATH]: No such file or directory @ error/blob.c/OpenBlob/2709 

或甚至

delegate failed [COMMAND] @ error/delegate.c/InvokeDelegate/1332.