Playing video in Java(用Java播放视频)
问题描述
我需要在我的 JFrame 中播放视频.我环顾四周,安装了 Java 媒体框架,尝试了很多方法,媒体面板似乎不起作用,而且我不理解 Player.如果有人能告诉我在 JFrame 中播放视频的简单方法,或者甚至可以告诉我调用哪些方法,那就太好了.
I need to play a video in my JFrame. I've looked around and I have installed the Java media framework and I've tried numerous ways, media panel doesn't seem to work and I don't understand Player. If someone could tell me an easy way to play a video inside a JFrame or even which methods to call that would be great.
(我的 .avi 文件与 .class 和 .java 文件位于同一目录中)
( I also have the .avi file in the same directory as the .class and .java files )
推荐答案
JMF基本上死了.
我没有使用 Swing 播放视频的第一手经验,但是 这里有一个列表您可以尝试 JMF 的替代品.还有一些关于这个的问题:
JMF is basically dead.
I don't have first-hand experience with playing video with Swing, but here's a list of alternatives to JMF you might try. There are also a number of SO questions about this already:
- 用 Java 播放视频(JMF、Fobs4JMF、Xuggler、FMJ)
- JMF 替换
基于这些,看起来 Xuggler 是解决方案.
Based on those, it looks like Xuggler is the solution.
这篇关于用Java播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用Java播放视频


基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 降序排序:Java Map 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01