用 Java 播放视频

编程入门 行业动态 更新时间:2024-10-23 06:25:42
本文介绍了用 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 的替代品.已经有许多关于此的 SO 问题:

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 播放视频

本文发布于:2023-07-11 12:17:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1094030.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视频   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!