跨平台相机API

发布于 2024-08-28 06:38:45 字数 505 浏览 13 评论 0原文

我现在正在构建一个视频转换过滤器,它必须实时转换视频帧。 滤波器的关键要求之一是具有高性能,以最大程度地减少转换过程中丢帧的数量。

另一个优先级较低但也很不错的要求是使其跨平台(PC 和移动设备)。

该应用程序是用 C++ 构建的。

现在我的问题是:

是否有任何 API 比 DirectShow 更可移植并且具有类似或更好的性能特征?因为 DirectShow 的可移植性仅限于基于 Windows 的设备(PC 和 Windows Mobile&CE 平台)。

我还注意到,例如使用 HTC 的自定义相机 API 的性能比 DirectShow 提供的要好得多。如果您想检查这一点,请尝试在 DirectShow 中构建一个过滤器,将每种颜色乘以 2 并从屏幕上的摄像头实时渲染该过滤器。然后对 HTC 的 API 进行同样的操作。供应商特定 API 的性能几乎提高了 4-5 倍。因此,如果该库使用特定于设备的驱动程序实现,那就太好了,因为在移动设备(大约 500 MHz)上执行此转换时性能至关重要。

I'm now building a video transforming filter that have to transform video frames in real-time.
One of the key requirements of the filter is to have high performance to minimize the number of dropped frames during the transform.

Another requirement that is of lower priority but also nice to have is to make it cross-platform (both PC's and Mobile devices).

The application is built in C++.

Now my question is:

is there any API that is more portable and has a similar or better performance characteristics than DirectShow? as DirectShow's portability is only limited to Windows-based devices (PCs and Windows Mobile&CE platforms).

Also I've notices that for example using HTC's custom camera API has far better performance than what DirectShow offers. If you want to check this, try to build a filter in DirectShow that will multiply each color by 2 and render that in real-time from camera on the screen. Then do the same with HTC's API. There is almost 4-5x performance boost with vendor's specific API. So it'd be very nice if the library used the device-specific implementation of the driver, as performance is critical when doing this transforms on a mobile device (which is about ~500 MHz).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

又怨 2024-09-04 06:38:45

opencv.org,它有一个非常简单的跨平台界面用于连接到摄像机,但是这是一个专为图像处理应用程序设计的复杂系统,并且不直接提供捕获。您需要处理帧并将它们流式传输到文件。另外,就性能而言,当我查看 openCV 时,它的 Windows 端似乎在 Windows 上使用了一个非常古老的 16 位视频框架:(。

您可以尝试诺基亚的 QT 应用程序框架。他们目前正在开发“QT”多媒体”库,可以满足您的需求。但是,这目前是测试版产品,我的经验(3-4 个月前)是 Windows 端口仍然需要一些工作。YMMV。
您必须安装 QT,然后从 qt.nokia.com/downloads/。根据您项目的时间范围,这可能是您的一个不错的选择...QT 绝对是一个不错的工具包。恕我直言。

There is opencv.org, which has an extremely simple cross-platform interface for connecting to video cameras, however this is a complex system designed for image processing applications, and does not directly provide capture. You would need to process your frames and stream them to a file. Also, as to performance, when I looked at openCV it appears that the windows side of it uses a very old 16bit video framework on Windows :(.

You might try Nokia's QT application framework. They are currently in the process of developing a "QT Multimedia" library that does what you want. However, this is currently a beta product, and my experience (3-4 months ago), has been that the Windows port is still needing some work. YMMV.
You will have to install QT, and then the "new QT APIS - Mobility Project" from the "other downloads section of the qt.nokia.com/downloads/. Depending on the timeframe of your project, this may be a good option for you... QT is definitely a nice toolkit IMHO.

大姐,你呐 2024-09-04 06:38:45

考虑在 OpenGL 着色器中进行,然后过滤器可以进行硬件加速,并且可以在桌面和 GLES 移动设备上运行(但它们不会完全兼容)。您可以通过这种方式(轻松)执行的操作有些限制,但是您在视频过滤中想要做的大多数事情当然可以完成。

Consider doing it in OpenGL shaders, then the filters can be hardware accelerated and they can run on desktop and GLES mobile devices (but they won't be fully compatible). The operations that you can (easily) perform this way are somewhat limited, but most things that you would like to do in video filtering can certainly be done.

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