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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 16th January 2012, 18:29   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
ShowChannels() v0.09 - 15 Jan 2019

ShowChannels(), (c) 2012/2019 StainlessS,
Requires VS2008 CPP runtimes.

Plugins for Avisynth v2.5 & v2.6, x86 & x64

Planar, YUY2 and RGB.
Code:
  v0.0, 1st public release.
  v0.1, 16 Jan  2012, better formatting, added MinPerc/MaxPerc args.
  v0.2, 15 Sept 2012, Fixed RGB offset bug.
  v0.3beta, 7 Oct 2012, Added Setvar stuff
  v0.4, 15 Oct 2012, Added AccFile
  v0.5, 31 Oct 2012, Added x,y,w,h coords, not colorspace restricted (real pain in the bum to implement).
      Can use odd coords for eg YV12, and even sample a single pixel.
  v0.6, 05 Dec 2012. Added Interlaced arg for Planar only. Now gets correct chroma for planar interlaced , even down to single pixel.
  v0.7, 20 Apr 2013, Added Compile for v2.6 stuff.
  v0.8, 30 Mar 2015, v2.6 dll compile with Avisynth Version 6 Header.
  v0.9, 15 Jan 2019, Moved to VS2008, Added version resource + x64.
Code:
ShowChannels(), (c) 2012/2019 StainlessS,     https://forum.doom9.org/showthread.php?t=163829
Requires VS2008 CPP runtimes.

Plugins for Avisynth v2.5 & v2.6, x86 & x64

Planar, YUY2 and RGB.

Simple plugin whose only function is to display the average Y,U and V
values for a YUV frame or R,G, and B for an RGB frame.
Also shows accumulated average for all frames visited so far.

Typical output for a YUV clip:-
---------------------------

347 ] Frames Visited = 348

          This Frame           Accumulated
       Y     U      V        Y     U      V
 Ave  77.00 125.52 125.42   70.91 125.87 125.78
 Min   4     80     95       0     69     83
 Max 255    177    165     255    190    174
~Min  14     95    101      12     92    101
~Max 234    167    148     235    167    151

---------------------------

where
 'AVE' shows average for current frame and accumulated average for all visited frames.

 'MIN' shows minimum value for a channel, this frame and accumulated.

 'MAX' shows maximum value for a channel, this frame and accumulated.

 '~MIN' shows loose minimum value for a channel, this frame and accumulated.

 '~MAX' shows loose maximum value for a channel, this frame and accumulated.

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 (noise).

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 (noise).

The "loose" values are made to filter out very bright
or very dark noise creating an artificially low or high minimum / maximum.

The Accumulated Ave is a "Average of Averages", or "Average Mean" or "Mean Average", take your pick but accumulated seemed more appropriate
considering that it was not restricted to describing just the averages. Accumulated Min is the minimum of all minimums so far, etc.

Usage:-

ShowChannels(clip c,float "MinPerc"=0.1, float "MaxPerc"=0.1, bool "ver"=false,bool "Setvar"=false,String "Prefix"="SC_", \
         bool "Show"=true,String ="AccFile"="",int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "Interlaced"=false)

  Where:-
    c is the clip

    MinPerc is percentage of pixels to ignore for loose minimum. (default 0.1%, ie 1/1000 of total pixels)
    ColorYUV (Analyze=true) Loose Minimum ignores 1/256 of the darkest pixels, and ShowChannels 0.1% or 1/1000 by default,
    so a Minperc of 0.4% would be about the same as ColorYUV uses.

    MaxPerc is percentage of pixels to ignore for loose maximum. (default 0.1%, ie 1/1000 of total pixels)
    ColorYUV (Analyze=true) Loose Maximum ignores 1/256 of the lightest pixels, and ShowChannels 0.1% or 1/1000 by default,
    so a Maxperc of 0.4% would be about the same as ColorYUV uses.

    ver display version info, false OFF [default] , true ON

    Setvar if true then sets Global Variables using Prefix string.

    Prefix (default "SC_"), prefix to Global variable names when using SetVar.

    Show, false switches off normal text display, you may want to set false if using SetVar.

    AccFile, default "", name of text file to output final Accumulated values for entire file.

    x,y,w,h, sets coordinates, all default to 0 as for crop, ie full image. NOT colorspace limited, eg can use odd values
      even for YV12 and YUY2.

    Interlaced (default false). Planar formats only, alters interpretation for the chroma, false=Progressive, true=interlaced.

    Default Global variable names when SetVar=true and using Default Prefix = "SC_"

      "SC_Visited"    = Frames visited

      Channel 0 (Y or R)
      "SC_Ave_0","SC_Min_0","SC_Max_0","SC_LMn_0","SC_LMx_0","SC_AAve_0","SC_AMin_0","SC_AMax_0","SC_ALMn_0","SC_ALMx_0",
      Channel 1 (U or G, NOT Y8)
      "SC_Ave_1","SC_Min_1","SC_Max_1","SC_LMn_1","SC_LMx_1","SC_AAve_1","SC_AMin_1","SC_AMax_1","SC_ALMn_1","SC_ALMx_1",
      Channel 2 (V or B, NOT Y8)
      "SC_Ave_2","SC_Min_2","SC_Max_2","SC_LMn_2","SC_LMx_2","SC_AAve_2","SC_AMin_2","SC_AMax_2","SC_ALMn_2","SC_ALMx_2",

      For Y8, channels 1 and 2 will all be set to -1
--------------------------------------------------------------------------------
Typical Global Variable settings for RGB something like:-

    SC_Ave_0=124.55    SC_Ave_1=126.06    SC_Ave_2=199.77
    SC_Min_0=0         SC_Min_1=0         SC_Min_2=0
    SC_Max_0=255       SC_Max_1=255       SC_Max_2=255
    SC_LMn_0=0         SC_LMn_1=0         SC_LMn_2=0
    SC_LMx_0=255       SC_LMx_1=255       SC_LMx_2=255
    SC_AAve_0=129.24   SC_AAve_1=132.12   SC_AAve_2=126.68
    SC_AMin_0=0        SC_AMin_1=0        SC_AMin_2=0
    SC_AMax_0=255      SC_AMax_1=255      SC_AMax_2=255
    SC_ALMn_0=0        SC_ALMn_1=0        SC_ALMn_2=0
    SC_ALMx_0=255      SC_ALMx_1=255      SC_ALMx_2=255
--------------------------------------------------------------------------------
Contents of AccFile for a small sample clip showing typical output using defaults:

SC_AAve_0=98.971779  SC_AMin_0=0  SC_AMax_0=255 SC_ALMn_0=14  SC_ALMx_0=241
SC_AAve_1=122.572746 SC_AMin_1=66 SC_AMax_1=200 SC_ALMn_1=99  SC_ALMx_1=160
SC_AAve_2=137.286911 SC_AMin_2=72 SC_AMax_2=209 SC_ALMn_2=108 SC_ALMx_2=175
SC_Visited=4000

--------------------------------------------------------------------------------

Lastly, you may find it better to crop off any borders when ascertaining frame/accumulated values, or set coordinates to suit.

ssS
Available from Mediafire via below sig:-

Zip includes 3 dll's, + source + full VS2008 project files for easy rebuild. (~128KB)

EDIT:
Code:
AviSource("D:\Parade.avi")
Showchannels(ver=True)
__________________
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; 16th January 2019 at 19:21. Reason: Update
StainlessS is offline   Reply With Quote
 

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 15:27.


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