error on test app

Hi there,

I downloaded a sample application from the IBM website where they provide a tutorial on the Java Media Framework. Even though the JMF is supposed to support mpeg and mp3 file formats, every time I attempt to load such a file I keep getting the following error message:

Unable to handle format: MPEG, 256x192, FrameRate=24.0, Length=73728

With mp3 files I get the following error message:

Unable to handle format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian,

Signed, 16000.0 frame rate, FrameSize=32768 bits

Failed to realize: com.sun.media.PlaybackEngine@1dd3812

Error: Unable to realize com.sun.media.PlaybackEngine@1dd3812

javax.media.CannotRealizeException

at javax.media.Manager.blockingCall(Manager.java:2005)

at javax.media.Manager.createRealizedPlayer(Manager.java:554)

at MediaPlayerFrame.setMediaLocator(MediaPlayerFrame.java:158)

at MediaPlayerFrame.main(MediaPlayerFrame.java:232)

For the mpeg file, the interface loads and I am able to play the audio portion of the file, but no video content is displayed. The mp3 file simply doesn't load. Anybody have any idea as to whats going on? Is there a way to make it work?These files play just fine in the Windows Media Player.

Following are snippets of code from the sample app:

publicvoid setMediaLocator(MediaLocator locator)throws IOException,

NoPlayerException, CannotRealizeException{

// create a new player with the new locator. This will effectively

// stop and discard any current player.

setPlayer(Manager.createRealizedPlayer(locator));

}

/**

* Sets the player reference. Setting this to a new value will discard

* any Player which already exists. It will also refresh the contents

* of the pane with the components for the new player. A null value will

* stop the discard the current player and clear the contents of the

* frame.

*/

publicvoid setPlayer(Player newPlayer){

// close the current player

closeCurrentPlayer();

player = newPlayer;

// refresh the tabbed pane.

tabPane.removeAll();

if (player ==null)return;

// add the new main panel

tabPane.add(CONTROL_PANEL_TITLE, createMainPanel());

// add any other controls which may exist in the player. These

// controls should already contain a name which is used in the

// tabbed pane.

Control[] controls = player.getControls();

for (int i = 0; i < controls.length; i++){

if (controls[i].getControlComponent() !=null){

tabPane.add(controls[i].getControlComponent());

}

}

}

Alan

Message was edited by:

ashiers

[3657 byte] By [ashiersa] at [2007-11-27 0:02:32]
# 1
For MP3-Have you installed the MP3 plugin as well http://java.sun.com/products/java-media/jmf/mp3/download.html
Stefan_Marica at 2007-7-11 15:55:04 > top of Java-index,Security,Cryptography...
# 2

Thanks for the heads up. I didn't have the MP3 plugin installed. I downloaded it and installed it.

Now when I attempt to run the test app I get a new error message:

C:\Temp2\ibm>java -classpath "C:\Temp2\ibm;C:\JMF\JMF-2.1.1e\lib\jmf.jar" MediaPlayerFrame rtp://192.168.2.120:49150/audio

RTP Handler internal error: javax.media.ControllerErrorEvent[source=com.sun.media.content.unknown.Handler@1e328e0,message=Internal module com.sun.media.BasicRendererModule@1766806: failed to handle a data format change!]

What does all that mean? What am I doing wrong now?

Alan

ashiersa at 2007-7-11 15:55:04 > top of Java-index,Security,Cryptography...