使用 Python 中的 GStreamer 从网络摄像头抓取随机帧
我正在尝试编写一个程序来通过解释来自网络摄像头的帧来控制机器人,并且偶然发现了 GStreamer。
在此页面的帮助下,我已经能够使用 GStreamer 从网络摄像头以 Python 流式传输视频: http://www.ndeschildre.net/2008/04/04/python -power/
但是,我不知道如何从管道中请求单个 RGB 编码的帧,虽然我设法找到并阅读了一些文档,但我没有找到明显的答案。
有人有什么想法吗?
编辑:我首先尝试使用 OpenCV 来解决这个问题,但是缓冲区没有保持原样,并且导致连续的图像无法从缓冲区的左上角开始。 (操作系统为Ubuntu Linux)
I'm trying to write a program to control a robot by interpreting frames from a webcam and happened upon GStreamer.
I've been able to stream video in Python from the webcam with GStreamer with help from this page:
http://www.ndeschildre.net/2008/04/04/python-power/
However, I don't know how to ask for a single RGB-encoded frame from the Pipeline, and while I've managed to find and read some of the documentation, I've found no obvious answer.
Does anyone have any ideas?
EDIT: I've attempted to use OpenCV to solve this problem first, but the buffer isn't staying put or something, and is causing successive images to not start at the top left corner of the buffer.
(operating system is Ubuntu Linux)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 Gnome photobooth 应用程序 cheese 的源代码。
您也可以尝试 usersink。
Look at the source code for cheese, the Gnome photobooth application.
You could also try the usersink.
我听说 OpenCV 的 Python 绑定取得了一些成功。这是这些成功之一: http://blog.jozilla.net/2008/06/27/fun-with-python-opencv-and-face-detection/
I've heard of some success with OpenCV's Python bindings. Here is one of those successes: http://blog.jozilla.net/2008/06/27/fun-with-python-opencv-and-face-detection/