Page 1 of 1

get movie lenght

Posted: Sun May 06, 2012 9:04 pm
by ivaho
Hi All,

I'am trying to get the duration in seconds of a movie file when I send it to a server.

The idea is that as soon as I send a movie file to a server a count down timer starts to run telling me how long the movies runs.

kind regards
Ivo

Re: get movie lenght

Posted: Sun May 06, 2012 9:15 pm
by Klaus
Hi Ivo,

1. load the movie into a (invisible) player object
2. get "the duration of player x"
3. get "the timescale of player x"
4. divide duration/timescale to get the duration in seconds
5. MOST IMPORTANT! Look up these terms in the dictionary 8)

Like this:
...
put the duration of player "your player here..." into tDur
put the timescale of player "your player here..." into tScale
answer tDur/tScale
...

Hint:
This will only work if QuickTime is intalled on the target machine!


Best & groetjes

Klaus