Java 中的 FMJ 视频捕获

发布于 2024-10-27 20:40:00 字数 894 浏览 1 评论 0原文

我正在尝试从通过 USB 连接的网络摄像头捕获视频,但由于某种原因 FMJ 无法加载或找到注册表文件。当我尝试运行我的程序时,每次调用 FMJ 函数都会产生警告:

[time] net.sf.fmj.utility.Registry <init>
WARNING: Problem loading JMF registry: org/jdom/JDOMException. Using Defaults

因此,它无法识别网络摄像头并且程序失败。 相同的程序适用于 JMF,但为了使其跨平台,我正在迁移代码。我已经卸载了 JMF,但我不明白为什么它试图加载 JMF 注册表。运行 fmjregistry.bat 时,我还收到以下错误:

FINE: PlugInUtility: Unable to register plugin net.sf.fmj.ffmpeg_java
FINE: PlugInUtility: Unable to register plugin net.sf.fmj.theora_java.NativeOggParser
FINE: PlugInUtility: Unable to register plugin com.omnividea.media.parser.video.Parser
FINE: PlugInUtility: Unable to register plugin com.omnividea.media.codec.video.NativeDecoder
FINE: PlugInUtility: Unable to register plugin com.omnividea.media.codec.video.JavaDecoder

以上均为 java.lang.ClassNotFoundException

请帮忙,使用 java 的视频真是太令人头疼了

I'm trying to capture video from a webcam connected via usb, but for some reason FMJ can't load or find the registry file. When I try to run my program, every call to a FMJ function produces the warning:

[time] net.sf.fmj.utility.Registry <init>
WARNING: Problem loading JMF registry: org/jdom/JDOMException. Using Defaults

Consequently, it doesn't recognize the webcam and the program fails.
The same program works with JMF, but in an effort to make it cross-platform, I'm migrating the code over. I have uninstalled JMF, but I don't understand why its trying to load the JMF registry. I also get the following errors when running fmjregistry.bat:

FINE: PlugInUtility: Unable to register plugin net.sf.fmj.ffmpeg_java
FINE: PlugInUtility: Unable to register plugin net.sf.fmj.theora_java.NativeOggParser
FINE: PlugInUtility: Unable to register plugin com.omnividea.media.parser.video.Parser
FINE: PlugInUtility: Unable to register plugin com.omnividea.media.codec.video.NativeDecoder
FINE: PlugInUtility: Unable to register plugin com.omnividea.media.codec.video.JavaDecoder

all of the above are java.lang.ClassNotFoundException

Please help, video with java is such a big headache

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

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

发布评论

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

评论(1

仅此而已 2024-11-03 20:40:00

这个问题可能有点老了,但对于那些面临同样问题的人(像我一样),这里是答案。

FMJ 要求 JDOM(而不是 JDOM2)包含在类路径中,因为它使用它来读取

C:\Documents And Settings\[user]\.fmj.registry.xml 

此文件包含 FMJ 注册表中的设置。 JDOM jar 位于您从其主页下载的 FMJ 包内的 libs 目录中。您可以复制它并包含在您的项目构建路径中,或者如果您是 Maven 用户,则添加依赖项:

<dependency>
    <groupId>org.jdom</groupId>
    <artifactId>jdom</artifactId>
    <version>1.1.3</version>
</dependency>

不要忘记添加其他所需的库;]

如果不是这种情况,则还有其他可能的选项:

  1. 您的程序没有读取此文件的权限,或者
  2. 此文件内容的 XML 语法格式错误(XML 不正确) - 在这种情况下,要查找 XML 代码中的错误,您可以使用在线提供的免费 XML 验证器之一对其进行验证

This question can be a little old, but for those who are facing the same problem (like I), here is the answer.

FMJ requires JDOM (and NOT JDOM2) to be included in classpath because it use it to read

C:\Documents And Settings\[user]\.fmj.registry.xml 

This file contains settings from FMJ registry. JDOM jar is located in libs directory within FMJ pack you downloaded from its home page. You can either copy it and include in yours project build path, or add dependency if you are a Maven user:

<dependency>
    <groupId>org.jdom</groupId>
    <artifactId>jdom</artifactId>
    <version>1.1.3</version>
</dependency>

Don't forget to add other required libraries ;]

If this is not the case, then there are other possible options:

  1. Your program do not have permissions to read this file, or
  2. XML syntax of this file content is malformed (incorrect XML) - in this case, to find a bug in XML code, you can validate it with one of the free XML validators available online
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文