从 FireWire 获取视频流

发布于 2024-12-11 21:17:18 字数 284 浏览 0 评论 0原文

我正在尝试通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

執念 2024-12-18 21:17:18

请参阅我的相关答案此处。 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.

心意如水 2024-12-18 21:17:18

几年前,我使用 DirectShow 制作过类似的东西。主要的限制是,通过 DShow 获取的图像采用标准 PAL 分辨率。高清图像抓取是不可能的(它是索尼第一批面向消费者的高清摄像机之一,现在不记得确切的型号了)。好处是 - 这个方法除了裸露的 DirectShow 之外不需要任何东西 - 不需要额外的驱动程序等等。而且速度非常快。

一般来说,方法是这样的:

  • 构建媒体渲染图(当然,您必须在该阶段枚举视频设备),
  • 插入从 ISampleGrabberCB 继承的自定义类。

它是如何工作的:

  • 它使用 ISampleGrabberCB 中的 BufferCB() 虚拟方法 - 您必须在继承的类中编写该方法。
  • 在提到的方法中,您必须将数据保留在全局结构中,并从主线程中处理它们。

我知道,这是一个有点模糊的描述,但我希望您能找到您的信息(谷歌搜索“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:

  • building media render graph (of course, You have to enumerate video devices in that stage)
  • inserting into it custom class which inherited from ISampleGrabberCB.

How it worked:

  • it used BufferCB() virtual method from ISampleGrabberCB - which you have to write in your inherited class.
  • in mentioned method, you have to leave data in global struct, and from main thread - take care of them.

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文