简体   繁体   中英

Play MP4 video using JMF

How to play MP4 video using JMF?

I am creating Java application. I want to play MP4 file using JMF. I tried to play MP4 file but it throws exception

Could not create player for filename.mp4

Mpg format working fine for me. But I have only MP4 files.

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'. 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" . JMF is far too old to support a wide variety of formats (many of which were released after the development on JMF ceased).

JMF is obsolete and buggy.

JavaCV is a modern library for processing video based on OpenCV / FFMPEG and also supports 64bit which JMF does not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM