Log in

View Full Version : directshowsource(fps=24/1.001) vs assumefps(24000,1001)


shambles
23rd March 2008, 12:30
encoding a movie with x264 using directshowsource(fps=24/1.001) results in avinaptic reporting the fps as 23.976043, while using assumefps(24000,1001) it's reported as the correct 23.976024.

using directshowsource on a 24/1.001 fps source without the fps argument also results in 23.976043, and using fps=23.976 results in 23.975985

using info(), both no fps argument and fps=24/1.001 show 23.9760 (10000000/417083), assumefps shows 23.9760 (24000/1001) and fps=23.976 shows 23.9760 (2500000/104271)

i don't really care about fps=23.976, but why the discrepancy between fps=24/1.001 and assumefps(24000,1001)?

IanB
23rd March 2008, 14:17
AssumeFPS(24000,1001) directly sets the FrameRateNumerator and FrameRateDenominator to those exact values. Use this form when you need exact control over the results passed out thru the video API's to other programs.

DirectShow bases it's internal timings on 100 nano second units. Setting fps=24/1.001 results in a single precision floating point number of approximate value 23.976024. This is the start of a calculation chain which 1st results in setting a DirectShow period of 417083 * 100ns. This period is then converted as required by AviSynth into FrameRateNumerator=100000000 and FrameRateDenominator=417083

Also AssumeFPS(23.976) now uses a modified reduced fraction algorithm to give the rational pair with least error in a rational pair when converted back to a single precision float. Fractions with a divisor of which 1001 is a factor are explicitly handled, so AssumeFPS(24/1.001) will give the result most users expect.

Previous versions just used 2**23=8388608 as the master factor and then normalised the result.

shambles
23rd March 2008, 14:35
so, i'll just stick with AssumeFPS(24000,1001) then.

thanks :)

ACrowley
14th April 2009, 19:10
EDIT:

Ist exactly what Shambles said.

Directshowsource on 24/1001 Sources:


- No FPS=/AssumeFPS results in 23.976043
- FPS=23.976 : 23.975986 FPS
- AssumeFPS(24000,1001) : 23.976024

23.976024 should be the closest to 24/1001.
This is what dgindex/dgavc outputs. Also eac3to detects the x264 encodes a 24,10001 without Warnings.
Avinaptic shows 23.976024 too.

So i will use AssumeFPS(24000,1001) with Directshowsource.
Anyway, most of my x264 encodes encoded through Directshowsource are 23.976043. No Problem at all, even with 23.975986.