Log in

View Full Version : Request: framerate conversion script


Chainmax
12th October 2006, 19:44
As you guys know, current Avisynth-based framerate conversion methods display noticeable artifacts in high motion scenes like quick pans and sudden zooms. I was wondering about the possibility of combining currently available functions in order to overcome this flaw. First, we have foxyshadis's motion estimation function:

http://forum.doom9.org/showpost.php?p=853499&postcount=2

, then we have Didée's MVTools-based framerate conversion script:

http://forum.doom9.org/showpost.php?p=863809&postcount=73

and finally we have Mug Funky's frame replacement function:

http://forum.doom9.org/showpost.php?p=886655&postcount=15


The idea would be to combine these three tools into one. It would use two passes:

- In the first, a stats/log file with motion values would be created using foxyshadis's function.

- In the second pass the actual framerate conversion would take place: given a user-defined motion threshold, Didée's function would be used on scenes below that threshold and Mug Funky's function would be used on scenes above that threshold.


So, how feasible do you think this would be?

Fizick
13th October 2006, 16:45
you are welcome to develop framerate conversion script.
Two pass is not needed IMHO.

But how it is related to "Avisynth development"?
You found some bug, or you suggest to add some feature to AviSynth? Or create a new plugin?

Richard Berg
13th October 2006, 17:05
What's wrong with just using MvFPS() on the whole clip? Defaulting to simple replacement or blend when motion is low won't make it any faster.

Chainmax
14th October 2006, 00:39
Fizick: Once again, you didn't bother to actually read the OP before passing judgement and criticism. I was not damanding anything, but rather asking about the feasibility of doing it. I if I had the knowledge to do it I'd give it a try. As for your other questions, I think the title and OP are clear enough.

Richard Berg: like I said on the OP, current Avisynth-based framerate conversion methods incur on way too much artifacting in high motion scenes like quick pans and sudden zooms. I think we already have the ingredients to create a something better (the functions I linked to) and was asking about the feasibility of my suggestion to combine them all into one single function.

Didée
14th October 2006, 04:01
@Richard:
It's not about speed, nor about switching to blending on low motion. It's about switching to blending when motion is high, where interpolation results often are poor.


@ Chainmax:

Big misconception, all way long. :D

No need for 2pass at all; "foxy's function" is just stone old documentation examples, only that the results are written to a file (no offense,just clarification); Mug's morph function can not directly be used for a "free" change of framerate (and what you would get at best, after muchof scripting, is what "MVFlowFPS" already gives in first place:) ) ; and 100% hard switching at some random <threshold> will perform poor anyways. (Imagine the motion level somewhere happens to oscillate just around the threshold, producing frame sequences like warped/blended/warped/blended/etc... -- you yourself would be the one who's cryin' loudest.)

Take Mug Funky's latest script from the "Alchemist" thread, adapt parameters (or script, can't remember) towards high sensitivity ... there you are.

Chainmax
14th October 2006, 04:08
Aww, crap :(. Thanks for the explanation though :).

Richard Berg
14th October 2006, 04:28
I thought "avisynth-based methods" meant the ones built into Avisynth, e.g. ConvertFPS.

Fizick
14th October 2006, 08:38
Chainmax,
I am sure, you can get all this info yourself by reading the scrips you link in first post. But you are too lazy to read scripts line-by line and think a little about. Witout it you can learn how to use existing scripts, but you never learn Avisynth scripting. And I will crititize you utill you start to learn :)
So, we waiting your script adaptation results in "Alchemist" thread.

Chainmax
16th October 2006, 02:30
Fizick, you have a point in me being lazy, but I shouldn't have to be an expert in everything I'd like to see. Besides, like I said two times already, I was asking about the feasibility of this and Didée has kindly explained why it isn't possible.

Trixter
18th October 2006, 03:23
Chainmax: Yes, didn't we talk about this before? :-) I am already in the middle of my transcode project, and while it is slow going, the results are fantastic. You'll recall that we talked about doing two transcodes, a motion-based one and a ChangeFPS zone=80 one, and merging them together in the editor. Well, that's exactly what I'm doing. Here's the motion script:


import("d:\program files\avisynth 2.5\plugins\mvbob\mvbob.avs")
AVISource("\assets\mc2\pal\Voyage.avi")

ConvertToYUY2(matrix="PC.601",interlaced=true) # required so that 0-255 range stays 0-255
AssumeTFF
mvbob
ConvertMCfps
Lanczos4Resize(720, 480)
ConvertToRGB(matrix="PC.601",interlaced=true) # my workflow requires RGB output, so again, forcing PC.601 keeps range 0-255

AssumeFrameBased
SeparateFields() # Turn 60p into 30i (this line and next)
SelectEvery(4, 0, 3) # 4,1,2 is for odd field first; 4,0,3 is for even field first
weave
AddBorders(0,2,0,4) # my workflow requires 720x486; we pad to 486 lines by adding 2 at top and 4 at bottom


...and the "blend" script is exactly the same except that the ConvertMCfps line is replaced with ConvertFPS(59.94,zone=80). I ran all my footage through VirtualDub overnight on a few machines, then I edit the converted files by defaulting to the motion-based one and then falling through to the blending one if the motion was way off:

http://img114.imageshack.us/img114/3576/splicetranscodesjr3.th.png (http://img114.imageshack.us/my.php?image=splicetranscodesjr3.png)

Hope this helps! It takes a while but the results match (and in a few cases exceed) Folsom and S&W converters.

Clown shoes
1st November 2006, 11:57
Ah Brilliant Trixter. This is really fantastic news. Do you think you might be able to update the alchemist thread with your results. Just so as they are all in the same place.

Thanks again mate.

Chainmax
1st November 2006, 13:57
Trixter: I do remember your previous solution (it was convertfps with the zone switch, by the way) and not liking it because sometimes a given frame would be exactly like the previous one but with the bottom half shifted to the left or right.