0

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();
double-beep
  • 5,031
  • 17
  • 33
  • 41
Manoj
  • 3,947
  • 9
  • 46
  • 84
  • http://stackoverflow.com/questions/10085522/playing-media-files-using-java –  May 16 '13 at 14:22

2 Answers2

3

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).

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
1

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.

Chaoslab
  • 33
  • 8