• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMF with Fobs4JMF: Can't get supported formats for media files

Anthony Castillon
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JMF for the first time and am trying to use it with fobs4jmf to try stitching together video files into a single file. Fortunately, I found a sample program to do just that in the SDN website (http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/Concat.html).

I copied and pasted the Concat.java class in a new Eclipse Java class, set up the classpaths, and tested it. (I've gone through the pain of setting up and resetting classpaths so that the JMF diagnostics is able to detect the correct JMF installation in my machine).

However, in the tryMatch method of Concat.java, I am getting an empty array of Format objects, represented by the "supported" variable, in the following code sequence:
TrackControl tc = pInfo[0].tracksByType[type][trackID].tc;
Format origFmt = tc.getFormat();
Format newFmt, oldFmt;
Format supported[] = tc.getSupportedFormats();

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

if (supported[i] instanceof AudioFormat) {
// If it's not the original format, then for audio, we'll
// only do linear since it's more accurate to compute the
// audio times.
if (!supported[i].matches(tc.getFormat()) &&

Here's my problem: While on DEBUG mode, I see that the variable "supported" shows an empty array, however, when I look deeper in the TrackControl tc variable and look at its supportedFormats instance variable, I can see that it has a value. For my testing, I used a .mov file and the supportedFormats variable contains an AudioFormat with the value mp4a, 32000.0 Hz, 16-bit, Stereo, BigEndian, Signed, FrameSize=32 bits.

I can't get past through this hurdle for now. Why am I getting an empty array of Format objects when the TrackControl tc variable actually contains value in its supportedFormats property?

I'd appreciate any help on this matter.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic