Log in

View Full Version : Frames to Milliseconds conversion


Xombie
4th December 2002, 10:48
Does anyone know a good formula to convert a video frame to a millisecond time? I'm pulling in an avi file and I have most of the basic information available - rate, scale, etc...

I've got a simple formula in the realm of:

ms = int(((in_frame) * (avi_scale/avi_rate))*1000)

But this will return a result that varies +- 1ms (as checked against VirtualDub). Which isn't too bad, I suppose, but if there's a way to get it much more accurate I'd sure like to know.

Thanks!

auenf
4th December 2002, 11:02
work in float rather than int

Enf...

Xombie
4th December 2002, 11:54
Matter of rounding. That worked. Thanks a lot.