Log in

View Full Version : Working on framerate script for FFDSHOW need help with getting the fps from ffdshow.


fusion_400
7th March 2008, 15:59
Hello i am working on a script that will provide smooth playback on with both 23.976fps material and 25fps material in ffdshow when the monitor only supports 60hz.

For more info about the problem see this:
http://forum.doom9.org/showthread.php?p=1109438&posted=1#post1109438

For PAL based material i use these settings:
AssumeFPS(25)
ConvertFps(60)

and

For 23.976fps filmbased material
AssumeFPS(24)
ConvertFPS(60)

I also use the back/ahead buffer function in ffdshow it is set to (30,30)

Now i have to change these ones manually for each different framerate which gets annoying.

So i want to write a script that first determines the frame rate of the source and then i can use that variable on AssumeFPS like shown below to ensure smooth playback for both 23.976 and 25 fps material without having to manually change the script each time.:

AssumeFPS(ReportedFrameRate)

Can anyone help me with this i cant find any info on how to get the framerate of each video/movie clip from ffdshow.

Important: These are settings used inside of ffdshows aviscript function.

dimzon
7th March 2008, 16:16
read answer at original thread

fusion_400
10th March 2008, 16:39
anyone here who knows what can be wrong with the following code that makes playback jerky this is code that is used directly in FFDSHOW Avisynth window to improve playback of film based and pal material on a 60hz only screen.

c=last
c=c.assumeFPS(Round(c.Framerate),true)
c=c.Framerate==25? c.SelectEvery(5,0,1,2,3,4,4).assumeFPS(30):c
c=c.Framerate==24? c.SelectEvery(4,0,1,1,2,3).assumeFPS(30):c
eval("c.ConvertFPS((c.Width>1000)?30:60)")

Dimzon originally wrote the code.

I myself find that the convertFPS when just 30fps is always jerky and i have tried to change so that it only uses 60fps but the code above with the SelectEvery command that should reduce the blending issues associated with the ConvertFPS just makes the video jerky.

At this time the following code provides the best playback of 23.976 and 25fps material on a 60hz only monitor.

assumeFPS(Round(Framerate),true)
ConvertFPS(60)

But the blending issues are ofcourse not dealt with here anyone who has any tips on what can be done to reduce blending issues without makeing the videos jerky.

If this could be fixed this would be the ultimate solution to the old problem with jerkyness when playing back 23.976 and 25 fps on a monitor that only support 60hz.

Also is there anyway to write code that checks if the framerate is 29.97 or 30fps and then doesn't use the convertFPS function.

I am hopeing for a good solution because this could benefit many people who are stuck with 60hz only monitors like the Eizo 24" ones and many others.

Didée
10th March 2008, 17:48
OH MY LORD.

There's nothing wrong with the code you posted. And your "blending issue" is not an issue, it's a *method*.


There are 6 people. You have 5 apples. Every one shall get the same amount of apple. Ah, that's a problem.


1) Cutting the apples in pieces, so that everyone gets the same amount.

--> "Wohoooo, there's a blending issue"


2) Don't give every one the same amount. 2 people have to share one apple.

--> "Wohoooo, it's jerky!"


3) Buy more apples. (-> motion interpolation)

--> "Wohoooo, it's too slow" (Yes, buying apples costs money!)


Hmh. Solutions there are plenty, but if you like none of them, well ...


You know that you can't make a pancake without breaking an egg, do you?

You might want to try the function "BlendFPS()", which is contained in motion.dll by Clouded (aka. "mg262" on this board here).
BlendFPS allows to do ConvertFPS-style framerate conversion with less blending, controlled by the "aperture" parameter of BlendFPS.

fusion_400
10th March 2008, 19:38
Yes BlendFPS seems to be a little better when it comes to blending but it has problems when seeking in a file it flickers for a while and some older frames can suddenly show up several seconds after they have been shown.

ConvertFPS had the same problem with 23.976fps sources until the
assumeFPS(Round(Framerate),true) was used but BlendFPS has problems regardless of source framerate.

Is there any other alternative to BlendFPS ?

fusion_400
20th March 2008, 13:03
Anyone here who has a solution to the flickering that happens when seeking and using BlendFPS? With ConvertFPS there is no problem with flickering in the first seconds after seeking in a movie.

Also there seems to be the occasional stutter with BlendFPS that is not visible with ConvertFPS. But the picture certainly looks better with BlendFPS.

If the seeking and occasional stuttering could be fixed with BlendFPS it would be really fantastic for all people who are stuck with 60hz only monitors.

Is there any other alternative to BlendFPS that is also fast and dont have the same problem ?