Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MPEG1 framerate



Hi,


I am using QT4J to deal with MPEG-1 files. As regularly pointed out in this list, QT cannot see the audio and video separately but see MPEG-1 files as a somewhat opaque muxed block, and so on. Having that in mind:


I am trying to get to know the exact framerate of any (MPEG1) opened file, fortunately, there is a KB article:

http://developer.apple.com/qa/qa2001/qa1262.html

Translating the code to QT4J I am getting straightforward stuff:

track = movie.getIndTrackType(1,StdQTConstants.visualMediaCharacteristic,StdQTConstants.movieTrackCharacteristic);
videoMedia = track.getMedia();
mpegMedia = (MPEGMedia) videoMedia; //exception if not MPEG, no problem
MPEGMediaHandler mediaHandler = null;
if (mpegMedia!=null) mediaHandler = (MPEGMediaHandler)mpegMedia.getHandler();
movie.task(0); //as stated in article
QTPointer encodedFrameRate = mediaHandler.getPublicInfo(StdQTConstants5.kMHInfoEncodedFrameRate);
byte[] frameRate = encodedFrameRate.getBytes();
System.out.println(frameRate);

Only thing different from the article is that the 'characteristic' used to get the track type is 'kCharacteristicHasVideoFrameRate' which I can't find anywhere... However, as MPEG-1 files have only one 'track', there does not seem to be any problem with using 'visualMediaCharacteristic'.

Code runs, but onle a single '0' byte is returned as the frame rate.

Should I file a bug report? (Gotta keep them going folks)


Thanks in advance.

Dani




_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-java mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to email@hidden
References: 
 >Re: MPEG1 to AVI, no audio (Alex Shaykevich) (From: Daniel Giribet <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.