Java 中的 FMJ 视频捕获
我正在尝试从通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题可能有点老了,但对于那些面临同样问题的人(像我一样),这里是答案。
FMJ 要求 JDOM(而不是 JDOM2)包含在类路径中,因为它使用它来读取
此文件包含 FMJ 注册表中的设置。 JDOM jar 位于您从其主页下载的 FMJ 包内的 libs 目录中。您可以复制它并包含在您的项目构建路径中,或者如果您是 Maven 用户,则添加依赖项:
不要忘记添加其他所需的库;]
如果不是这种情况,则还有其他可能的选项:
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
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:
Don't forget to add other required libraries ;]
If this is not the case, then there are other possible options: