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 4th August 2022, 11:58   #4741  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Greenhorn View Post
What's the difference between Make/MergeDiff and Make/MergeFullDiff when using float format? Was that also clamped?
It's the same for float.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 7th August 2022, 19:16   #4742  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Quote:
Originally Posted by vapoursynth doc
ColorYUV std.Lut/std.Expr Do the adjustment yourself
https://github.com/amichaelt/vapours...isynthcomp.rst
Honestly, this is just too complicated to figure out for me, is there any helper functions available for this?

I tried to understand the code here: https://github.com/AviSynth/AviSynth...ters/color.cpp

But can not figure out how the Lut/expression for off_v is built from those functions...

I'm just trying to do the avisynth equivalent to "coloryuv(off_v=0.5)"
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 7th August 2022, 20:22   #4743  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by mastrboy View Post
Honestly, this is just too complicated to figure out for me, is there any helper functions available for this?

I tried to understand the code here: https://github.com/AviSynth/AviSynth...ters/color.cpp

But can not figure out how the Lut/expression for off_v is built from those functions...

I'm just trying to do the avisynth equivalent to "coloryuv(off_v=0.5)"
Add .5 to the third plane of a float format?

Code:
Expr(clip, ["", "", "x 0.5 +"])
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 7th August 2022, 21:29   #4744  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Quote:
Originally Posted by Myrsloik View Post
Add .5 to the third plane of a float format?

Code:
Expr(clip, ["", "", "x 0.5 +"])
Thanks, that works... I have a difficult time properly understanding lut/expr, is there any decent documentation freely available that is recommended for beginners that want to learn?

That only works for 8bit though, I guess ColorYUV scales input values internally... So what is the math to convert 8bit Expr to 16bit?

Edit: nevermind, found a helper function for scaling values between bitdepths: https://github.com/Irrational-Encodi...l/info.py#L129
__________________
(i have a tendency to drunk post)

Last edited by mastrboy; 7th August 2022 at 23:00.
mastrboy is offline   Reply With Quote
Old 15th September 2022, 15:19   #4745  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
R60 is released.
Quote:
fixed blankclip crashing when fpsnum or fpsden is 0 despite it being allowed
fixed invalid format ids sometimes being treated as api3 values when passed to resize
fixed error message frame generation in vfw
fixed writing beyond end out output buffer for audio in vfw
blankaudio now takes an array of channel constants since this better matches how most other functions work
fixed splitchannels crash on certain channel configurations (YomikoR)
added makefulldiff and mergefulldiff, these are versions of makediff and mergediff that don't clamp the difference to half range and instead use a higher precision diff clip
better error messages when filters get unsupported input formats or combinations thereof
freezeframes now accepts empty arrays and simply passes through the source clip
you can directly assign to frame-props
removed all deprecated (and replaced by better versions) functions in python: get_frame_async_raw, get_plugins, get_functions, list_functions, get_format, register_format
fixed convolution output for 9-15 bit material
source: https://github.com/vapoursynth/vapoursynth/releases

Thanks!

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 18th September 2022, 11:16   #4746  |  Link
Yomiko
Registered User
 
Join Date: Aug 2021
Posts: 73
Is there a way (with API4) to tell if a clip has "valid" variable format?
Yomiko is offline   Reply With Quote
Old 18th September 2022, 12:26   #4747  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Yomiko View Post
Is there a way (with API4) to tell if a clip has "valid" variable format?
What do you mean by "valid"? If you get an input clip that's variable format it'll always be valid. If a filter returns a frame that doesn't fit the description things will error out.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 18th September 2022, 15:09   #4748  |  Link
Yomiko
Registered User
 
Join Date: Aug 2021
Posts: 73
I was thinking about the recently fixed resize issue, where a clip with "dynamic" format might be mistakenly made. Although previewers actually can handle such output nodes, I hope users can be well informed.
Yomiko is offline   Reply With Quote
Old 29th September 2022, 12:48   #4749  |  Link
Yomiko
Registered User
 
Join Date: Aug 2021
Posts: 73
In the C headers of API 3, VideoFormat is provided as a pointer in VSVideoInfo, effectively preventing me from creating a var format clip in a filter. Since API 4 it has been changed in the C header, but in python it remains to be None when the clip format is variable. Do you have any plan to also change in python?
Yomiko is offline   Reply With Quote
Old 1st October 2022, 18:29   #4750  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Yomiko View Post
In the C headers of API 3, VideoFormat is provided as a pointer in VSVideoInfo, effectively preventing me from creating a var format clip in a filter. Since API 4 it has been changed in the C header, but in python it remains to be None when the clip format is variable. Do you have any plan to also change in python?
Change it to what? I don't understand the question.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 24th October 2022, 11:12   #4751  |  Link
Txico
Registered User
 
Join Date: Nov 2017
Posts: 8
Hello there,
As with any new Ubuntu release, I compile VapouSynth and plug-in from scratch. That's a new compiler versions used so it might help (or not).
With a newly installed Ubuntu 22.10 and after compiling VapourSynth and plug-ins I get an error every time I try a vpy script:
Script evaluation failed:
Python exception: attempted relative import with no known parent package

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 2819, in vapoursynth._vpy_evaluate
File "src/cython/vapoursynth.pyx", line 2820, in vapoursynth._vpy_evaluate
File "example.mp4.vpy", line 2, in <module>
import havsfunc as haf
File "/usr/local/lib/python3.10/site-packages/havsfunc.py", line 69, in <module>
import mvsfunc as mvf
File "/usr/local/lib/python3.10/site-packages/mvsfunc.py", line 59, in <module>
from ._metadata import __version__
ImportError: attempted relative import with no known parent package

I know, I know. It suck to be me but, can anyone at least point me in the correct direction?

Last edited by Txico; 24th October 2022 at 11:21.
Txico is offline   Reply With Quote
Old 24th October 2022, 14:26   #4752  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Have you installed mvsfunc like mentioned over at https://github.com/HomeOfVapourSynthEvolution/mvsfunc or did you just copy the mvsfunc.py file?
If you did the latter, it would explain the issue. (since _metadata.py is missing which includes the __version__-variable)

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 24th October 2022, 16:05   #4753  |  Link
Txico
Registered User
 
Join Date: Nov 2017
Posts: 8
Quote:
Originally Posted by Selur View Post
Have you installed mvsfunc like mentioned over at https://github.com/HomeOfVapourSynthEvolution/mvsfunc or did you just copy the mvsfunc.py file?
If you did the latter, it would explain the issue. (since _metadata.py is missing which includes the __version__-variable)

Cu Selur
I have uninstalled mvsfunc with pip3 uninstall mvsfunc and after that pip3 install git+https://github.com/HomeOfVapourSynthEvolution/mvsfunc as specified in the Git Hub page.
Perhaps there some reboot needed in between? Any cache that needs to be redone? Any other package that needs to be installed like this that I need to know?

Thank you for your quick answer Selur.
Txico

Last edited by Txico; 24th October 2022 at 16:07. Reason: Just more questioning
Txico is offline   Reply With Quote
Old 24th October 2022, 16:21   #4754  |  Link
Txico
Registered User
 
Join Date: Nov 2017
Posts: 8
Hello again,

After you pointed me to the mvsfunc issue I have uninstalled it again and then searched for any other mvsfunc file in my filesystem, and guess what... I found one where there should be none.
After deleting it and looking for it again without results this time, installing mvsfunc using pip again gets everything working. Flabbergasted.

Thank you, Cu Selur. That solved the issue.

Txico

Last edited by Txico; 24th October 2022 at 16:41. Reason: Grammar
Txico is offline   Reply With Quote
Old 30th October 2022, 07:00   #4755  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Can someone tell me how to translate:
Code:
clip.Mt_Convolution(Horizontal=" 1 1 1 ", vertical = " 1 ", u=1, v=1)
my guess atm. is 'clip.std.Convolution(matrix=[ 1 1 1 ], planes= [ 0 ])'
and
Code:
MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1)
(no clue)
and
Code:
Mt_AddDiff(Blurred, ReconstructedMedian)
to Vapoursynth? (Diff, Blurred, ReconstructedMedian are vs.Videonode and THR is a string-representation of an int)

Thanks!

Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 30th October 2022 at 07:17.
Selur is offline   Reply With Quote
Old 31st October 2022, 08:32   #4756  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Okay,
Avisynth:
Code:
Mt_AddDiff(Blurred, ReconstructedMedian)
<>
Vapoursynth:
Code:
core.std.MergeDiff(Blurred, ReconstructedMedian))
Avisynth:
Code:
MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1)
<>
Vapoursynth:
Code:
partial_expr = lambda M, N: f" x x[{M},{N}] - x x[{M},{N}] - x x[{M},{N}] - abs 1 + * x x[{M},{N}] - abs 1 + {THR} 1 >= {thr_s} 0.5 pow {THR} ? + / - 128 + "
medianDiff = core.akarin.Expr(diff, [partial_expr(0,0) + partial_expr(1,0) + partial_expr(-1,0) + "sort3 drop swap drop", ""])

=> But how to convert,
Avisynth
Code:
Mt_Convolution(Horizontal=" 1 1 0 0 1 0 0 1 1 ", vertical = " 1 ", u=1, v=1)
to Vapoursynth?

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 31st October 2022, 10:30   #4757  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
got it,
Code:
clip.std.Convolution(matrix=[ 1, 1, 0, 0, 1, 0, 0, 1, 1 ], mode='v', planes=[0])
works. (the mode='v' was the main issue)
Uploaded it to: https://github.com/Selur/Vapoursynth...r/fromDoom9.py

Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 31st October 2022 at 10:51.
Selur is offline   Reply With Quote
Old 20th November 2022, 18:21   #4758  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
R61-RC1 is out. Bug fixes only.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 20th November 2022, 19:22   #4759  |  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 29th November 2022, 19:52   #4760  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Selur View Post
Thanks
R61 released now. No changes from RC1.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth

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 09:56.


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