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 21st August 2016, 10:34   #41  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
I thing the point is that https://gist.github.com/4re/8676fd350d4b5b223ab9 works and https://gist.github.com/chikuzen/6103665 doesn't
Whether another sharpener (minsharp, AWarpSharp2) might be better suited for whatever sharpening hydra3333 wants to perform shouldn't really matter,..
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 21st August 2016, 13:05   #42  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
finesharp 2016.08.21, updated for Vapoursynth R33, ~10% faster for 8bit input, no difference for 16bit.

Last edited by Wilbert; 21st August 2016 at 18:21.
Are_ is offline   Reply With Quote
Old 21st August 2016, 13:11   #43  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Thanks.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 21st August 2016, 16:54   #44  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 540
Thank you.
Quote:
Originally Posted by ~SimpleX~ View Post
This script needs an upgrade, it uses avisynth functions instead of VS equivalents. Why do you even need finesharp? It's designed for realtime sharpening of upscaled (720 -> 1080) videos. Not quite suitable for video processing.
Was just comparing it to LSFmod's output, however with the default settings it appears to be a tad brutal for my needs. Oh well. I see some posts spelling is about as fine as my lazy efforts
hydra3333 is offline   Reply With Quote
Old 21st August 2016, 16:58   #45  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 540
Quote:
Originally Posted by Are_ View Post
fiensharp 2016.08.21, updated for Vapoursynth R33, ~10% faster for 8bit input, no difference for 16bit.
Thanks. R33 hasn't a formal release. Does it work with R32 ?

edit: no it doesn't.
Code:
T:\HDTV\WDTVlive\MP4-VS\1>"C:\SOFTWARE\Vapoursynth\VSPipe.exe" "T:\HDTV\WDTVlive\MP4-VS\1\test.mpg.2016.08.22.01.28.50.60.vpy" - --y4m   | "C:\SOFTWARE\ffmpeg\0-homebuilt-x64\x264-mp4.exe" - --stdin y4m --thread-input --frames 45810 --profile high --level 4.1 --preset slow --interlaced --tff --no-cabac --crf 14 --sar 64:45 --colormatrix bt470bg -o "s:\HDTV\WDTVlive\MP4-VS\1\test-temp.2016.08.22.01.28.50.60.h264"
Script evaluation failed:
Python exception: VapourSynth version should be 33 or greater.
Traceback (most recent call last):
  File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26897)
  File "T:\HDTV\WDTVlive\MP4-VS\1\test.mpg.2016.08.22.01.28.50.60.vpy", line 469, in <module>
    main()
  File "T:\HDTV\WDTVlive\MP4-VS\1\test.mpg.2016.08.22.01.28.50.60.vpy", line 154, in main
    video = finesharp.sharpen(video,mode=1,sstr=1.0)
  File "C:\SOFTWARE\Vapoursynth\finesharp.py", line 109, in sharpen
    raise EnvironmentError('VapourSynth version should be 33 or greater.')
OSError: VapourSynth version should be 33 or greater.

Last edited by hydra3333; 21st August 2016 at 17:10.
hydra3333 is offline   Reply With Quote
Old 21st August 2016, 17:44   #46  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
This version of finesharp would be too slow on vapoursynth 32
Are_ is offline   Reply With Quote
Old 24th August 2016, 10:30   #47  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 540
OK, am trying x64 VS R33 (it released today)
hydra3333 is offline   Reply With Quote
Old 16th December 2017, 19:25   #48  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Haven't used finesharp for a while, but calling:
Code:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/Support/fmtconv.dll")
core.avs.LoadPlugin(path="G:/Hybrid/vsfilters/SourceFilter/DGDecNV/DGDecodeNV.dll")
# Import scripts
import finesharp as finesharp
# Loading H:\to convert\test.mkv using DGSource
clip = core.avs.DGSource("H:/Temp/mkv_7ddb2a359f7f3ecc066d816f3985a1f6_14604.dgi")
# sharpening using FineSharp
clip = finesharp.sharpen(clip=clip, mode=3)

# Output
clip.set_output()
(using VS R40)
I get:
Code:
Failed to evaluate the script:
Python exception: float() argument must be a string or a number, not 'vapoursynth.VideoNode'

Traceback (most recent call last):
  File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
  File "H:\Temp\tempPreviewVapoursynthFile19_09_28_896.vpy", line 17, in <module>
    clip = finesharp.sharpen(clip=clip, mode=3)
  File "G:\Hybrid\vsscripts\finesharp.py", line 155, in sharpen
    c2 = core.std.Median(clip).std.Convolution(clip, matrix=[1, 2, 1, 2, 4, 2, 1, 2, 1])
  File "src\cython\vapoursynth.pyx", line 1702, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:34634)
  File "src\cython\vapoursynth.pyx", line 530, in vapoursynth.typedDictToMap (src\cython\vapoursynth.c:12921)
TypeError: float() argument must be a string or a number, not 'vapoursynth.VideoNode'
The finesharp script I use is Rev 2016-08-21.
-> tested a bit more and when I'm not using 'mode=..' it works, but using mode = 2 or mode = 3 causes the crash. Did I miss something or did this never work?

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 16th December 2017, 19:51   #49  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Yeah, brainfart, try it again.
Are_ is offline   Reply With Quote
Old 17th December 2017, 08:54   #50  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Found it, changing line 155, from
Code:
        c2 = core.std.Median(clip).std.Convolution(clip, matrix=[1, 2, 1, 2, 4, 2, 1, 2, 1])
to
Code:
        c2 = core.std.Median(clip).std.Convolution(matrix=[1, 2, 1, 2, 4, 2, 1, 2, 1])
fixes the issue.
Thanks for fixing.

Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 17th December 2017 at 09:12.
Selur is offline   Reply With Quote
Old 17th December 2017, 12:12   #51  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
I meant I brainfarted while coding that part and already fixed it in the gist, sorry for the misunderstanding.
Are_ is offline   Reply With Quote
Old 30th October 2019, 17:23   #52  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
I get error with some sstr values like 0.1, 0.2

But 0.25, or 0.3, or 1, or 1.2 etc... will work

Quote:
File "PATH\finesharp.py", line 133, in sharpen
cstr = float(cstr)
TypeError: can't convert complex to float
Using this version 2019-10-10
https://gist.github.com/4re/8676fd350d4b5b223ab9

Code:
clip = core.std.BlankClip(width=640, height=480, format=vs.YUV420P8, fpsnum=24, fpsden=1, length=240, color=[128, 128, 128])
fs = finesharp.sharpen(clip, sstr=0.2)
poisondeathray is offline   Reply With Quote
Old 31st October 2019, 01:33   #53  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Avisynth version doesn't return an error there? (No windows right here so I can't check it).

I don't know anything about math, but at some point in the code cstr becomes a complex number, and that is a problem for the rest of the script.
I think the proper solution is to put a check somewhere to tell you not to go so low with sstr if cstr is not defined.
Are_ is offline   Reply With Quote
Old 31st October 2019, 01:39   #54  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Are_ View Post
Avisynth version doesn't return an error there? (No windows right here so I can't check it).

I don't know anything about math, but at some point in the code cstr becomes a complex number, and that is a problem for the rest of the script.
I think the proper solution is to put a check somewhere to tell you not to go so low with sstr if cstr is not defined.
No error with avs version when using sstr=0.2 or 0.1
poisondeathray is offline   Reply With Quote
Old 3rd November 2019, 05:06   #55  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
It should be "fixed" now.
All vapoursynth finesharp scripts had a typo, truth is avisinth also throws an error when sstr goes too low and you use a mode lower than 0.
Are_ is offline   Reply With Quote
Old 3rd November 2019, 05:32   #56  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Are_ View Post
It should be "fixed" now.
All vapoursynth finesharp scripts had a typo, truth is avisinth also throws an error when sstr goes too low and you use a mode lower than 0.
Thanks working now
poisondeathray 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:03.


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