2016-04-27 46 views
0

我正在使用moviepy嘗試調整視頻片段的大小,但每次嘗試時都會出現此錯誤。任何人都可以解釋我如何解決它?由於使用Python旋轉視頻3.4

我的Python代碼

Import everything needed to edit video clips 
from moviepy.editor import * 

# Load video clip 
myclip = VideoFileClip("dog.mov") 
myclip.resize((460,720)) # New resolution: (460,720) 
myclip.write_videofile("resized_clip.mp4") #write new video file 

錯誤

File "/usr/local/lib/python3.4/dist-packages/PIL/Image.py", line 699, in tostring 
    "Please call tobytes() instead.") 
Exception: tostring() has been removed. Please call tobytes() instead. 
+0

https://github.com/Zulko/moviepy/issues/241 – interjay

回答

1

看起來你正在使用PIL,我會嘗試使用Pillow,即保持了支撐叉。 MoviePY建議你用枕頭代替弼在它的文檔:

http://zulko.github.io/moviepy/install.html

對於先進的圖像處理,您將需要一個或幾個 包。例如,使用clip.resize方法要求在 安裝了Scipy,PIL,Pillow或OpenCV中的至少一個。

Python成像庫(PIL)或更好的是它的分支枕頭。

+0

謝謝。我的系統似乎認爲枕頭已經安裝,但似乎影片堅持使用PIL來代替。 ? – JulianJ