[英]How to create a media player in Java without JMF?
How to create a media player in Java without using the JMF? 如何在不使用JMF的情况下使用Java创建媒体播放器? Some blogs say it's an old version. 一些博客称这是旧版本。 I also tried using JMF - this is my code. 我也尝试过使用JMF - 这是我的代码。
public class MediaPlayer {
public static void main(String[] args) {
Player p;
try {
p = Manager.createPlayer(new URL("http://192.168.1.113/asmitha/1.mp4"));
p.start();
} catch (NoPlayerException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
This is the message I am getting: 这是我得到的信息:
LINEAR, Unknown Sample Rate * out * LINEAR, 8000.0 Hz, 16-bit, Stereo, LittleEndian, Signed, class [S
JMF 2.1 is the latest version, and that was released a long time ago. JMF 2.1是最新版本,很久以前就发布了。 JMF will probably not support all codec formats. JMF可能不支持所有编解码器格式。 That is probably why you are not able to play the file. 这可能是你无法播放文件的原因。 There are also a lot of codec licensing issues. 还有很多编解码器许可问题。
There is a JMF performance pack for windows & *nix which will support more codecs than the default installation. 有一个用于windows&* nix的JMF性能包,它将支持比默认安装更多的编解码器。 Try that. 试试吧。 If that doesn't work take a look at ffmpeg or VLC-J . 如果这不起作用,请查看ffmpeg或VLC-J 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.