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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st August 2017, 22:38   #1  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,170
VapourSynth Available Plugins

I'm facing performance issues in Avisynth with MvTools2, which affects SMDegrain and FrameRateConverter, especially when using DCT=1 (where it freezes with MT), so I'm looking for workarounds.

Is MvTools2 stable with VapourSynth? I heard it is stable even with DCT=1. DCT=1 mode is extremely slow in Avisynth, but is the computation performance the same or has it been improved somehow?

To consider VapourSynth, I have to look at my other needs, whether there are replacements.

- Any updates on audio support? That was the main issue.

- SMDegrain has been ported to VapourSynth, correct?

- According to my tests, the best deshaker is Deshaker 3.1 for VirtualDub ... does that work with VapourSynth, or is there a better alternative? It's a bit hard to use but gives clearer outputs than any other I tested.

- I use RoboCrop to auto-detect borders, is there a replacement for it?

- FrameRateConverter and AvisynthShader haven't been ported to VapourSynth. Oh right... I wrote those. Sorry.

So... how is VapourSynth on the above points? The main thing is audio, which might require running both VapourSynth and Avisynth in parallel, which could be an option too.

Last edited by MysteryX; 1st August 2017 at 23:12.
MysteryX is offline   Reply With Quote
Old 1st August 2017, 23:16   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
Quote:
Originally Posted by MysteryX View Post
Is MvTools2 stable with VapourSynth? I heard it is stable even with DCT=1. DCT=1 mode is extremely slow in Avisynth, but is the computation performance the same or has it been improved somehow?
Not sure, do you have some simple script to replicate the problem in avisynth ?

Quote:
- Any updates on audio support? That was the main issue.
No

Quote:
- SMDegrain has been ported to VapourSynth, correct?
Yes

Quote:
- According to my tests, the best deshaker is Deshaker 3.1 for VirtualDub ... does that work with VapourSynth, or is there a better alternative? It's a bit hard to use but gives clearer outputs than any other I tested.
Not directly; but you can load avs scripts into vapoursynth

Is that how you are using it ? deshaker in avisynth ?

or you can use intermediate file out of vdub/deshaker

Quote:
- FrameRateConverter and AvisynthShader haven't been ported to VapourSynth. Oh right... I wrote those. Sorry.
see above
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 00:55   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,087
Quote:
I use RoboCrop to auto-detect borders, is there a replacement for it?
AutoCrop for VS, on 2nd page of VS forum, or here:- https://forum.doom9.org/showthread.php?t=174542

EDIT:
Quote:
Search and crop borders with matching color ... Output is a clip with varying dimensions
Not sure if that means that output varies in size over time, or not.

EDIT:
Quote:
Please note that the filter output will not have a constant size and may need to be resized.
Guess that makes it clear.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd August 2017 at 01:02.
StainlessS is online now   Reply With Quote
Old 2nd August 2017, 00:57   #4  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,170
Quote:
Originally Posted by poisondeathray View Post
Not sure, do you have some simple script to replicate the problem in avisynth ?
FrameRateConverter shows these problems.

At its core, it uses jm_fps script which has the same issues
Code:
# Motion Protected FPS converter script by johnmeyer from Doom9
# Slightly modified interface by manolito
# Requires MVTools V2 and RemoveGrain
# Also needs fftw3.dll in the System32 or SysWOW64 folder


function jm_fps(clip source, float "fps")
{
fps = default(fps, 25.000)
fps_num = int(fps * 1000)
fps_den = 1000

prefiltered = RemoveGrain(source, 22)
super = MSuper(source, hpad = 16, vpad = 16, levels = 1) # one level is enough for MRecalculate
superfilt = MSuper(prefiltered, hpad = 16, vpad = 16) # all levels for MAnalyse
backward = MAnalyse(superfilt, isb = true, blksize = 16, overlap = 4, search = 3, dct = 0)
forward = MAnalyse(superfilt, isb = false, blksize = 16, overlap = 4, search = 3, dct = 0)
forward_re = MRecalculate(super, forward, blksize = 8, overlap = 2, thSAD = 100)
backward_re = MRecalculate(super, backward, blksize = 8, overlap = 2, thSAD = 100)
out = MFlowFps(source, super, backward_re, forward_re, num = fps_num, den = fps_den, blend = false, ml = 200, mask = 2)

return out
}
With MT, DCT=0 works mostly fine but someone still reported issues with long runs, and CPU usage isn't great. DCT=1 has low CPU usage and freezes after a while. ST mode works fine.

Having to run parts in Avisynth and parts in Vapoursynth would just complicate things further and wouldn't really solve much. For Deshaker, it can run within Avisynth just fine.
MysteryX is offline   Reply With Quote
Old 2nd August 2017, 02:39   #5  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,130
DCT1 simply can't be further improved, fftw is doing all the dirty work when dct is on and it's slow as fuck (even tho it's already highly optimized, dft is just gonna take some time cuz it's complex)
You should bitch to the fftw folks
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 2nd August 2017, 03:10   #6  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
But for dct=1 "freezing with MT" , does that mean complete freeze after a while , ie zero FPS (ie. script doesn't complete) , or just "very very slow" but eventually completes ?
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 03:14   #7  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,170
Quote:
Originally Posted by poisondeathray View Post
But for dct=1 "freezing with MT" , does that mean complete freeze after a while , ie zero FPS (ie. script doesn't complete) , or just "very very slow" but eventually completes ?
It means that it progresses well but at some point it completely stops moving. I get up in the morning and have to kill the process and start over.

When doing it in several segments and merging the files, I've seen cases where some frames were at the wrong location. I'm suspecting this to be due to when the script froze -- causing frame corruption somehow. Or maybe it's unrelated.

"slow as f*ck", I don't mind. But when it uses 20% CPU at half the CPU's max frequency, I can't help but think it could be better. Is the problem related to MvTools or FFTW? I don't know. Perhaps MvTools2 issues should be resolved first (with DCT=0) before looking at improving the code passing through FFTW.

With DCT=1, it uses internal code with BlkSize=8. We'll have to test whether those issues appear there. I haven't run that test yet.

Last edited by MysteryX; 2nd August 2017 at 03:19.
MysteryX is offline   Reply With Quote
Old 2nd August 2017, 03:44   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
Which avs version ? avisynth 64+ MT ? or have you tested "vanilla" MT yet ?

Does that occur with jm_fps + MT only ? can you reproduce it with that only? Or do you need FrameRateConverter ?

The reason I ask is if you want to test it , the avs version has to be "translated" into equivalent "vapoursynth-ese" . (obviously, just running an avs script within vapoursynth will demonstrate nothing of value). And I probably can' t do the translation
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 04:14   #9  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,130
mvtools got this little "temporal" parameter that requires a linear frame request, it's incompatible with multi threading and got removed in the VS versions (both jackoneill's and mine)
Maybe it was on in ur avs mt mess and got the shit all fucked up
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 2nd August 2017, 06:58   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
Yes , I can replicate the avisynth MT issue in this post , despite trying some manipulations like mod16 (1280x720 instead of 1288x720), tried reducing prefetch value etc.. . Crashes very quickly . Always.
https://forum.doom9.org/showthread.p...95#post1813995

It's stable in vpy with dct=1, 100% CPU usage . I only tested for a few minutes, but the crash in avs occurred everytime in seconds or less.

But I used an image instead of colorbarshd() source (I don't see equivalent in vapoursynth), and removegrain mode=22 might be different. In the vpy documentation mode=22 is reported as "to do" , but I doubt those would make a big difference
http://www.vapoursynth.com/doc/plugins/rgvs.html

Code:
import vapoursynth as vs
core = vs.get_core()
clip = core.lsmas.LWLibavSource(r'F:\image720.png')
clip = clip * 100000
clip = core.std.AssumeFPS(clip, fpsnum=30, fpsden=1)
clip = core.resize.Bicubic(clip, format=vs.YUV420P8, matrix_s="709")

prefiltered = core.rgvs.RemoveGrain(clip, mode=22)
super = core.mv.Super(clip, hpad = 16, vpad = 16, levels = 1)
superfilt = core.mv.Super(prefiltered, hpad = 16, vpad = 16)
backward = core.mv.Analyse(superfilt, isb = True, blksize = 8, overlap = 4, search = 3, dct = 1)
forward = core.mv.Analyse(superfilt, isb = False, blksize = 8, overlap = 4, search = 3, dct = 1)
forward_re = core.mv.Recalculate(super, forward, blksize = 4, overlap = 2, thsad = 100)
backward_re = core.mv.Recalculate(super, backward, blksize = 4, overlap = 2, thsad = 100)
clip = core.mv.FlowFPS(clip, super, backward_re, forward_re, num = 60, den = 1, blend = False, ml = 200, mask = 2)

#	prefiltered = RemoveGrain(source, 22)
#	super = MSuper(source, hpad = 16, vpad = 16, levels = 1)
#	superfilt = MSuper(prefiltered, hpad = 16, vpad = 16) # all levels for MAnalyse
#	backward = MAnalyse(superfilt, isb = true, blksize = 8, overlap = 4, search = 3, dct = 1)
#	forward = MAnalyse(superfilt, isb = false, blksize = 8, overlap = 4, search = 3, dct = 1)
#	forward_re = MRecalculate(super, forward, blksize = 4, overlap = 2, thSAD = 100)
#	backward_re = MRecalculate(super, backward, blksize = 4, overlap = 2, thSAD = 100)
#	out = MFlowFps(source, super, backward_re, forward_re, num = fps_num, den = fps_den, blend = false, ml = 200, mask = 2)
clip.set_output()

Last edited by poisondeathray; 2nd August 2017 at 07:00.
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 07:05   #11  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,170
In that post, it crashes with BlkSize=8 because that doesn't use FFTW. With BlkSize=16, it should run for a while and not crash but instead freeze.
MysteryX is offline   Reply With Quote
Old 2nd August 2017, 07:10   #12  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
Quote:
Originally Posted by MysteryX View Post
In that post, it crashes with BlkSize=8 because that doesn't use FFTW. With BlkSize=16, it should run for a while and not crash but instead freeze.
Did you mean blksize = 16 for both manalyze only, or changes in mrecalculate as well ?

(vpy is case sensitive, but I can be lazy with avisynth )
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 07:18   #13  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
Quote:
Originally Posted by MysteryX View Post
In that post, it crashes with BlkSize=8 because that doesn't use FFTW. With BlkSize=16, it should run for a while and not crash but instead freeze.
How long is "run for a while" before it freezes ?

I changed blksize of both manalyze to 16 and it's been running >10min with no slowdown
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 07:39   #14  |  Link
VS_Fan
Registered User
 
Join Date: Jan 2016
Posts: 91
Quote:
Originally Posted by MysteryX View Post
In that post, it crashes with BlkSize=8 because that doesn't use FFTW. With BlkSize=16, it should run for a while and not crash but instead freeze.
The problem with your script is not related to DCT=1 in MAnalyse, but instead with the different blocksizes and overlaps in MAnalyse and MRecalculate.

I tried changing MRecalculate with the same blocksize and overlap you used in MAnalyse. This effectively prevents the crash in your script. Although it unfortunately is not what you intend to do, I hope this helps to find/fix a potential bug in MVTools pfmod.
VS_Fan is offline   Reply With Quote
Old 2nd August 2017, 07:57   #15  |  Link
george84
Registered User
 
Join Date: Jan 2012
Posts: 104
Error loading plugin libimwri

Newest Vapoursynth was installed from ppa on ubuntu 16.04.

Trying to load plufin imwrif, because autoload doesn't load it, gives error:

PHP Code:
Python exceptionFailed to load /usr/lib/i386-linux-gnu/vapoursynth/libimwri.soError given: /usr/lib/i386-linux-gnu/vapoursynth/libimwri.soundefined symbol_ZTIN6Magick9ExceptionE 
Is this an error in libimwri or is imagemagick not found?
george84 is offline   Reply With Quote
Old 2nd August 2017, 17:46   #16  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,170
As I look into the possibility of using VapourSynth in my encoding software, the next roadblock is that this requires Python: an extra 29.1MB download and component to maintain. For my software, this makes the list of dependencies too long: .NET, Avisynth, bunch of Avisynth plugins, and then adding Python and Python plugins would make the installer size grow much bigger. That's the 2nd reason why I haven't looked into VapourSynth yet.
MysteryX is offline   Reply With Quote
Old 2nd August 2017, 18:27   #17  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
Quote:
Originally Posted by MysteryX View Post
As I look into the possibility of using VapourSynth in my encoding software, the next roadblock is that this requires Python: an extra 29.1MB download and component to maintain. For my software, this makes the list of dependencies too long: .NET, Avisynth, bunch of Avisynth plugins, and then adding Python and Python plugins would make the installer size grow much bigger. That's the 2nd reason why I haven't looked into VapourSynth yet.
There are "portable" options you can look at too

But I agree it's a big hassle maintaining all those versions, plugins, dependencies ; especially if you need a certain python version for other programs too
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 18:39   #18  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,170
What are the portable options?

I'm also wondering. SVP runs on Python but doesn't require Python.
MysteryX is offline   Reply With Quote
Old 2nd August 2017, 18:57   #19  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,919
Quote:
Originally Posted by MysteryX View Post
What are the portable options?

I'm also wondering. SVP runs on Python but doesn't require Python.
portable vapoursynth, portable/embedded python

I don't use them, I don't know all the details - but I think some of the GUI's like staxrip , hybrid use them
poisondeathray is offline   Reply With Quote
Old 2nd August 2017, 19:33   #20  |  Link
hBIkOa7m
Registered User
 
Join Date: Feb 2016
Posts: 6
Quote:
Originally Posted by MysteryX View Post
As I look into the possibility of using VapourSynth in my encoding software, the next roadblock is that this requires Python: an extra 29.1MB download and component to maintain. For my software, this makes the list of dependencies too long: .NET, Avisynth, bunch of Avisynth plugins, and then adding Python and Python plugins would make the installer size grow much bigger. That's the 2nd reason why I haven't looked into VapourSynth yet.
VapourSynth only uses Python for the scripting framework VSScript. I don't know any VPY plugins that use generic Python modules so you won't need to support Python plugins or a manager just to make scripting in VapourSynth work.

So you could link your software to the VapourSynth library without the Python dependency depending on what you want to do with it. What is your encoding software where adding Python and VapourSynth is too big of an overhead? I can't imagine the existing installer is very small with .NET already in there.
hBIkOa7m is offline   Reply With Quote
Reply

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 17:00.


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