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. |
5th October 2020, 13:04 | #4023 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
|
5th October 2020, 13:09 | #4024 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
On the github website there is a search field in the top left corner, enter BlankClip there or whatever you search.
Or download the code, open the code folder in Visual Studio Code and click on the search button in the side bar. https://github.com/vapoursynth/vapou...implefilters.c
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
7th October 2020, 07:29 | #4025 | Link | |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
Quote:
Code:
VSNodeRef* node = vsapi->propGetNode(in, "clip", 0, &err); if (!err) { d.vi = *vsapi->getVideoInfo(node); vsapi->freeNode(node); hasvi = 1; } in the arInitial part what is the purpose of the following? Code:
if (d->vi.fpsNum > 0) { VSMap* frameProps = vsapi->getFramePropsRW(frame); vsapi->propSetInt(frameProps, "_DurationNum", d->vi.fpsDen, paReplace); vsapi->propSetInt(frameProps, "_DurationDen", d->vi.fpsNum, paReplace); } What is keep? May be I am testing your patience! Sorry for it. Last edited by vcmohan; 7th October 2020 at 07:33. |
|
7th October 2020, 11:46 | #4026 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
you could try using my c++ wrapper for the vs api, things are as simple, straightforward and obvious as it can get.
this is an example that has no input but has multiple outputs: https://github.com/IFeelBloated/vsFi...es/Palette.hxx |
10th October 2020, 14:27 | #4027 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Small question about the whole Limiter&Levels filter:
Can someone clear this up? Is it okay to use Limiter&Levels on YUV content, or should they only be used on RGB content and the planes-parameter is basically a bad idea? Or is RGB only required for Levels when gamma is used? Cu Selur |
10th October 2020, 18:39 | #4028 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
with:
Code:
# Loading F:\TestClips&Co\files\10bit Test.mkv using LWLibavSource clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/files/10bit Test.mkv", format="YUV420P10", cache=0) # making sure input color matrix is set as 470bg clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited") # making sure frame rate is set to 25 clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1) # Setting color range to TV (limited) range. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1) # Color Adjustment clip = core.std.Levels(clip=clip, min_in=160, max_in=1020, min_out=160, max_out=880) # adjusting output color from: YUV420P10 to YUV420P8 for x264Model (i420@8-bit) clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited") I get a green image, where as when using: Code:
clip = core.std.Levels(clip=clip, min_in=0, max_in=1020, min_out=160, max_out=880) everything looks fine. -> to me this looks like there is some problem/bug with the min_in restriction with YUV420P10 Cu Selur iirc scaling should be: Code:
bit depth TV scale PC scale 8 bit 16-235 0-255 10 bit 64-940 0-1023 12 bit 256-3760 0-4095 Last edited by Selur; 10th October 2020 at 18:45. |
10th October 2020, 21:31 | #4030 | Link |
Registered User
Join Date: Mar 2020
Posts: 134
|
poisondeathray, Y levels looks more like special effect than something commonly used. See my post here
https://forum.doom9.org/showthread.p...97#post1923597 |
10th October 2020, 21:58 | #4031 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
(Gamma can refer to Y plane; it acts as "power" function - and you can check with a Y waveform; but usually not applied to CbCr planes because they are color difference channels) Levels in YUV , generally refers to Y plane only; applying it to the CbCr planes is the reason for the green discoloration Selur is observing Last edited by poisondeathray; 10th October 2020 at 22:13. |
|
10th October 2020, 22:19 | #4032 | Link |
Registered User
Join Date: Mar 2020
Posts: 134
|
Levels in-out min-max applied in YUV to Y only also look subjectively incorrect and very different to Levels applied in RGB to all planes.
Same as Gamma, Levels in-out min-max applied in YUV to Y only look more like some sort of special effect but not like something that people usually expect from levels correction. |
10th October 2020, 22:26 | #4033 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Levels in/out min/max and gamma in Y looks correct for a Y levels correction. That's what a Y levels adjustment means. RGB is additive color model . If you start with x value of R and double it, it gets more "red" . Same with Y' (in terms of it increases in brightness, it's not necessarily double) . But this does not happen with CbCr because they are color difference channels - the color completely changes |
|
10th October 2020, 23:38 | #4034 | Link |
Registered User
Join Date: Mar 2020
Posts: 134
|
This is all correct and was explained few posts earlier. I just try to explain that there two options to apply Levels/Gamma/Limiter that give different results:
- RGB channels together - Y in YUV model Why do you think that Y in YUV model looks correct but RGB is incorrect? If you compare result to image editors it appears that Y in YUV model looks "incorrect". My personal understanding of this filter is that both results look interesting and may be useful depending of artistic taste or some special requirement. Levels/Gamma/Limiter in RGB model behave like classic Levels tool in any image editing app. Levels/Gamma/Limiter - Y in YUV model probably behave more like some sort of analogue video filter in equipment that operates in YUV. |
11th October 2020, 00:41 | #4036 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
I said it was correct for Y, and working correctly for Y channel Quote:
|
||
11th October 2020, 05:58 | #4037 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
I guess the confusion is that one intuitively assumes that YUV + planes=all would behave like RGB.
Okay, so: a. either applying level limits only in Y or RGB (Levels and Limiter) b. when using gamma always use RGB (Levels) or expect the unexpected? |
11th October 2020, 06:56 | #4038 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
But if you use min/max in/out parameters, or gamma, range compression/expansion is applied or a power function (for gamma) - and that's when you can get unexpected results because of the way CbCr's works (color difference) RGB range limiting is rare. There are 2 situations where the RGB range would be limited - for r103 compliance or studio range RGB. RGB is typically "full range" in 99.99999% of scenarios. Quote:
Not always; Adjusting "Gamma" - the parameter - can be used on Y channel as a power function . eg. you might want to roughly brighten shadows to a higher degree than highlights The math for the Y curve is the same as , R, G, B curves (ie. the shape of the curve) when you adjust "gamma" for the latter. YUV obviously isn't RGB, so there is no reason to assume you'd get something visually similar If you view a Y waveform, you can see what levels (any of the parameters, including gamma) in Y is actually doing to the image. People have used levels or smoothlevels in avisynth (since forever) . You know this, Selur There are scenarios/ reason why one might prefer manipulations in YUV, but others in RGB NLE's that work in YUV - their YUV levels "gamma" parameter works the same way, and their R,G,B "gamma" parameter for RGB levels works like an image editor |
||
12th October 2020, 15:15 | #4039 | Link | |
Registered User
Join Date: Dec 2017
Posts: 12
|
Quote:
What are you trying to do? Last edited by HuBandiT; 12th October 2020 at 22:59. |
|
Tags |
speed, vaporware, vapoursynth |
|
|