Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th April 2011, 04:17   #21  |  Link
fairchild
Registered User
 
Join Date: Sep 2010
Posts: 316
Hey SubJunk, tried today to use the newer InterFrame to do some realtime frame doubling today using ffdshow, and it's spitting out an error at me. Not sure how to fix it. All I did was copy the plugins you added in the dependencies into my AviSynth/plugins directory. Using the following script:

SetMTmode(2,2)
ffdshow_source()
SetMTMode(2)
InterFrame(Preset="Fast")
GetMTMode(false) > 0 ? distributor() : last

Error given is:

MSmoothFPS: unable to load library given in svp_flow_lib (InterFrame.avsi, line 87)

Edit: I google'd the error and supposedly it has to do with the new GPU acceleration that you added.
Quote:
It means your card is not supported .
SVP GPU acceleration requires OpenCL 1.1
The thing is my card is an HD 5800 series card and does have OpenCL, not sure if it has 1.1 though. Using the 11.4 preview drivers also, maybe that has something to do with it.
__________________
MPC-HC/MPC-BE, Lav Filters, MadVR
CPU: i5 3570k, Video: AMD HD7870 -> Panasonic VT60 55", Audio: Sony HT-CT660 and Audio-Technica M50S

Last edited by fairchild; 11th April 2011 at 04:20.
fairchild is offline   Reply With Quote
Old 11th April 2011, 04:19   #22  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Hi fairchild, sorry about that. I was made aware of the error earlier and I'm updating it to fix that now. Should be released within a few hours
It isn't a bug, but I forgot to add a check that FlowPath was specified, which it needs to be

Last edited by SubJunk; 11th April 2011 at 04:46.
SubJunk is offline   Reply With Quote
Old 11th April 2011, 04:50   #23  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
I had a quick look at the SVP MVTools mod but didn't notice it used a SAD mask. Interesting. It's a shame that it only provides GPU acceleration for flow (MSmoothFps ). Would have thought that MAnalyse was the function to accelerate, but that would be much more difficult to do...
-Vit- is offline   Reply With Quote
Old 11th April 2011, 07:23   #24  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Quote:
Originally Posted by -Vit- View Post
One thing you're not doing is using MMask (in SAD mode) to determine areas with a probable poor motion match. In those areas flow will likely create a mess, so use a different interpolate instead.
How should that work for Flow Interpolation? Trying to do this manually at the script level, there is a problem...
A vector is a path from point A to point B. MMask shows the block metric at the end point of the vector. It would be needed to have the mask located at a point somewhere inbetween, at a fraction of the vector's length. This is not available. And manual compensation of the mask is not possible either, because the mask is located at the end point of the vector, and you can only compensate in the vector direction start->end.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 11th April 2011 at 07:27.
Didée is offline   Reply With Quote
Old 11th April 2011, 07:57   #25  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
InterFrame 1.5 is released!
The changes are:
- Improved the quality of the default, Fast and Placebo presets
- It now checks for the existence of the mandatory value for FlowPath and displays an alert if it isn't defined
- Added the GPU parameter (true for GPU-acceleration, false for CPU-only)

Quote:
Originally Posted by metanat View Post
I have watched around 15 movies that have used various versions of this script, including the latest version. The script has continually improved, to the point that now it is a must have for movie watching. After some initial adjusting to the different feel it gives the movie, you might find, as I have, that it makes a massive difference to the watching experience, creating a silky real-life smoothness that you just don't get without it. Watching regular framed movies now makes them feel jittery, and leaves me wishing they were converted with InterFrame.

Looking forward to more improvements SubJunk, keep up the awesome work!
Wow, that's such an encouraging post. Thanks a lot and I'm glad you are enjoying it!

Quote:
Originally Posted by -Vit- View Post
I had a quick look at the SVP MVTools mod but didn't notice it used a SAD mask. Interesting. It's a shame that it only provides GPU acceleration for flow (MSmoothFps ). Would have thought that MAnalyse was the function to accelerate, but that would be much more difficult to do...
Yeah the sadml parameter is really useful, it fills a gap that was always there.
In InterFrame it's used lightly, because the blur effect looks strange when it's too strong (with each frame changing from sharp to blurry it's a weird strobing-blur effect).
It is an especially useful parameter for when the background is passing by quickly while something small is relatively unmoving on the screen. Without sadml the unmoving thing bounces around like crazy, but with even a light sadml like 150 it stabilises significantly.

Quote:
Originally Posted by Didée View Post
How should that work for Flow Interpolation? Trying to do this manually at the script level, there is a problem...
A vector is a path from point A to point B. MMask shows the block metric at the end point of the vector. It would be needed to have the mask located at a point somewhere inbetween, at a fraction of the vector's length. This is not available. And manual compensation of the mask is not possible either, because the mask is located at the end point of the vector, and you can only compensate in the vector direction start->end.
It's similar to the masking technique used in YFRC, but it is done at the plugin level, not the script level.
If you would like to see how it's done, you can download the sources here

Quote:
Originally Posted by fairchild View Post
The thing is my card is an HD 5800 series card and does have OpenCL, not sure if it has 1.1 though. Using the 11.4 preview drivers also, maybe that has something to do with it.
I have added the new parameter "GPU" for you and other users with incompatible video cards.
So just use something like:
InterFrame(GPU=false, FlowPath="C:\Program Files (x86)\AviSynth 2.5\plugins\")
Please let me know if it works for you
SubJunk is offline   Reply With Quote
Old 11th April 2011, 08:45   #26  |  Link
fairchild
Registered User
 
Join Date: Sep 2010
Posts: 316
Quote:
Originally Posted by SubJunk View Post
I have added the new parameter "GPU" for you and other users with incompatible video cards.
So just use something like:
InterFrame(GPU=false, FlowPath="C:\Program Files (x86)\AviSynth 2.5\plugins\")
Please let me know if it works for you
It's working well now, thanks for the speedy fix.

Using the following script with 10,10 buffer and ignore pulldown:

SetMTmode(2,2)
ffdshow_source()
SetMTMode(2)
InterFrame(Preset="Fast", GPU=true, FlowPath="C:\Program Files (x86)\AviSynth 2.5\plugins\")
GetMTMode(false) > 0 ? distributor() : last
__________________
MPC-HC/MPC-BE, Lav Filters, MadVR
CPU: i5 3570k, Video: AMD HD7870 -> Panasonic VT60 55", Audio: Sony HT-CT660 and Audio-Technica M50S
fairchild is offline   Reply With Quote
Old 11th April 2011, 09:38   #27  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Quote:
Originally Posted by fairchild View Post
It's working well now, thanks for the speedy fix.
Great, glad it's working for you
SubJunk is offline   Reply With Quote
Old 11th April 2011, 10:36   #28  |  Link
ncatt
Registered User
 
Join Date: Oct 2006
Posts: 10
Hi SubJunk! Thanks for this great script! The gpu option is working very fast in my machine. With gpu=true the encode was nearly 40% faster. My gpu is a gtx580.
ncatt is offline   Reply With Quote
Old 11th April 2011, 10:42   #29  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Quote:
Originally Posted by SubJunk View Post
It's similar to the masking technique used in YFRC, but it is done at the plugin level, not the script level.
If you would like to see how it's done, you can download the sources here
The point is not how things are done at the plugin level. My point is that at the script level it's hardly possible to make any meaningful use of MMask in combination with "Flow"-style filters.

If all accessibility would stop "at the plugin level", then things like e.g. Q/TGMC would not exist at all.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 11th April 2011, 10:51   #30  |  Link
aegisofrime
Registered User
 
Join Date: Apr 2009
Posts: 450
Hi, just want to point out a slight error in the documentation:

FlowPath:

Sets the location of the libflow DLL files.
The full path of libflowgpu.dll and libflowgpu.dll, for example "C:\Program Files\AviSynth 2.5\plugins\".
Note: This is the only mandatory value; the script will not work without this.

default - Undefined (string)

One of those should be libflowsse.dll right? Pretty obvious, but in the interest of perfection just wanted to point it out
aegisofrime is offline   Reply With Quote
Old 11th April 2011, 11:01   #31  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Didée View Post
And manual compensation of the mask is not possible either, because the mask is located at the end point of the vector, and you can only compensate in the vector direction start->end.
We have forward and backward vectors...
Sure, not perfect (e.g. occlusion), but better than doing nothing in practice. YFRC's solution is not unreasonable: overlay the forward and reverse mask.

Last edited by -Vit-; 11th April 2011 at 11:33.
-Vit- is offline   Reply With Quote
Old 11th April 2011, 11:59   #32  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Sure, But those vectors are not correlated. Don't you see? Forward and backward vectors are computed completely independent from each other. And therefore it is absolutely possible that forward and backward vectors are finding different matches! (It's not only "possibly", it is even somewhat *likely*.)

See - you have to objects in two consecutive frames. Let's assume MVTools (should) try to match these two objects:



MAnalyse finds a match during backward search:



but a different match (or no match at all) during the forward search:



Take the backward search, and for simplicity lets talk about the block SAD:
The backward match causes a certain SAD:



Now, the task is to "Flow" the future object backwards by a fraction of the backward-vector's length:



Obviously, the mask you (would) get from MMask is not correlated with the Flow-compensation.

Now, the obvious idea is to compensate the mask. But this does not work.
Again: the forward vector is not correlated to the backward vector, and very well might have a completely different direction.




Problem? Ah! Problem!

One would need to be able to use a given vector in inverse direction. But there is no means to do that.


"Within" the plugin, it's a different story. There, it is sufficient to know -- while doing the flow-compensation -- that the currently-used vector has a certain metric "attached". This suffices to produce a result with an according weighting. That's okay.

But from the script level, it is not possible to align a fractionally flow-compensated object with the MMask that is created at the vector's end position.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 11th April 2011 at 12:04.
Didée is offline   Reply With Quote
Old 11th April 2011, 12:37   #33  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Quote:
Originally Posted by ncatt View Post
Hi SubJunk! Thanks for this great script! The gpu option is working very fast in my machine. With gpu=true the encode was nearly 40% faster. My gpu is a gtx580.
That's a great result, thanks for the feedback!

Quote:
Originally Posted by Didée View Post
The point is not how things are done at the plugin level. My point is that at the script level it's hardly possible to make any meaningful use of MMask in combination with "Flow"-style filters.
That (and your next post) is all irrelevant to this script, however correct, though I do appreciate the effort you went to with the images

Quote:
Originally Posted by aegisofrime View Post
Hi, just want to point out a slight error in the documentation:

FlowPath:

Sets the location of the libflow DLL files.
The full path of libflowgpu.dll and libflowgpu.dll, for example "C:\Program Files\AviSynth 2.5\plugins\".
Note: This is the only mandatory value; the script will not work without this.

default - Undefined (string)

One of those should be libflowsse.dll right? Pretty obvious, but in the interest of perfection just wanted to point it out
You're right, nice catch It's fixed in the online document and will be fixed in the next version download

Last edited by SubJunk; 11th April 2011 at 12:40.
SubJunk is offline   Reply With Quote
Old 11th April 2011, 19:49   #34  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Didée: I know. Regardless, problem areas are often found correctly. The "incorrect" case is not virulent. Fixing flow weirdness is valuable and "downgrading" an area mistakenly is relatively harmless in this use case. But I also enjoyed your pictures

Subjunk: now you use SVP's GPU flow, how would you say your script compares with SVP?
-Vit- is offline   Reply With Quote
Old 11th April 2011, 20:24   #35  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Glad if I managed to entertain you with handdrawn art. - See, I had only a few minutes during lunchbreak.


-Vit-: That's almost as good as "there is no energy crisis. My current comes right out of the wall socket!"


Within the limits of what MVTools' filters are doing, the metric usage is sufficient.

But there are cases where the plugin is producing bad junk. (Funny deformations, or exzessive blending). MVTools can not produce anything senseful for certain areas.

Now, IF you had an idea how to produce some senseful interpolation nonetheless, then you cannot use it, because you can NOT locate the problem area from the script level.

Don't mistake that with the motion blurring you have in QTGMC. That one is not nearly as critical. You start with discrete target locations, and the area affected by motion blurring naturally will be located rather close to those discrete target areas. This is a luxury you don't have when doing a "free" interpolation. In particular when there is some "large" movement (would be a "long" vector) that MAnalyse completely misses, then you can do nothing. You just can't locate the affected areas.


Sorry if I disturbed the highly interesting discussion about wrapping MVTools documented examples in a function. Perhaps this isn't the place anymore to look for fresh ideas and ingeniosity.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 11th April 2011, 20:41   #36  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
More @topic, I tried to read a little source code, and got reminded why I don't like to read source code.

MSmoothFps.cpp:
Code:
    switch(algo)
    {
    case AlgoFast_1dir:
    case AlgoFast_2dir:
    case AlgoNoMask1:
    case AlgoNoMask2:
    case AlgoNoMask3:
    case AlgoSimple:
    case AlgoNormal:
    case AlgoExtended: break;

    default:
        if(algo<90 || algo>100)
            env->ThrowError("MSmoothFps: incorrect 'algo' value.");
    }
InterFrame.avsi:
Code:
MSmoothFps(Input, SuperRegular, backward, forward, finest=SuperRegular, num=NewNum, den=NewDen, algo=23, ml=0, sadml=150, sadgamma=2, block=false, blend=true)
Having cancelled the "true" programming back when original C just had started, am I interpreting this wrong?. The sourcecode seems to suggest that the script's default value is incorrect?
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 11th April 2011, 21:17   #37  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,374
Quote:
Originally Posted by Didée View Post
The sourcecode seems to suggest that the script's default value is incorrect?
algo=23 corresponds to AlgoExtended, so is accepted by the first part of the switch statement.

libflow.h:
Code:
enum FlowLib_Algo
{
    AlgoUnknown=0,

	AlgoFast_1dir =1,//MFlow "1-dir"
	AlgoFast_2dir =2,//MFlow "2-dir"

	AlgoNoMask1 =11,//MBlockFps, mode=0
	AlgoNoMask2 =12,//MBlockFps, mode=1
	AlgoNoMask3 =13,//MBlockFps, mode=2

	AlgoSimple =21, //like FlowInterSimple from MaskFun.cpp OR MBlockFps, mode=3
	AlgoNormal =22, //FlowInter
	AlgoExtended=23, //FlowInterExtra

	AlgoMask =127,
	AlgoProcessBlocks =128
};
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 11th April 2011, 22:20   #38  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Quote:
Originally Posted by -Vit- View Post
now you use SVP's GPU flow, how would you say your script compares with SVP?
Well SVP has many options and is great for realtime. I really recommend it for users who don't want to touch scripts, who would rather an easier experience.

It has always been my goal with InterFrame to find the highest quality settings without compromising for speed, and in my opinion InterFrame offers the best visual quality of any script or program I have seen, when using the default preset.
If I didn't believe that then I would either learn from the better script as I have done many times, or stop making this and just use the other script instead

What do you think about it? Any tips are always appreciated, especially from the great author of the incredible QTGMC

Quote:
Originally Posted by Didée View Post
Sorry if I disturbed the highly interesting discussion about wrapping MVTools documented examples in a function. Perhaps this isn't the place anymore to look for fresh ideas and ingeniosity.
You have brilliant knowledge and are one of the greatest contributors on this forum ever, now if only we could talk with you without being met with condescension the path to progress may be smoother and faster
SubJunk is offline   Reply With Quote
Old 12th April 2011, 01:26   #39  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
I've looked over your script but not really experimented with it. One thing that immediately stands out is the EEDI2 custom pelclip. That's from the MVTools docs; doesn't that example assume interlaced source? Because it discards half the lines, interpolates them back, then resizes. You're assuming progressive source, yes? So wouldn't something like nnedi3_rpow2 be more appropriate? [without cshift, I believe].
-Vit- is offline   Reply With Quote
Old 12th April 2011, 01:45   #40  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Quote:
Originally Posted by -Vit- View Post
I've looked over your script but not really experimented with it. One thing that immediately stands out is the EEDI2 custom pelclip. That's from the MVTools docs; doesn't that example assume interlaced source? Because it discards half the lines, interpolates them back, then resizes. You're assuming progressive source, yes? So wouldn't something like nnedi3_rpow2 be more appropriate? [without cshift, I believe].
It does seem you're right logically but in testing I got a better result like this after comparing all the EEDI and NNEDI functions. I don't know why but it did seem consistent across multiple videos.
At any rate I am considering removing that option from the script because it is such a slight improvement for a huge performance hit. I don't think I would ever recommend it.
SubJunk is offline   Reply With Quote
Reply

Tags
48fps, 60fps, framedoubling, interframe, smooth motion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.