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. |
20th November 2012, 09:06 | #1 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
FineSharp for VapourSynth
I ported Didée's FineSharp script to VapourSynth.
https://gist.github.com/chikuzen/6103665 requirement: VapourSynth r19 or later RemoveGrain.dll Repair.dll usage: at first, download (or copy/paste to your texteditor) and put it to python3.3/Lib/site-packages as 'finesharp.py'. Code:
import vapoursynth as vs import finesharp core = vs.get_core() core.avs.LoadPlugin('/path/to/RemoveGrain.dll') core.avs.LoadPlugin('/path/to/Repair.dll') clip = something fs = finesharp.FineSharp() clip = fs.sharpen(clip, other options...) finesharp 2016.08.21, updated for Vapoursynth R33, ~10% faster for 8bit input, no difference for 16bit. Note it requires Vapoursynth R33 or more recent.
__________________
my repositories Last edited by Wilbert; 21st August 2016 at 18:22. |
28th July 2013, 19:36 | #2 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Code:
return self.std.Lut2([c1, c2], lut, planes) Code:
return self.std.Lut2([c1, c2], planes=planes, lut=lut)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
29th July 2013, 12:25 | #4 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
updated first post link and example.
__________________
my repositories |
22nd October 2013, 17:59 | #5 | Link |
Registered User
Join Date: Feb 2013
Location: France
Posts: 23
|
Hello !
Using FineSharp with this r21 test version of Vapoursynth produces this strange result : Input Output |
22nd October 2013, 19:15 | #6 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
22nd October 2013, 19:57 | #9 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Whoever does those changes should change it to use gray format for the masks at the same time. No reason to waste memory on that.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
16th December 2014, 14:45 | #10 | Link |
Registered User
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
|
I updated it to make use of native filters only, to use gray format for all the filtering, and also ditched the class, so it should be easier to use.
Now it also supports 8, 9, 10 and 16 bits. finesharp 2014-12-17 requirement: VapourSynth r23 or later Usage: Download (or copy/paste to your texteditor) and put it in python3.4/Lib/site-packages as 'finesharp.py'. Code:
import vapoursynth as vs import finesharp core = vs.get_core() ... clip = something clip = finesharp.sharpen(clip, other options...) Last edited by Are_; 17th December 2014 at 18:36. Reason: updated |
16th December 2014, 14:49 | #11 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet Last edited by Myrsloik; 16th December 2014 at 14:52. Reason: I was wrong |
|
16th December 2014, 15:14 | #13 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
it's not that hard actually,
maybe take the original avs script as reference would be much easier it's almost a copy paste styleee work sstr = string (sstr) ----- sstr = repr (sstr) mt_lutxy (c,b,xxxxxxxx) ---- core.std.Expr ([c,b],["xxxxxxx"]) and to make the 8bpc expr work at 16bpc x ----- x 256 / y ----- y 256 / z ----- z 256 / and add 256 * at the end of the expr |
16th December 2014, 21:45 | #15 | Link | ||
Registered User
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
|
Quote:
Quote:
I tried what you said Myrsloik, but the output was not the same, more grainy, I guess my expresion sucked and I gave up. I will keep at it another day. Thanx for the tips feisty2, when I have a chance I will try to make it work that way. Btw, you don't need to convert anything to strings in python, that's an avisynth limitation when dealing with strings. In python you do something like: Code:
'x y %r - +' % (thr) Code:
'x y {thr} - +'.format(thr=thr) |
||
16th December 2014, 22:24 | #16 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
.format() is the preferred way to do string formatting in Python 3, the % notation is a Python 2 backwards compatibility thing. You can use .format() with positional arguments too, just use empty brackets:
Code:
'x y {} - +'.format(thr) Last edited by TheFluff; 16th December 2014 at 22:28. |
17th December 2014, 18:43 | #17 | Link |
Registered User
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
|
Updated to support 8, 9, 10 and 16 bits.
Is it normal for expr to not run multithreaded? Or it looks like it: Code:
No filtering: ~1700 fps, all cores about 50% finesharp lut: ~400 fps, all cores about 50% finesharp expr: ~50 fps, one core maxed out, all the other cores almost dormant |
17th December 2014, 23:25 | #18 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
One day I'm going to use runtime code generation. It's the only way to get good speeds out of this kind of filter...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
6th September 2015, 10:57 | #19 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
has anybody updates the script?
Code:
diff = self.Lut2([clip, c2], function=expr, planes=0) Code:
Python exception: Lut2: argument clipa is not of array type but more than one value was supplied Traceback (most recent call last): File "vapoursynth.pyx", line 1467, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:24719) File "D:\Temp\Encoding\test temp files\test.vpy", line 7, in <module> clip = finesharp.FineSharp().sharpen(clip = clip) File "D:\Projekte\GitHub\staxrip\bin\Apps\Plugins\vs\finesharp\finesharp.py", line 148, in sharpen diff = self.Lut2([clip, c2], function=expr, planes=0) File "vapoursynth.pyx", line 1366, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:23214) vapoursynth.Error: Lut2: argument clipa is not of array type but more than one value was supplied
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
6th September 2015, 11:36 | #20 | Link |
Registered User
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
|
Yes, in this very same page
|
Thread Tools | Search this Thread |
Display Modes | |
|
|