使用哪个 Java 库来录制连接的摄像机的视频?

发布于 2024-11-24 22:05:25 字数 730 浏览 0 评论 0 原文

您可能认为有一个简单的解决方案,但没有:(

我的应用程序需要从 USB/火线(或任何连接)连接的相机捕获流(结果将是一个类似 的文件我希望能够检测所有连接的摄像机并选择使用哪一个(同时使用一个或多个 -> 一个或多个输出文件必须是跨平台的)。 .

找到的库:

  1. Xuggle - 不太适合操作图像和视频。
  2. href /www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html" rel="noreferrer">JMF - 一个旧的 API,但如果我可以使用它,我会的。我不没有看到 MAC 操作系统下载页面上的 X 链接
  3. FMJ - 看起来像是 JMF 的更好版本,但找不到 。
  4. LTI-CIVIL - FMJ 使用它 看起来它只捕获来自相机的图像(而不是视频)。我可以使用 Xuggle 根据 LTI-CIVIL 拍摄的图像创建视频。而且和FMJ一样,安装起来也很困难。

您对此有何建议?

You would have thought that tere is a simple solution to this but there isn't :(

My application needs to capture a stream from a USB/firewire (or whatever is the connection) connected camera (result would be a file like output.flv). I would prefer that I can detect all connected cameras and choose which one to use (one or more at the same time --> one or more output files). Application has to be cross platform.

Found libraries:

  1. Xuggle - not very good camera support. Good for manipulating over images and video.
  2. JMF - an old API but if I can use it, I will. I don't see a MAC OS X link on downloads page.
  3. FMJ - looks like a better version of JMF but a can't find a way of installing it.
  4. LTI-CIVIL - FMJ uses it. It looks like it only captures images from camera (not video). I could use Xuggle to create a video from images taken from LTI-CIVIL. And like FMJ, it is difficult to install.

What are your suggestions on this one?

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

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

发布评论

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

评论(2

上课铃就是安魂曲 2024-12-01 22:05:25

为此我推荐 VLCj - 它应该能够毫无困难地从网络摄像头流式传输到 Java 画布上。它使用本机代码,因此您需要提供 libvlc.so / dll,但从那里它应该可以在所有主要平台(Windows、Mac、Linux)上运行。

您可能需要查看进程外播放器以获得完整的可靠性,这有点复杂(请参阅这里是我迄今为止的努力),但是一旦你把它放在适当的位置,它应该可以正常工作。

I'd recommend VLCj for this - it should be able to stream from webcams onto a Java canvas without any difficulties. It uses native code so you need to provide libvlc.so / dll but from there on it should work on all the major platforms (Windows, Mac, Linux).

You may need to look at out of process players for complete reliability which is a bit more complex (see here for my efforts so far) but once you've got that in place it should work fine.

小苏打饼 2024-12-01 22:05:25

Java 确实没有很好的相机支持。您必须通过 JNI 使用针对每个平台量身定制的本机代码来获取项目的视频捕获。

有一个相关的问题这里< /a>.基本上他们建议使用 JNI 包装 OpenCV

There really is no good camera support for Java. You will have to use native code, tailored for each platform, through JNI to get video capture for your project.

There's a related question here. Basically they're suggesting OpenCV wrapped with JNI.

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