ctao707
2015-10-21 09:49python VideoCapture使用时,报错
python 3.4.3
VideoCapture VideoCapture-0.9.5-cp34
Pillow 3.0
代码:
import os
from VideoCapture import Device
import time
SLEEP_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:\Python34\lib\site-packages\VideoCapture__init__.py", line 234, in saveSnapshot
self.getImage(timestamp, boldfont, textpos).save(filename, **keywords)
File "D:\Python34\lib\site-packages\VideoCapture__init__.py", line 154, in getImage
'RGB', (width, height), buffer, 'raw', 'BGR', 0, -1)
File "D:\Python34\lib\site-packages\PIL\Image.py", line 2053, in fromstring
"Please call frombytes() instead.")
Exception: fromstring() has been removed. Please call frombytes() instead.
请问有什么解决办法
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- 关于VSCode里运行Python报错Module 'cv2' has no 'xxx' member的问题
- python
- 3个回答
- python的opencv打开两个摄像头失败
- python
- 1个回答
- yolo video python cv2图像转PIL fromarray报错
- python
- 1个回答
- 通过pipe使用ffmpeg推流视频流处理出错
- python
- 2个回答