```
source=ffdshow_source()
SetMTMode(2,2)
frn = int ( FrameRateNumerator(source) )
frd = int ( FrameRateDenominator(source) )
# If the denominator is 1, multiply the numerator by 1000
frn = ( frd == 1 ) ? ( frn * 1000 ) : frn
# If the denominator is 1, now change it to 1001
frd = ( frd == 1 ) ? 1001 : frd
# If the numerator is 2997 and the denominator is 125, change the numerator to 24000
frn = ( ( frn == 2997 ) && ( frd == 125 ) ) ? 24000 : frn
# If the numerator is 2997 and the denominator is 100, change the numerator to 30000
frn = ( ( frn == 2997 ) && ( frd == 100 ) ) ? 30000 : frn
# If the denominator is 125 and the numerator was changed earlier to 24000, change the denominator to 1001
frd = ( ( frd == 125 ) && ( frn == 24000 ) ) ? 1001 : frd
# If the denominator is 100 and the numerator was changed earlier to 30000, change the denominator to 1001
frd = ( ( frd == 100 ) && ( frn == 30000 ) ) ? 1001 : frd
# If the denominator is 1001, which is the only denominator MVTools seems to work with, multiply the numerator by 2.
frn = ( frd == 1001 ) ? ( frn * 2 ) : frn
# assume progressive PAL 25 fps or NTSC Film 23.976 source
backward_vec = ( frd == 1001 ) ? source.MVAnalyse(blksize=16, isb = true, chroma=false, pel=1, searchparam=1, idx=1) : 0
# we use explicit idx for more fast processing
forward_vec = ( frd == 1001 ) ? source.MVAnalyse(blksize=16, isb = false, chroma=false, pel=1, searchparam=1, idx=1) : 0
# If the denominator is 1001, return the MVFlowFPS version of the source, otherwise return the original source
return ( frd == 1001 ) ? source.MVFlowFps(backward_vec, forward_vec, num=frn, den=frd, mask=0, idx=1) : source
```