我创建了一个包含三个按钮的 wxpython 框架,在将视频格式化到 wxpanel 上时出现问题
这就是我流式传输网络摄像头的方式。
#code for the stream of webcam to frame
pygame.camera.init()
screen = pygame.display.set_mode((220,220))
cam = pygame.camera.Camera("/dev/video0", (220,220))
cam.start()
while 1:
image = cam.get_image()
screen.blit(image,(0,0))
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
这是面板的代码
self.panel = wx.Panel(self, -1, (550, 20), (410, 500), style=wx.SUNKEN_BORDER)
如何将我的摄像头屏幕放入面板中。
请您参考如下方法:
我还没有听说过有人在 wxPython 中使用 PyGame 作为网络摄像头。为什么不直接在 PyGame 窗口中显示提要呢?
或者,您可以将 openCV 与 wxPython 一起用于网络摄像头,详见以下链接:
- http://wxpython-users.1045709.n5.nabble.com/OpenCV-2-1-Integration-video-capture-into-wxPython-td3281960.html
- wxPython Camera Input
- http://wxpython-users.1045709.n5.nabble.com/Need-a-WebCam-Recorder-in-WxPython-td4577867.html
您还可以使用 MPlayerCtrl 查看网络摄像头源。这里有一些关于在 wxPython 中使用 MPlayerCtrl 的链接:
