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 13th May 2011, 13:42   #81  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by madshi View Post
What kind of motion estimation technique are you currently using?
This script uses MVTools, which is a library of motion analysis tools for Avisynth. It splits the image into a grid of blocks and attempts to track the motion of every block (as opposed to tracking specific features).

Quote:
If you check motion vectors to the next "future" frame, too, you could eventually fill the occluded space from the future frame.
The flow interpolation functions in MVTools use both forward and backward vectors, and consider the occlusion masks (both ways) to determine how best to fill all areas of the interpolated frame.

Quote:
Originally Posted by madshi View Post
Interesting approaches would also be to compare motion vectors between consecutive frames and only use those which are comparable.
I don't believe MVTools does this at any point, but it does seem a useful idea.
-Vit- is offline   Reply With Quote
Old 13th May 2011, 14:15   #82  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
Quote:
Originally Posted by -Vit- View Post
This script uses MVTools, which is a library of motion analysis tools for Avisynth. It splits the image into a grid of blocks and attempts to track the motion of every block (as opposed to tracking specific features).
Hmmmm... Isn't this kind of technique mostly aimed at encoding? I think the better optical flow algorithms work quite different in concept, looking for gradients instead of matching blocks, tracking motion per pixel instead of blocks etc...

Quote:
Originally Posted by -Vit- View Post
The flow interpolation functions in MVTools use both forward and backward vectors, and consider the occlusion masks (both ways) to determine how best to fill all areas of the interpolated frame.
That is very good - better than I expected!
madshi is offline   Reply With Quote
Old 13th May 2011, 23:28   #83  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Hi madshi,
This script uses a modified MVTools2 for its motion estimation, so I suggest posting about these in the MVTools2 thread. Then Fizick (the developer) can give you his thoughts

Edit: Saw that Vit already posted, sorry for repeating information
SubJunk is offline   Reply With Quote
Old 15th May 2011, 23:26   #84  |  Link
zamadatix
Registered User
 
Join Date: Jan 2011
Posts: 5
InterFrame(Preset="Fast", FlowPath="C:\Program Files (x86)\MPCHC\AviSynth\plugins\")

Is giving me invalid arguements, why?
zamadatix is offline   Reply With Quote
Old 15th May 2011, 23:40   #85  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Hi zamadatix
What is the exact error you get?
SubJunk is offline   Reply With Quote
Old 16th May 2011, 02:19   #86  |  Link
zamadatix
Registered User
 
Join Date: Jan 2011
Posts: 5
It just says "Invalid arguments to function "InterFrame." in the video window when I drag a avs script with that line into mpchc.
zamadatix is offline   Reply With Quote
Old 16th May 2011, 03:20   #87  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,291
Subjunk, do you know of any settings that could be used in to improve vertical panning in your script? I've tried the medium preset with film and animation tuning but both have caused tearing when I've played a vertical panning scene. I assume only the smooth setting seems to improve this but it's unusable in real time for the time being, any advice you could offer would be appreciated.

Anyway, thanks for your time creating this, I've tried quite a few MVtools scripts but was never satisfied with the results, this is working out quite well for my animated content and has become a part of my script.

Last edited by ryrynz; 16th May 2011 at 03:22.
ryrynz is offline   Reply With Quote
Old 16th May 2011, 04:23   #88  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Quote:
Originally Posted by zamadatix View Post
It just says "Invalid arguments to function "InterFrame." in the video window when I drag a avs script with that line into mpchc.
I just did that and it worked for me, so I don't know, maybe there is something else in the script that is causing it in some weird way.
P.S. That's awesome that MPC can do that, I never knew.

Quote:
Originally Posted by ryrynz View Post
Subjunk, do you know of any settings that could be used in to improve vertical panning in your script? I've tried the medium preset with film and animation tuning but both have caused tearing when I've played a vertical panning scene. I assume only the smooth setting seems to improve this but it's unusable in real time for the time being, any advice you could offer would be appreciated.
You can try editing line 119 of the file to change the value of sadml from 150 to 0. That will generally improve panning smoothness, but at the cost of overall frame-coherence. Or you could compromise and set the value to something higher like 300 or 500.

Quote:
Originally Posted by zamadatix View Post
Anyway, thanks for your time creating this, I've tried quite a few MVtools scripts but was never satisfied with the results, this is working out quite well for my animated content and has become a part of my script.
Thanks a lot, I'm glad you find it useful
SubJunk is offline   Reply With Quote
Old 16th May 2011, 23:18   #89  |  Link
sumawo13
Learning Avisynth user
 
sumawo13's Avatar
 
Join Date: Sep 2008
Posts: 80
I get these errors when using InterFrame 1.8.



This is the line I'm using for InterFrame.

Code:
interframe(flowpath="C:\Program Files (x86)\AviSynth 2.5\plugins\",preset="placebo",newnum=48000,newden=1001)
sumawo13 is offline   Reply With Quote
Old 17th May 2011, 00:49   #90  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
That can be a normal result depending on the source material. If the 2 frames on either side of that frame are very different, like in a high-action scene (which that looks like), those kind of frames are created.
You can try editing line 119 of InterFrame.avsi, changing algo=23 to algo=13 and sadml=150 to sadml=0. That will make individual details usually look better, but creates some edge artifacts. Let me know if that helps.
SubJunk is offline   Reply With Quote
Old 20th May 2011, 07:35   #91  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
InterFrame 1.8.1 is released which fixes stuttering motion which was particularly visible in cartoons.
SubJunk is offline   Reply With Quote
Old 20th May 2011, 16:32   #92  |  Link
dansrfe
Registered User
 
Join Date: Jan 2009
Posts: 1,212
How CPU intensive is this script for realtime use? I have a C2D @ 2.66Ghz w/ 4GB RAM.
dansrfe is offline   Reply With Quote
Old 20th May 2011, 16:38   #93  |  Link
CruNcher
Registered User
 
CruNcher's Avatar
 
Join Date: Apr 2002
Location: Germany
Posts: 4,949
depends on the resolution heavily though it eats a lot of power when you do Full HD even SVPs original GPU supported (Realtime optimized) is a heavy thing for Full HD a 4 Core is advised even with GPU support (its only partial acceleration via OpenCL, but lowers the CPU load enough)
And then it depends on your Playback Chain (decoder,renderer ect)
see my results with SVPs original it's stunning (didn't tried it with interframe yet) and with the GPU i save a lot of Load that would slow it down heavily (VMR9 Renderless in this case though is to slow to cope). The SVP guys really thought about everything you even get statistics about it's Load Behavior
The absolute craziness it even has a side by side Realtime compare like you used to from Cyberlink,Corel,Arcsoft everything via avisynth ffdshow and they made the reload of a script a fully smooth experience (like it belongs to the player itself) you click onto their icon in the task tray select the option and it will change everything on the fly with only a small out time, just amazing work combining the best things into a very easy to use realtime experience




Renderer wise when using SVP or Interframe realtime i would advise MadVR without doubt on any Windows OS when you have a capable GPU
__________________
all my compares are riddles so please try to decipher them yourselves :)

It is about Time

Join the Revolution NOW before it is to Late !

http://forum.doom9.org/showthread.php?t=168004

Last edited by CruNcher; 20th May 2011 at 17:21.
CruNcher is offline   Reply With Quote
Old 20th May 2011, 19:04   #94  |  Link
Mr Alpha
Registered User
 
Join Date: Jul 2008
Posts: 75
Anybody know how to get multi-threading for this to work inside ffdshow for realtime playback? I can do SD content on one core, but fullHD just isn't working.
Mr Alpha is offline   Reply With Quote
Old 20th May 2011, 23:27   #95  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Quote:
Originally Posted by dansrfe View Post
How CPU intensive is this script for realtime use? I have a C2D @ 2.66Ghz w/ 4GB RAM.
It all depends on which Preset value you use. The Preset value controls the "quality vs CPU load", so just try to use the highest quality preset that gives you a constant framerate.
See the documentation for more details
Low presets of this script should work on even slow CPUs.

Quote:
Originally Posted by CruNcher View Post
SVP etc
This is similar but different to SVP. These values are tweaked for better quality and smoother motion whereas SVP produces more ghosting by default. SVP can be tweaked to be similar to InterFrame in the options, but can't be the same (though maybe in a later version, I don't know)
You can also run InterFrame (or any AviSynth script) via SVP though which is convenient

Quote:
Originally Posted by Mr Alpha View Post
Anybody know how to get multi-threading for this to work inside ffdshow for realtime playback? I can do SD content on one core, but fullHD just isn't working.
Sorry, I'm not an expert on realtime since I convert. Hopefully someone else can help
SubJunk is offline   Reply With Quote
Old 22nd May 2011, 21:54   #96  |  Link
fairchild
Registered User
 
Join Date: Sep 2010
Posts: 319
Quote:
Originally Posted by Mr Alpha View Post
Anybody know how to get multi-threading for this to work inside ffdshow for realtime playback? I can do SD content on one core, but fullHD just isn't working.
For me, I can't do real-time HD (720p and up). It turns into a slideshow and I verified it does use both of my cores so it is multi-threaded.

SD content works fine and looks fine and turns the frame rate to 59ish (converts 23.976, 25, and 30 fps content just fine to 59-60ish), but when I pop in a 720p or higher video it doesn't work. It appears to be my cpu which is stressed out to the max and can't do the real-time frame rate doubling at 720p and up.

Code:
SetMTmode(2,2)
ffdshow_source()
InterFrame(Preset="Fast", GPU=true, FlowPath="C:\Program Files (x86)\AviSynth 2.5\plugins\")
GetMTMode(false) > 0 ? distributor() : last
So the above works fine for SD, for real-time frame doubling to 59.94 fps.

Also this script works and is equivalent to the Faster preset in Interframe. This script also doesn't work right on my system in real-time with HD content, my CPU is not strong enough it seems.

Quote:
svp_flow_lib="C:\Program Files (x86)\Avisynth 2.5\plugins\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,15)
V = ffdshow_source()
SetMTMode(2,15)
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, badSAD=2000, plevel=0, pelsearch=3, search=3, searchparam=3, badrange=(-24))
B = S.MAnalyse(isb=false, blksize=16, overlap=4, badSAD=2000, plevel=0, pelsearch=3, search=3, searchparam=3, badrange=(-24))
C = S.MRecalculate(A, blksize=8, overlap=2, search=3, searchparam=1)
D = S.MRecalculate(B, blksize=8, overlap=2, search=3, searchparam=1)
V.MSmoothFps(S, C, D, num=FramerateNumerator(V)*5, den=FramerateDenominator(V)*2, algo=23, sadgamma=2, sadml=0, ml=0, blend=true)
GetMTMode(false) > 0 ? distributor() : last
__________________
MPC-HC/MPC-BE, Lav Filters, MadVR
CPU: AMD Ryzen 5 1600, Video: AMD Radeon RX Vega 56 -> TCL S405 55", Audio: Audio-Technica M50S
fairchild is offline   Reply With Quote
Old 22nd May 2011, 21:57   #97  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
fairchild, have you tried other presets? There are still 4 more presets that are faster than that one
SubJunk is offline   Reply With Quote
Old 22nd May 2011, 22:15   #98  |  Link
fairchild
Registered User
 
Join Date: Sep 2010
Posts: 319
Quote:
Originally Posted by SubJunk View Post
fairchild, have you tried other presets? There are still 4 more presets that are faster than that one
I've tried the fastest preset "Ultra Fast" and it does work and doesn't drop as many frames, but there is a big quality drop that is most noticeable in fast action scenes and the audio goes way out of sync. With the Fast preset, my CPU is 100% stressed out and it begins to drop frames and looks like a slideshow since my system can't handle the decoding of the 720p video + real-time frame doubling. Perhaps if I had a faster CPU or a CPU with more cores (4+ cores) then it would possibly work.

But the scripts I posted should work well with multi-threaded stronger CPU's for real-time HD frame doubling. You possibly need to change the SetMTmode for cpu's with more threads/cores as using (2,2) is for a dual-core cpu.

So to sum up, for real-time SD, using the system in my sig the following code works for me with no frame drops or audio going out of sync. Only change I make is change the renderer to EVR-CP, because if I try using MadVR there will be frame drops randomly because MadVR uses more system resources.

Code:
SetMTmode(2,2)
ffdshow_source()
InterFrame(Preset="Medium", GPU=true, FlowPath="C:\Program Files (x86)\AviSynth 2.5\plugins\")
GetMTMode(false) > 0 ? distributor() : last
For HD I have a profile setup and just change the Preset=Ultra Fast
__________________
MPC-HC/MPC-BE, Lav Filters, MadVR
CPU: AMD Ryzen 5 1600, Video: AMD Radeon RX Vega 56 -> TCL S405 55", Audio: Audio-Technica M50S

Last edited by fairchild; 22nd May 2011 at 22:38.
fairchild is offline   Reply With Quote
Old 22nd May 2011, 22:34   #99  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Quote:
Originally Posted by fairchild View Post
I can't do real-time HD (720p and up).
[...]
I verified it does use both of my cores so it is multi-threaded.
For HD content, a dual-core very likely is too small.

To perform this kind of operation on HD content, a quad-core is strongly recommended.

Also, you definetly do NOT want to use FIFTEEN(!!) threads on a dualcore. More than 4 threads probably do more harm (overhead) than good.
__________________
- 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 23rd May 2011, 00:43   #100  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 441
Quote:
Originally Posted by fairchild View Post
I've tried the fastest preset "Ultra Fast" and it does work and doesn't drop as many frames, but there is a big quality drop that is most noticeable in fast action scenes and the audio goes way out of sync. With the Fast preset, my CPU is 100% stressed out and it begins to drop frames and looks like a slideshow since my system can't handle the decoding of the 720p video + real-time frame doubling. Perhaps if I had a faster CPU or a CPU with more cores (4+ cores) then it would possibly work.

But the scripts I posted should work well with multi-threaded stronger CPU's for real-time HD frame doubling. You possibly need to change the SetMTmode for cpu's with more threads/cores as using (2,2) is for a dual-core cpu.

So to sum up, for real-time SD, using the system in my sig the following code works for me with no frame drops or audio going out of sync. Only change I make is change the renderer to EVR-CP, because if I try using MadVR there will be frame drops randomly because MadVR uses more system resources.

Code:
SetMTmode(2,2)
ffdshow_source()
InterFrame(Preset="Medium", GPU=true, FlowPath="C:\Program Files (x86)\AviSynth 2.5\plugins\")
GetMTMode(false) > 0 ? distributor() : last
For HD I have a profile setup and just change the Preset=Ultra Fast
Depending on your CPU it's possible you could run 4 threads max like Didee said, so I would recommend trying 3 (using the maximum amount of threads is a bad idea).
So try:

Code:
SetMTmode(2,3)
ffdshow_source()
InterFrame(Preset="Ultra Fast", GPU=true, FlowPath="C:\Program Files (x86)\AviSynth 2.5\plugins\")
GetMTMode(false) > 0 ? distributor() : last
If that still drops frames for you, there is an update coming soon that will increase the speed a lot at the same quality.

Edit: Also you could try removing the SetMTMode line because it's possible the script is choking other programs, so maybe running single-threaded will be more stable for a dual-core CPU. It's a longshot but worth trying.
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 11:35.


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