CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Location
    DC Metro Area, USA
    Posts
    1,509

    Question Video Frame/Audio Sample Conversion

    I'm having problems mapping NTSC frames to a time/drawing location. Currently the sofware is using the integer approximation 30000/1001 in it's calculations, this however will often cause the rendered time of the video clip to be 1 frame off from the audio rendering i.e. as in a timeline using rectangle to show when and how long the clips are.

    I tried converting the integer math to floating point and then used a ceiling funtion to convert the factional frame to a frame, which works ok for most situations except at some point the the approximation produces an extra frame.

    I'd think that this is a fairly well documented occurance but I haven't found anything that would help.
    Last edited by bytz; September 15th, 2006 at 01:06 PM.
    bytz
    --This signature left intentionally blank--

  2. #2
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    332

    Re: Video Frame/Audio Sample Conversion

    You can insert the same video frame twice in places where the video lags audio. For every 299 frames you render insert a frame (299th frame twice) and make it 300.

  3. #3
    Join Date
    Sep 2002
    Location
    DC Metro Area, USA
    Posts
    1,509

    Re: Video Frame/Audio Sample Conversion

    Thanks for the suggestion, but the problem is not the play back, but in the representation of the relative start and duration times on a time line.
    bytz
    --This signature left intentionally blank--

  4. #4
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    332

    Re: Video Frame/Audio Sample Conversion

    What makes rendering differ from representing it by a timeline? You can insert an extra while displaying it in the timeline.
    Last edited by kumaresh_ana; September 16th, 2006 at 08:58 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured