title: Get QuickTime metadata: codecs, bitrates, dimensions
body: <p>I'm finding it difficult to determine how to extract the following information from a QuickTime movie, either using QTKit or the older QuickTime APIs in OS X, targeting 10.5+:</p>
  
  <ul>
  <li>Video and audio codecs used (e.g. "H.264")</li>
  <li>Video and audio bitrates (e.g. 64 kbps)</li>
  <li>Dimensions</li>
  </ul>
  
  <p>The specific problems I've encountered are:</p>
  
  <p>1) The only means to the video and audio codec names that I've found involve the use of <code>ImageDescriptionHandle</code> and <code>SoundDescriptionHandle</code>, both of which appear to require the Carbon-only methods <code>NewHandleClear</code> and <code>DisposeHandle</code>, as well as requiring the 32-bit only Media object.  Is there a more modern method that doesn't require the Carbon framework and is 64-bit compatible?</p>
  
  <p>2) For the bitrate, I'm getting the GetMediaDataSizeTime64 and dividing by the track duration in seconds.  However, in the case of one audio track, that method returns a value of 128 kbps, but calling <code>QTSoundDescriptionGetProperty</code> with the audio track media and the <code>kQTAudioPropertyID_FormatString</code> param returns a string of "64 kbps".  Why would those two values be different?  Is there a better way to calculate a track's bitrate?</p>
  
  <p>3) Dimensions returned by <code>[QTMovie movieAttributes] objectForKey:QTMovieNaturalSizeAttribute]</code> or by <code>[QTTrack attributeForKey:QTTrackDimensionsAttribute]</code> are incorrect for one particular movie.  The size returned is 720 x 480, but the actual view size in QuickTime Player is 640 x 480.  Player's info window shows a size string of "720 x 480 (640 x 480)".  Is there a better way to determine the actual movie dimensions?</p>
  
  <p>Thanks in advance!</p>