Velocity Reviews > Math is not my strong suit,,,

# Math is not my strong suit,,,

Dave
Guest
Posts: n/a

 08-03-2007
Clients upload QuickTime .MOV files to our web site which is written in
Classic ASP.

Our host provider does not have any QuickTime related APIs installed, so
I cannot use the QuickTime API to access data about the MOV files

I want to get the following information:

Width, Height, Frame Rate, Duration

After googling for an hour I could not find any sample code to get this
info in ASP, PHP, Perl or any other language I can read. But I did find

http://developer.apple.com/documenta.../QTFF/qtff.pdf

Which is the QuickTime file format.

It's taken a couple of hours, but I've managed to write some code to get
the Width and Height of the MOV file, and the duration in full seconds.
But I can't figure out the frame rate or the number of frames if the
duration is not an even number of seconds.

These are the values I have to work with:

qt_time_scale = 7680
qt_duration = 85504

seconds = qt_duration \ qt_time_scale

But there is a remainder and I can't figure out how to calculate how
many frames that remainder is...

Has anyone else done this?

jp2code
Guest
Posts: n/a

 08-03-2007
Dave,

Thanks for helping with my post immediately below yours.

Can ASP calculate a modulus?

If A = 5 and B = 2, then in C/C++:

value = A / B = 2;
// value would be 2 because 2 goes into 5 twice

remain = A % B = 1;
// remain would be the remainder.

HTH,
Joe

"Dave" wrote:
> These are the values I have to work with:
>
> qt_time_scale = 7680
> qt_duration = 85504
>
> seconds = qt_duration \ qt_time_scale
>
> But there is a remainder and I can't figure out how to calculate how
> many frames that remainder is...
>
> Has anyone else done this?

Dave
Guest
Posts: n/a

 08-03-2007
Nevermind, I figured it out. All frames are a constant size of "256",
so I just divide the remainder by 256 to get the number of frames left.

And, if I divide the qt_time_code by 256 I get the frame rate.

--Dave

In article <(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed)
says...
> Clients upload QuickTime .MOV files to our web site which is written in
> Classic ASP.
>
> Our host provider does not have any QuickTime related APIs installed, so
> I cannot use the QuickTime API to access data about the MOV files
>
> I want to get the following information:
>
> Width, Height, Frame Rate, Duration
>
> After googling for an hour I could not find any sample code to get this
> info in ASP, PHP, Perl or any other language I can read. But I did find
>
> http://developer.apple.com/documenta.../QTFF/qtff.pdf
>
> Which is the QuickTime file format.
>
> It's taken a couple of hours, but I've managed to write some code to get
> the Width and Height of the MOV file, and the duration in full seconds.
> But I can't figure out the frame rate or the number of frames if the
> duration is not an even number of seconds.
>
> These are the values I have to work with:
>
> qt_time_scale = 7680
> qt_duration = 85504
>
> seconds = qt_duration \ qt_time_scale
>
> But there is a remainder and I can't figure out how to calculate how
> many frames that remainder is...
>
> Has anyone else done this?
>

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post namekuseijin Python 229 10-29-2010 09:02 AM namekuseijin C Programming 214 10-17-2010 01:12 PM VK Javascript 15 05-02-2010 03:43 PM ashish_gokhale ASP .Net Web Controls 0 05-05-2005 01:38 PM chirs Java 18 03-02-2004 06:00 PM