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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th February 2019, 03:24   #41  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Easiest, as in crop(36,36,-36,-36)

or
Code:
x=36
y=36
w=-36
h=-36
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 6th February 2019, 03:42   #42  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
Quote:
Originally Posted by StainlessS View Post
Easiest, as in crop(36,36,-36,-36)

or
Code:
x=36
y=36
w=-36
h=-36
Ahhhh, yes ...thanks.
Danette is offline   Reply With Quote
Old 18th November 2021, 16:56   #43  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
I noticed that the global variables are one frame late to current frame:
Code:
ShowChannels(SetVar=True,show=true)
scriptclip("""subtitle(string(SC_Min_0))""")
It also would be great to support HBD, 1/256 value jump is noticeable when doing levels or some sort of manipulation. Maybe an additional feature would be to flush values (maybe a third column) after a scene change. And support frameprops(?)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 18th November 2021, 18:10   #44  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Dogway View Post
I noticed that the global variables are one frame late to current frame:
Code:
ShowChannels(SetVar=True,show=true)
scriptclip("""subtitle(string(SC_Min_0))""")
You need to use ScriptClip(..., after_frame=true) so that the value is evaluated after the frame has been fetched from the filter above.
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 18th November 2021 at 18:25.
Gavino is offline   Reply With Quote
Old 18th November 2021, 19:32   #45  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanks G.
Quote:
It also would be great
Baring it in mind.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 18th November 2021, 20:10   #46  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Thanks Gavino! I'm making a soft limiter so I was thinking on feeding the (accumulated) loose minmax values, not sure how I can do it without HBD support, somehow I need to force the ShowChannels() call despite not using its output clip.
ColorYUV() has HBD support but didn't see how to extract values. I also want to add a per scene accumulated, a fast method is to reinitiate ShowChannels() after a scene change.


EDIT: Strange, new ScriptClip can't grab ShowChannels globals.
Code:
ShowChannels(SetVar=True,show=false)
ScriptClip( function [] () {
propSetArray("_YMin", function[]() { return [SC_Min_0,SC_Max_0] } )
}, after_frame=True )
 propshow()
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 18th November 2021 at 22:45.
Dogway is offline   Reply With Quote
Old 19th November 2021, 01:43   #47  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
EDIT: ShowChannels SC_LMn_0 and SC_LMx_0 are LOOSE min and max.

You can also use YPlaneMin(Threshold=0.0) and YPlaneMax(Threshold=0.0) for Ymin and Ymax.
YPlaneMin(Threshold=whatever%) and YPlaneMax(Threshold=whatever%) for loose min/max,
if not interested in other values. (and builtin HBD)


EDIT: ShowChannels defo sets Globals [some of my plugs set locals because of some problem/request or other reported by user].

EDIT: I have no idea what your script snippet does, I have not yet figured out that scriptclip function stuff.
But, does this work
Code:
ScriptClip( function [] () {
propSetArray("_YMin", function[]() { return [YPlaneMin(0.0),YPlaneMax(0.0)] } )
}, after_frame=True )     # Maybe After_Frame not needed : Presumably YPlaneMin/Max will be using implicit Last (or something ???)
 propshow()
__________________
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; 19th November 2021 at 02:34.
StainlessS is offline   Reply With Quote
Old 19th November 2021, 02:02   #48  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Yes, maybe I will do that for not accumulated, although that uses 0.4 percentile (?)
I wanted some kind of temporal average for the values.
I managed somewhat to pass the global vars to SoftLimiter, but with the old ScriptClip.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 19th November 2021, 03:16   #49  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ColorYUV(analyse=true)
uses 0.4, actually total Y sample count / 256 for Y, and total Y sample count / 1024 for U and V (when YV12, so still 0.4).
[old v2.58 ColorYUV which I have source for].
ShowChannels uses default 0.1%.

Quote:
Originally Posted by StainlessS View Post
Code:
Loose minimum uses the filter arg float MinPerc, a percentage of total pixels to ignore
when finding the loose minimum, allows to ignore extreme stray pixels.

Loose maximum uses the filter arg float MaxPerc, a percentage of total pixels to ignore
when finding the loose maximum, allows to ignore extreme stray pixels.
Same as loose minimum/maximum in ColorYUV Analyze=true
Code:
analyze can be true or false. This will print out color statistics on the screen. 
There are maximum and minimum values for all channels. 
There is an average for all channels.
There is a "loose maximum" and "loose minimum". The "loose" values are made to filter out very bright
or very dark noise creating an artificially low or high minimum / maximum.
Quote:
Originally Posted by StainlessS View Post
YPlaneMin/YPlaneMax has the same sort of thing where what I've called 'MinPerc/MaxPerc' uses name of 'Threshold'.

Code:
YPlaneMin   |   v2.x   |   YPlaneMin(clip, float threshold) 
YPlaneMax   |   v2.x   |   YPlaneMax(clip, float threshold) 

threshold is a percentage, stating how many percent of the pixels are allowed above or below minimum.
The threshold is optional and defaults to 0.
# ...

Comment From ColorYUV source
Code:
 // When 1/256th of all pixels have been reached, trigger "Loose min/max"
So ColorYUV ignores 1/256 of the darkest/lightest pixels, YPlaneMin ignores 0% default, and ShowChannels 0.1% or 1/1000 by default,
so a Minperc/Maxperc of 0.4% would be about the same as ColorYUV uses.
EDIT: Should it matter that TV levels range is 220 [not 256] ie 235-16+1, where is 1/220*100 = 0.45454 %.
__________________
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; 19th November 2021 at 03:29.
StainlessS is offline   Reply With Quote
Reply

Tags
channels, info, max, min

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 05:13.


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