从 FireWire 获取视频流
我正在尝试通过 FireWire 将摄像机 (Sony HVR-Z1E) 中的视频流式传输到我的计算机。传入的图片/流应由一些期望 CVMat 格式(来自 openCV )的函数进一步处理。 好吧,我现在的问题是我不知道如何获取流。好吧,openCV 2.1 为我提供了一些方法( cvCapturefromCam ),但无论我给他哪个参数,它总是从笔记本电脑的网络摄像头获取流,而不是从火线获取流。我听说我需要在 DirectShow API 中切换主摄像头(使用 Windows SDK)。但我实际上也不知道该怎么做。 那么有什么建议如何做到这一点?
I'm trying to stream a video from a camera ( Sony HVR-Z1E ) over FireWire to my Computer. The incoming pictures/stream shall be processed further by some functions which expect the CVMat format ( from openCV ).
Well my problem is now that I have no idea how to grab the stream. Okay openCV 2.1 offers me some methods ( cvCapturefromCam ) , but no matter which parameter I give him, it always gets the stream from the webcam of the laptop and not from the firewire. I heard I need to switch the primary cam in the DirectShow API ( with the Windows SDK ). But I actually don't know how to do that either.
So any suggestions how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅我的相关答案此处。 OpenCV 本身无法从 Firewire 摄像头捕获视频。您需要使用 CMU1394 驱动程序或 Sony 驱动程序(如果有可用的 SDK)从该相机捕获视频,然后将其传递给 OpenCV。
See my related answer here. OpenCV cannot capture video from Firewire cameras natively. You will either need to use the CMU1394 driver, or the Sony driver (if an SDK is available for it) to capture video from that camera, and then pass it to OpenCV.
几年前,我使用 DirectShow 制作过类似的东西。主要的限制是,通过 DShow 获取的图像采用标准 PAL 分辨率。高清图像抓取是不可能的(它是索尼第一批面向消费者的高清摄像机之一,现在不记得确切的型号了)。好处是 - 这个方法除了裸露的 DirectShow 之外不需要任何东西 - 不需要额外的驱动程序等等。而且速度非常快。
一般来说,方法是这样的:
它是如何工作的:
我知道,这是一个有点模糊的描述,但我希望您能找到您的信息(谷歌搜索“ISampleGrabberCB”应该是一个很好的起点,应该有很多示例代码)。
Years ago, I've made something like this using DirectShow. The main limitation was fact, that image acquired via DShow was in standard PAL resolution. HD Image grabbing was not possible (it was one of the first pro-consumer HD camcorders from Sony, don't remember exact model now). Good thing was - this method didn't need anything except bare DirectShow - no additional drivers and so on. And it was VERY fast.
In general, method was something like this:
How it worked:
I know, that's a bit fuzzy description, but I hope You'll find Your info (googling for "ISampleGrabberCB" should be a good starting point, there should be a lot of sample code).