Math is not my strong suit,,,

Discussion in 'ASP General' started by Dave, Aug 3, 2007.

  1. Dave

    Dave Guest

    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
    uploaded.

    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
    a link to:

    http://developer.apple.com/documentation/QuickTime/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?
    Dave, Aug 3, 2007
    #1
    1. Advertising

  2. Dave

    jp2code Guest

    Dave,

    Thanks for helping with my post immediately below yours.

    Maybe I can help you, but I'm not great at ASP:

    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?
    jp2code, Aug 3, 2007
    #2
    1. Advertising

  3. Dave

    Dave Guest

    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 <>,
    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
    > uploaded.
    >
    > 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
    > a link to:
    >
    > http://developer.apple.com/documentation/QuickTime/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?
    >
    Dave, Aug 3, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Duncan Smith
    Replies:
    4
    Views:
    324
  2. namekuseijin

    Re: "Strong typing vs. strong testing"

    namekuseijin, Sep 27, 2010, in forum: C Programming
    Replies:
    214
    Views:
    3,343
    Nick Keighley
    Oct 17, 2010
  3. namekuseijin

    Re: "Strong typing vs. strong testing"

    namekuseijin, Sep 27, 2010, in forum: Python
    Replies:
    229
    Views:
    3,442
    Gregory Ewing
    Oct 29, 2010
  4. Richard
    Replies:
    0
    Views:
    100
    Richard
    Mar 5, 2005
  5. VK
    Replies:
    15
    Views:
    1,162
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page