Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble synchronizing audio/video with SG




On 09.06.2008, at 13:18, Muraviev Dmitry wrote:

Hi, list

I'm capturing video/audio using SGDataProc. To determine time difference between audio and video channels i use this code:

err = SGGetTimeBase(seqGrab, &sgTimeBase);
...
err = SGGetChannelTimeBase(audioChannel, &soundTimeBase);
...
TimeRecord vid, aud;

GetTimeBaseTime (sgTimeBase, 10000, &vid);
GetTimeBaseTime (soundTimeBase, 10000, &aud);

timeShift = (double)WideToSInt64(aud.value)/(double)aud.scale -  (double)WideToSInt64(vid.value)/(double)vid.scale;

In most cases it gives me correct result and I synchronize my movie using SGDataProc TimeValue. But sometimes it seems that I get wrong value. And audio track shifts on 3-5 frames.

Can anyone give me suggestions how can I obtain the real delta between TimeValues coming with SGDataProc with video and audio samples?



I have reviewed the list and found a problem similar to mine: http://lists.apple.com/archives/quicktime-api/2005/Jul/msg00091.html

But I did not find a solution to this problem.

Is it possible to synchronize audio and video data with high accuracy using Sequence Grabber API?
I have tried to do this using a comparison of audio channel timeBaseTime value with sequence grabber timeBaseTime value. (As far as I understand, audio and video channels initialized with a slight delay) And I got good results. But I don't sure that this always works and that it's the best way to synchronize audio and video data.

All I need is to get the compliance of timeValues of the video and audio channels returned by sgDataProc.


Thanks in advance!

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden

References: 
 >Trouble synchronizing audio/video with SG (From: Muraviev Dmitry <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.