Link to home
Start Free TrialLog in
Avatar of dgrafx
dgrafxFlag for United States of America

asked on

programmatically get the width and height of quicktime .mov file

so lets say you load a .mov file into a quicktime player on a webpage.
how do you determine the size of the video? - width & height.
not the size that you may have set the player to but the size of the video.

thanks
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgrafx

ASKER

I see - I was hoping it could be done with a loadedmetadata event listener or something similar.
Why is it that mov files can't be read - at least it's size - like an mp4 for example can?
No, that event ties to the HTML 5 <video> tag, which only supports a few common formats, but does not support the .mov format.

It's pretty easy to convert .mov to a compatible format, but that's a more permanent change, so if you're just looking for dimensions of a .mov file without converting it, you'll need to use a server-side utility.
For what it's worth, FFMpeg works with a LOT of different formats, not just .MOV. So if you were ever considering the possibility of other non-HTML5 formats coming along...
Avatar of dgrafx

ASKER

ok thanks.
how would i get JUST width and height with ffmpeg?
You would need to use a server-side script to execute ffmpeg, capture the output, and parse it out. A regular expression would probably do the trick.

If you don't know PHP or ASP or whatever scripting language you have available to you, then I'd suggest you post a new question in one of those forums (whichever is appropriate) and ask for help in the specifics.
Avatar of dgrafx

ASKER

ok thanks ...
I was hoping for a width height variable!
A regular expression can figure out the values and put them into width/height variables, but something's gotta parse the output first.