Hi,
On Monday 09 June 2003 01:52, Bram wrote:
> I've just taken a good look at the timestamp_shift bit. I don't see how
> this can fix an a/v sync problem that is supposed to get worse over
Because the actual trick is done somewhere else already in your code:
capproc.cc:454
double audio_error=audiodata/abps-ch.timestamp;
if(audio_error<video_error-5./fps)
{
hide_video=1;
}
if(audio_error>video_error+5./fps)
{
dup_video=1;
}
If you use that timeshift-code/patch, then ch.timestamp will be different
here, so you'll get a different audio error than before and that will lead to
either dropping or duplicating frames - and that's fixing the sync.
It's a bit complicated, I had to think it over again for myself.
So avicap/avirec drops frames or duplicates them, if the audio error is too
big.
And to calculate that, it needs the ch.timestamp with the timeshift
modification.
> time though. It seems to me that all it does is change the offset of the
> audio for the entire video capture, not so much to fix a slowly
> incrementing syncing problem. I'm probably missing something here, but
> this is how I think it works:
Well, the actual effect is in a different part of the code than the patch, I
should have mentioned that.
> The timestamp for each bit of captured audio is calculated using the
> same offset (starttime) each time. This, therefore, can't introduce syncing
> problems. timestamp_shift can vary a little bit for each captured audio
> fragment, but that change is not incremental. Then how can substracting
> timestamp_shift from the timestamp fix incremental syncing problems?
I can explain more, if you need to.
Or just try it, if it's easy to implement for you in vcr
Or disable that timestamp-shift in avifile's code, and then see the difference
on a 2h movie yourself.
Alex
--
Alexander Rawass
mailto:[EMAIL PROTECTED] http://www.raw-ass.net
...but some day you'll be a STAR in somebody else's SKY...
_______________________________________________
Avifile mailing list
[EMAIL PROTECTED]
http://prak.org/mailman/listinfo/avifile