The Mac Observer

 
   
 
Quicktime video files metadata
Posted: 12 August 2009 04:15 AM [ Ignore ]
stars_1
Total Posts:  3
Joined  2009-08-12

hi
i’m not sure of this is the right place for this question, but i’ll ask anyway…
i’ve been working on an application that will give me some general info about a quicktime video file (Dimensions, Frame Rate, Compressor Name, Audio channels…)

so i read the “Quicktime File Format Specification” document from apple.com, and i did get to read most of the data i need from the corresponding atoms (atoms are the building units of a quicktime file), but i came across some files that didn’t have these atoms at all (since most of these atoms are optional)

examples include
- ‘stsd’ atoms hold the compressor name, but it’s optional
- ‘stts’ atoms hold data vital to the frame rate calculation, also optional
- ‘stss’ atoms hold data regarding key frames, also optional

and even though one of the atoms i need isn’t even optional, i still couldn’t find it (‘tkhd’ for the video dimensions)

but when i open these files (which missing atoms) they work well, and when i open them in VLC player, i can see the data i need in the ‘media information’ provided by the player

so my question is: how can i get the data i need even when the atoms aren’t available? (it must be doable, VLC proves that!)

ps. i’m working on a java applet, so i can only use standard java libraries

Profile
 
 
Posted: 13 August 2009 02:02 AM [ Ignore ] [ # 1 ]
Administrator
Avatar
Total Posts:  7343
Joined  2001-06-11

I couldn’t pretend to answer this, but I sent the link to someone who might. smile

 Signature 

Editor - The Mac Observer

Favorite (but less relevant than it used to be) Quote: Microsoft’s tyranny lies not in its success, but in the way it achieved and maintains that success.

Profile
 
 
Posted: 16 August 2009 01:03 AM [ Ignore ] [ # 2 ]
stars_1
Total Posts:  3
Joined  2009-08-12

i did a little extra goofing around, the file i have has cmov (compressed movie) atom which contains a dcom and a cmvd atoms, but i’m clueless after that, any suggestions?

Profile
 
 
Posted: 17 August 2009 09:52 AM [ Ignore ] [ # 3 ]
stars_1
Total Posts:  3
Joined  2009-08-12

ok i finally got this problem solved, so here’s the solution in case someone else needs it:

having a ‘cmov’ (compressed movie) atom means the movie resource has been compressed (ok that’s really obvious!)
now this ‘cmov’ atom contains 2 other atoms:
1-‘dcom’ (data compression) atom
2-‘cmvd’ (compressed movie data) atom

dcom only contains 4 bytes for the size, 4 bytes for the atom type, and 4 bytes for the compression algorithm
(all files i came across had ‘zlib’ as the compression algo)

cmvd contains 4 bytes for the size, 4 bytes for the atom type, 4 bytes for the size of the uncompressed content, and the compressed content itself

so java standard library already contains a decompressor for zlib and voila, the uncompressed data contains the missing atoms smile

Profile
 
 
Posted: 21 August 2009 12:10 PM [ Ignore ] [ # 4 ]
Administrator
Avatar
Total Posts:  7343
Joined  2001-06-11

Oy, I am glad you found the answer! My person is hip-deep in a project that prevented him from helping out.

 Signature 

Editor - The Mac Observer

Favorite (but less relevant than it used to be) Quote: Microsoft’s tyranny lies not in its success, but in the way it achieved and maintains that success.

Profile
 
 
   
 
 

Apple Stock Quote (AAPL)

Loading...

Hot Topics

TMO Express

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday. Find out more!

Top Deals From DealBrothers.com

Recent Features

Support The Mac Observer

We noticed you may be running AdBlock on your computer. It takes real money to run this site and to deliver the news, tips, and opinions you love to read.

If you wish to block the ads that pay for the creation of our content, we ask that you instead support TMO Directly, either with a $5 monthly recurring contribution, or a one-time donation of any amount of your choice. Thanks!

Subscribe with Paypal Donate with Paypal