★ wanayoo — archive 1999 http://java.sun.com/products/java-media/jmf/forDevelopers/jmffaq.htmlNouvelle recherche | Portail wanayoo
Java Technology Home Page
A-Z Index

The Source for Java Technology

 

Downloads, APIs, Documentation
Java Developer Connection
Docs, Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide

JMF

JMF Frequently Asked Questions

This collection of frequently asked questions (FAQ) provides brief answers to many common questions about the JavaTM Media Framework API (JMF).

More answers can be found by searching the jmf-interest email archive at http://archives.java.sun.com/archives/jmf-interest.html




General Q+A Index


JMF 2.0 Question Index


JMF 2.0 Troubleshooting Index


JMF 1.1 Question Index


General Q+A

Q: What is the Java Media Framework API (JMF)?

The Java Media Framework API (JMF) specifies a simple, unified architecture to synchronize and control audio, video and other time-based data within Java applications and applets.

For the purposes of this FAQ, "JMF" or "JMF API" refers to both the specification (as generated from javadoc) and the reference implementations that Sun provides with the specification.

The JMF 1.0 API specifies playback behavior and was developed by Sun Microsystems, Inc., Silicon Graphics Inc., and Intel Corporation.

The JMF 2.0 API specifies playback, capture, transmission and transcode behavior, and was developed Sun Microsystems, Inc., and IBM; both companies are jointly working on a refererence implementation together.

Q: What is JMF 1.0?

The JMF API is being developed in stages. JMF 1.0, also known as the "Java Media Player", is the first release of the JMF API and concentrates on media "playback", that is the synchronization, control, processing, and presentation of compressed streaming and stored time-based media, such as audio, video and MIDI.

Sun released two reference implementations of JMF 1.0 for Windows and Solaris.

Q: What is JMF 1.1?

This is a dot release which added two version of JMF written entirely in the Java programming language, allowing JMF to be used on all JDK 1.1 Java CompatibleTM systems.

Note this is not a new API release; the same JMF 1.0 API was used for both JMF 1.0 and 1.1 implementations from Sun Microsystems, Inc.

Q: What is JMF 2.0?

JMF 2.0 is the second release of the JMF API. Where JMF 1.0 and 1.1 provide a versatile player for time-based media, JMF 2.0 features media capture, a pluggable codec architecture, and greater control over media data so that developers can make greater customizations and optimizations.

Q: Is JMF source code available?

Yes. JMF 2.0 source code is available to be licensed. For pricing, please send inquiries to jmf-licensing@sun.com

Q: Where is the JMF home page?

JMF software and documentation can be downloaded from its home page at http://java.sun.com/products/java-media/jmf

Q: Where can I ask questions about JMF?

Questions about JMF can be emailed to jmf-interest@java.sun.com

This general purpose, public email forum allows JMF developers to answer questions and help other developers understand JMF.

Q: How do I report JMF bugs?

JMF bugs can be emailed to jmf-bugs@sun.com

This one-way email drop goes directly to the JMF developers. Please include as much information about the bug you found in your report, including

  • JMF version (e.g. JMF 1.1 or JMF 2.0 beta 2)
  • JDK version (e.g. JDK 1.1.6 or Java 2 ver 1.2)
  • Platform you are running on (e.g. Win98 or Solaris 2.6)
  • Hardware info (e.g. PII, 266 Mhz, 64 MB RAM, Rave 500 sound card)
  • Any exception stack trace, if one was generated
  • The media URL is available, or (if under 2 MB) the actual media data which caused the problem

Remote debugging of problems can be very tricky, so any information you can send will be helpful.

Q: Are there any books about JMF?

Yes. Here are the ones we know about.

Core Java Media Framework

by Linden deCarmo
Published by Prentice Hall
ISBN 0130115193

Essential JMF: Java Media Framework

by Gordon and Talleyby Prentice Hall
Published by Prentice Hall
ISBN 0130801046

Programming with the Java Media Framework

by Sullivan, Winzeler, Deagen, and Brown
Published by John Wiley and Sons
ISBN 0471251690

These books document the JMF 1.0 API; since the JMF 2.0 API has just been finalized in November 1999, no books describing JMF 2.0 exist yet (that we are aware of).

If you know of a book that is not on this list, please let us know so we can add it. Send email to jmf-comments@sun.com

Q: How is the Java Sound API related to JMF?

JMF uses the Java Sound API for sound rendering. This API will become a core API in Java 2 version 1.3. It will also be bundled with JMF 2.0, which allows its superior sound functionality to be accessed on the JDK 1.1.x platform.

More information about the Java Sound API can be found at http://java.sun.com/products/java-media/sound


JMF 2.0 Questions and Answers

Q: Where can I find JMF 2.0?

JMF 2.0 can be downloaded from http://java.sun.com/products/java-media/jmf

Note that JMF 2.0 supercedes JMF 1.1, and contains all the playback functionality of JMF 1.1 and adds new functionality such as capture, transmit, transcode and a plugin architecture.

Q: How can I provide feedback on the JMF 2.0 API?

Feedback can be emailed to jmf-comments@sun.com

This one-way email drop goes directly to the JMF API designers.

Note the JMF 2.0 API is frozen. Feedback is still welcomed, and will be considered for future JMF API specificiations.

Q: How is JMF 2.0 different from JMF 1.1?

The JMF 1.1 API software concentrates on the playback of media, and reference implementations were released on Java, Windows and Solaris platforms.

The JMF 2.0 API software adds support for capture, transmission (streaming), and transcoding (changing from one media format to another), along with new codecs and a new plugin architecture which makes it easy to integrate new codecs and effects into the framework.

Q: What media types does JMF 2.0 support?

JMF 2.0 supports a wide array of media types, including

  • protocols: FILE, HTTP, FTP, RTP
  • audio: AIFF, AU, AVI, GSM, MIDI, MP2, MP3, QT, RMF, WAV
  • video: AVI, MPEG-1, QT
  • other: Flash 2, HotMedia

For a complete set of formats, check out: http://java.sun.com/products/java-media/jmf/2.0/supported.html

Q: Will JMF 2.0 support MP3?

Yes, JMF 2.0 supports the playback (decoding) of MP3, i.e. MPEG-1 layer 3 audio, in both optimized and Java versions of JMF 2.0. MP3 encoding is only supported in the optimized versions.

Q: Can I play CD's or DVD's with JMF 2.0?

No. JMF 2.0 does not support playback of audio CDs or DVDs.

There is an unsupported way to play audio CDs using the Windows Performance Pack version of JMF 2.0! Assuming your CD-ROM drive is mapped to E:, you can use the URL "file:/E:/Track01.cda", etc., to play the CD track.

Q: Can I play a movie in an applet with JMF 2.0?

Yes. You can use the SimplePlayerApplet that is included in the jmf.jar file or write your own.

Q: Will JMF 2.0 support streaming?

Yes, JMF 2.0 supports both server and client side streaming. JMF 2.0 provides capture and RTP/RTSP support to enable the grabbing, streaming, and playback of data from a server to a client.

Note: RTSP is only supported on the client side and is considered early access quality.

JMF 2.0 also provides HTTP and FTP streaming support on the client side.

Q: Can I extend JMF 1.1 to use my own codecs?

Yes. JMF 2.0 has a new plugin architecture which allows you to add new codecs and effects to the framework.

You can also create your own custom datasources and players to parse and render new media types which are not bundled with JMF 2.0

More information about this can be found in the JMF Programmer's Guide, available on the JMF web site at http://java.sun.com/products/java-media/jmf/2.0

Q: Can I capture audio and video with JMF 2.0?

Yes. JMF 2.0 provides capture functionality so you can capture from a recorded or live media source. On Solaris, SunVideo and SunVideo Plus cards are supported. On Windows, most video capture devices that have a VFW driver are supported. For a list of tested video capture devices, check out: http://java.sun.com/products/java-media/jmf/2.0/supported.html#Capturers

Capture is not supported in the pure Java versions of JMF 2.0, since audio and video capture is not available as a core functionality in the JDK.

Note, the Java Sound API allows low-level sound capture; JMF 2.0 uses this API for sound rendering, and bundles Java Sound with its own download. This means you can use Java Sound to capture sound, without having to use JMF 2.0 at all.

For more information on the Java Sound API, check out http://java.sun.com/products/java-media/sound

Q: What platforms does JMF 2.0 run on?

JMF 2.0 will run on Windows 95/98/NT 4.0/2000, Solaris/Sparc, and any Java CompatibleTM platforms (with the exception of Apple's MRJ 2.1.4, which has problems reported against it).

Q: What versions of the JDK does JMF 2.0 run on?

JMF 2.0 runs on Java CompatibleTM platforms running JDK 1.1 or greater. For complete Y2K compliance, you should use JDK 1.1.6 or greater.

Q: Can I run JMF 2.0 in a browser?

Yes. JMF 2.0 runs on Java CompatibleTM platforms running JDK 1.1.6 and above.

You can use JMF with:

  • HotJavaTM Browser 1.1
  • Netscape Communicator 4.03-4.05 with the JDK 1.1 patch
  • Netscape Communicator 4.06 or later
  • Microsoft Internet Explorer 4.01 or later

Q: What RTP streaming servers work with JMF 2.0?

JMF 2.0 has been tested and is interoperable with the following tools and applications:

Q: Is JMF 2.0 Y2K compliant?

Yes. Note you will have to run it on a Y2K certified JVM, such as JDK 1.1.6 or greater.

Q: What is JMStudio?

JMStudio is a sample application that ships as a part of the JMF 2.0 bundle. It is contained in the jmf.jar file and can be run with the command "java JMStudio". This GUI-based tool provides playback, capture, transmit and transcode functionalities.

Q: What is JMF Registry?

JMF 2.0 maintains a registry of available plugins, package prefixes and other settings in a file called jmf.properties. This is a binary file and should only be modified using the provided JMFRegistry application. This application is a part of the JMF 2.0 jmf.jar file and can be run as "java JMFRegistry". It requires that you have Swing-1.1 in your CLASSPATH (or you can use JDK 1.2 or later).

Q: What is JMF Diagnostics?

On the JMF web site, there is a diagnostics page with an embedded JMF applet which will check to see if you have JMF installed correctly on your system. Check out: http://java.sun.com/products/java-media/jmf/2.0/jmfdiagnostics.html

Q: How do I turn off HTTP/FTP caching?

By default http and ftp sources are cached to local disk during playback. To disable caching for these sources, you can use this call: Manager.setHint(Manager.CACHING, new Boolean(false));

Turning off caching can result in poor performance, unless you have a fast connection to the internet (or intranet) and the file is streamable. Files with single tracks (audio-only or video-only) will play fine without caching provided the data consumption rate is not faster than the download rate.

The above hint is effective only if it is set before the player is created and realized. Setting it after playback has started may not have any effect.

Q: Can I capture audio or video from within an Applet with JMF 2.0?

By default (for security reasons), JMF 2.0 does not allow capture from an applet. The user can turn this on by using JMFRegistry.

Run "java JMFRegistry", select the UserSettings tab and check "Allow Capture From Applets". If the browser's security permits loading native libraries, then you will now be able to capture audio/video from an applet.

Q: Can I save files from within an applet in JMF 2.0?

By default (for security reasons), JMF 2.0 does not allow files to be saved from an applet. The user can turn this on by using JMFRegistry.

Run "java JMFRegistry", select the UserSettings tab and check "Allow File Writing for Applets". If the browser's security permits loading native libraries, then you will now be able to save fies from an applet.

Q: How do I capture both audio and video together?

You'll have to create DataSources for the audio and video capture devices and use the MergingDataSource (see javax.media.Manager) to merge them into one.


JMF 2.0 Troubleshooting

Playback

Q: How come I cannot play "xyz.mov" or "abc.wav"?

Although JMF might support a certain media content type such as QuickTime and MPEG, it may not support the specific compression (CODEC) used for the data inside that file. For example, a QuickTime file with Cinepak video will play in JMF, but a QuickTime file with Sorensen video will not play. This is because JMF 2.0 does not support decompression of Sorensen video.

For a complete set of formats that JMF 2.0 supports, check out: http://java.sun.com/products/java-media/jmf/2.0/supported.html

Q: Why is the video not updating?

If the video screen is blank or not updating often it may be because the CPU is not able to decode and render video fast enough. This could be due to a slow computer or a slow file source or a slow graphics card. If its a slow file source, like a network file, then try making a local copy first.

Q: Why is there no sound?

There may be several reasons for not hearing sound when you expect it:

  • Your hardware volume is turned down
  • Your sound card is in use by another application -- exit the other application and reload the media file in JMF
  • JMF does not support the compression format of the audio track

Applets

Q: What is this error?
java.lang.NoClassDefFoundError: javax/media/ControllerListener

This happens in two situations:

  • jmf.jar is not in your CLASPATH
  • jmf.jar is in your CLASSPATH but you are using the JDK 1.2+ appletviewer.
    JDK 1.2 and later require standard extensions to be loaded from <JDK>/jre/lib/ext directory. When you install JMF 2.0 <on Windows), it will automatically install the jmf.jar in the above mentioned directory. If for some reason it did not, or you installed JDK 1.2 or later after installing JMF, then you need to manually copy the jmf.jar and sound.jar files to the <JDK>/jre/lib/ext directory.

Q: Why am I unable to play a local file in an applet?

Some browsers require additional permissions to allow reading local files. If the browser prompts you for such permissions, you must say yes.

Q: Why don't JMF applets work in my browser?

Possible reasons are:

Capture

Q: Why doesn't my video camera show up in JMStudio->Capture Preview?

JMF needs to query your system for capture devices. This happens automatically when you run JMStudio for the first time. If you upgraded from an earlier version of JMF 2.0 or just installed a new capture device or the registry file was deleted, you'll need to force JMF to query for capture devices again.

To force JMF to look for capture devices:

  • On Solaris, run "java SunVideoAuto" or "java SunVideoPlusAuto", depending on which card you have.
  • On Windows, run "java VFWAuto".

Q: How come I don't hear anything when I capture audio?

When audio is captured using JavaSound capture driver, it is not automatically played back, unless you are previewing the captured audio. Sometimes, even if you are previewing the captured audio, if your capture device does not support simultaneous capture and playback, then you will not be able to hear any sound.


JMF 1.1 Questions and Answers

Q: Where can I find JMF 1.1?

JMF 1.1 can be downloaded from http://java.sun.com/products/java-media/jmf

Note that JMF 1.1 has been superceded by JMF 2.0, which contains all the playback functionality of JMF 1.1 and adds new functionality such as capture, transmit, transcode and a plugin architecture.

Q: How can I provide feedback on the JMF 1.1 API?

Feedback can be emailed to jmf-comments@sun.com

This one-way email drop goes directly to the JMF API designers.

Note the JMF 1.0 and JMF 1.1 API is frozen. Feedback is still welcomed, and will be considered for future JMF API specificiations.

Q: How is JMF 1.1 different from JMF 1.0?

The JMF 1.0 API concentrated on playback of media, and reference implementations were released on Windows and Solaris platforms.

The JMF 1.1 API still concentrates on the playback of media, but added new reference implementations of JMF written entirely in the Java programming language, along with the Windows and Solaris versions.

Q: What media types does JMF 1.1 support?

JMF 1.1 supports a wide array of media types, including

  • protocols: FILE, HTTP, FTP, RTP (RFC 1889/1890)
  • audio: AIFF, AU, DVI, G.723, GSM, IMA4, MIDI, MP2, PCM, RMF, WAV
  • video: Apple Graphics (SMC), Apple Animation (RLE) Cinepak, H.261, H.263, Indeo 3.2, Motion-JPEG, MPEG-1, Uncompressed
  • File Formats: AVI, QuickTime, Vivo

For a complete set of formats, check out: http://java.sun.com/products/java-media/jmf/1.1/supported.html

Q: Will JMF 1.1 support MP3?

No. JMF 1.1 is considered frozen -- no new functionality will be added to this release. MP3 is supported in JMF 2.0.

Q: Can I play CD's or DVD's with JMF 1.1?

No. JMF 1.1 does not support playback of audio CDs or DVDs.

There is an unsupported way to play audio CDs using the Windows Performance Pack version of JMF 2.0! Assuming your CD-ROM drive is mapped to E:, you can use the URL "file:/E:/Track01.cda", etc., to play the CD track.

Q: Can I play a movie in an applet with JMF 1.1?

Yes. You can use the SimplePlayerApplet that is included in the jmf.jar file or write your own.

Q: Will JMF 1.1 support streaming?

JMF 1.1 supports client-side streaming; it can playback RTP streams that are sent by any RTP compliant server, and also can playback HTTP/FTP streams.

JMF 2.0 provides both capture and transmit capabilities which enables server-side and client-side streaming.

Q: Can I extend JMF 1.1 to use my own codecs?

Yes. You can create your own custom datasources and players to parse and render new media types which are not bundled with JMF 1.1. More information about this can be found in the JMF Programmer's Guide, available on the JMF web site at http://java.sun.com/products/java-media/jmf/1.1

Q: Can I capture audio and video with JMF 1.1?

JMF 1.1 does not provide capture funtionality; please update to JMF 2.0 if you want to capture or transmit media data.

Q: What platforms does JMF 1.1 run on?

JMF 1.1 will run on Windows 95/98/NT 4.0/2000, Solaris/Sparc, Solaris/x86 and any Java CompatibleTM platforms (with the exception of Apple's MRJ 2.1.4, which has problems reported against it).

Q: What versions of the JDK does JMF 1.1 run on?

JMF 1.1 runs on Java CompatibleTM platforms running JDK 1.1 or greater. For complete Y2K compliance, you should use JDK 1.1.6 or greater.

Q: Can I run JMF 1.1 in a browser?

You can use JMF with:

  • HotJavaTM Browser 1.1
  • Netscape Communicator 4.03-4.05 with the JDK 1.1 patch
  • Netscape Communicator 4.06 or later
  • Microsoft Internet Explorer 4.01 or later

Q: What RTP streaming servers work with JMF 1.1?

JMF 1.1 has been tested and is interoperable with the following tools and applications:

Q: Is JMF 1.1 Y2K compliant?

Yes. Note you will have to run it on a Y2K certified JVM, such as JDK 1.1.6 or greater.

Q: What is JMPlay?

JMPlay is a sample application that ships as a part of the JMF 1.1 bundle. It is contained in the jmf.jar file and can be run with the command "java JMPlay". This GUI-based tool is a general media player which can play local and streaming media.


[ This page was updated: 16-Feb-00 ]

Products & APIs - Developer Connection - Docs & Training - Support
Community Discussion - Industry News - Solutions Marketplace - Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
Feedback - Map - A-Z Index

For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.