[英]Play MP4 video using JMF
How to play MP4 video using JMF?如何使用 JMF 播放 MP4 视频?
I am creating Java application.我正在创建 Java 应用程序。 I want to play MP4 file using JMF.我想使用 JMF 播放 MP4 文件。 I tried to play MP4 file but it throws exception我试图播放 MP4 文件但它抛出异常
Could not create player for filename.mp4
Mpg format working fine for me. mpg 格式对我来说很好用。 But I have only MP4 files.但我只有 MP4 文件。
Code:代码:
Player mediaPlayer = Manager.createRealizedPlayer( mediaURL );
mediaPlayer.start();
Have a look at the JMF 2.1.1 - Supported Formats page and do a find on 'mp4'.查看JMF 2.1.1 - Supported Formats页面并查找“mp4”。 You'll notice no hits.你会注意到没有命中。
There is an old saying "You can't make a silk purse from a pig's ear" .有句老话“猪耳朵不能做丝包” 。 In this case "play MP4" is the "silk purse" and "JMF" is the "pig's ear" .在这种情况下, “播放 MP4”是“丝绸钱包”,而“JMF”是“猪耳朵” 。 JMF is far too old to support a wide variety of formats (many of which were released after the development on JMF ceased). JMF 太老了,无法支持多种格式(其中许多是在 JMF 开发停止后发布的)。
JMF is obsolete and buggy. JMF 已经过时且有缺陷。
JavaCV is a modern library for processing video based on OpenCV / FFMPEG and also supports 64bit which JMF does not. JavaCV 是一个基于 OpenCV / FFMPEG 处理视频的现代库,还支持 JMF 不支持的 64 位。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.