问题描述
- python VideoCapture使用时,报错
-
python 3.4.3
VideoCapture VideoCapture-0.9.5-cp34
Pillow 3.0代码:
import os
from VideoCapture import Device
import timeSLEEP_TIME = 3
i = 0
cam = Device(devnum=0, showVideoWindow=0)
while i < 10:
cam_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
cam_name = 'camera' + cam_time + '.jpg'
cam.saveSnapshot(cam_name, 3, 1, 'bl')
os.remove(cam_name)
time.sleep(SLEEP_TIME)
i += 1运行时,提示
File "D:Python34libsite-packagesVideoCapture__init__.py", line 234, in saveSnapshot
self.getImage(timestamp, boldfont, textpos).save(filename, **keywords)
File "D:Python34libsite-packagesVideoCapture__init__.py", line 154, in getImage
'RGB', (width, height), buffer, 'raw', 'BGR', 0, -1)
File "D:Python34libsite-packagesPILImage.py", line 2053, in fromstring
"Please call frombytes() instead.")
Exception: fromstring() has been removed. Please call frombytes() instead.请问有什么解决办法
解决方案
都没有人回复,,我也碰到这个问题了。感觉像库不兼容