i'm trying to calculate the duration in microseconds (µs) the same way that virtualdub (information screen) calculates it but am having trouble getting the algo to properly show 33667µs.
29.970 fps = 33667µs
23.976 fps = 41708µs
25.000 fps = 40000µs
..
given dwScale=1001 (for video/interlace) and dwRate=30000 written to the avi header comes out wrong:
1001 * 30.000 = 33.3667
1000 * 29.970 = 33.3667
1001 * 29970 = 0.0334
1000 * 29970 = 0.0334
i know i can just hold the values in a list internally but i need it to calculate in case the framerate is different and wouldn't be in a list.
this is for a raw bmp2avi app i'm working on and want to show this value in the gui when the user sets the parameters up. thank you.
![]()
29.970 fps = 33667µs
23.976 fps = 41708µs
25.000 fps = 40000µs
..
given dwScale=1001 (for video/interlace) and dwRate=30000 written to the avi header comes out wrong:
1001 * 30.000 = 33.3667
1000 * 29.970 = 33.3667
1001 * 29970 = 0.0334
1000 * 29970 = 0.0334
i know i can just hold the values in a list internally but i need it to calculate in case the framerate is different and wouldn't be in a list.
this is for a raw bmp2avi app i'm working on and want to show this value in the gui when the user sets the parameters up. thank you.
