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 8th January 2019, 22:01   #261  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by StainlessS View Post
RT_String is part of RT_Stats. (See meidafire in sig below this post)
Current GamMac has dll for avs/+ v2.60 x86 and x64. (loadPlugin or put in plugins dir)

EDIT: Also, GamMatch, is a different plugin to GamMac.
Thanks. That pulled it all together.

I'm not used to working in RGB. Everything I've done is in YUV. For YUV, I find that the filter "WhiteBalance" is exceptional. However, the image results with your analytical tool may be superior.

So, what filter(s) do you use to apply the results of your output?
Danette is offline   Reply With Quote
Old 9th January 2019, 04:46   #262  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
Some filters only make sense in RGB.
Quote:
So, what filter(s) do you use to apply the results of your output?
Have you tried ConvertToYV12 at end of script.
__________________
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 9th January 2019, 06:05   #263  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by StainlessS View Post
Some filters only make sense in RGB.

Have you tried ConvertToYV12 at end of script.
I agree, but have not done so as yet, so I'm not familiar with them. Which RGB filters have you found most useful for applying the results of your GamMac tool?

Ultimately, I do convert to YV12 for x264 purposes, but my understanding is that it is the least useful in dealing with colors..
Danette is offline   Reply With Quote
Old 10th January 2019, 11:12   #264  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
Quote:
Which RGB filters have you found most useful for applying the results of your GamMac tool?
Not sure that uderstand what you mean there, GamMac is the filter for applying GamMac results to an RGB clip.
ConvertToYV12 is used at end of script so as to use YV12 and better lossy compression for encode.
__________________
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 10th January 2019, 21:31   #265  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by StainlessS View Post
Not sure that uderstand what you mean there, GamMac is the filter for applying GamMac results to an RGB clip.
ConvertToYV12 is used at end of script so as to use YV12 and better lossy compression for encode.
The issue may be that I'm simply not applying it correctly. I have the video source in the script and then I have the GamMac script below that with the final ConverttoYV12 at the end. When I run the avs cotaining this layout, in VirtualDub (for example), the only thing that appears are the many images of the particular image selected from the video stream. These are the same images that appear in AvsPmod with the values for each image.

I thought your script was designed to provide the values that would then be applied to a filter that would be used to process the video. Your note, above, seems to indicate that this script alone should be processing it but, as I indicated, there is no processing going on when applied.
Danette is offline   Reply With Quote
Old 10th January 2019, 23:02   #266  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
Ok, I understand, you have no idea about scripting,
after this line,
Code:
C=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
    \ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
    \ dc=DC,
    \ x=x,y=y,w=w,h=h,
    \ omin=omin,omax=omax,
    \ Show=Show,Verbosity=Verb,dither=DITHER)
add return C.ConvertToYV12
(Also set Show=false in config near begining of script.)

Mobile:
__________________
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 10th January 2019, 23:36   #267  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by StainlessS View Post
Ok, I understand, you have no idea about scripting,
after this line,
Code:
C=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
    \ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
    \ dc=DC,
    \ x=x,y=y,w=w,h=h,
    \ omin=omin,omax=omax,
    \ Show=Show,Verbosity=Verb,dither=DITHER)
add return C.ConvertToYV12
(Also set Show=false in config near begining of script.)

Mobile:
LOL!!! You're certainly right about my scripting abilities. I looked through your and Bernard's discussions and almost fell asleep!

Anyway, I tried your recommendations and still have only a single image that results from the script with no video processing ability..

I switched out True for False as you suggested and created the following at the end:

Quote:
C=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)

return C.ConvertToYV12()
The "C.ConvertToYV12()" replacing this script:

Quote:
COORDS=O.GamMac(dc=DC,x=x,y=y,w=w,h=h,Coords=True)
ODC=((SHOWCOORDS)?COORDS.Spline36Resize(width,Height):O) # Resize COORDS (Not necessarily the same sizse as source clip)
ODC_TEXT=(SHOWCOORDS)?"Detect Clip with Coords":"Original"
TOP=StackHorizontal(TSub(ODC,ODC_TEXT,true),TSub(A,A_TEXT))
BOT=StackHorizontal(TSub(B,B_TEXT),TSub(C,C_TEXT))
StackVertical(TOP,BOT)
return Last


# Stack Overhead Subtitle Text, with optional FrameNumber shown.
Function TSub(clip c,string Tit,Bool "ShowFrameNo"){
c.BlankClip(height=20)
(Default(ShowFrameNo,False))?ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))"""):Subtitle(Tit)
Return StackVertical(c).AudioDubEx(c)
}
If I understand you correctly.
Danette is offline   Reply With Quote
Old 11th January 2019, 00:18   #268  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
Quote:
only a single image that results from the script with no video processing ability
Again, I'm wondering what that means.

C is the result of GamMac filter, whatever you want to do, do it to C,
eg
Code:
C=Gammac(... etc)
C=C.FlipHorizontal # or whatever
return C.ConvertToYV12
You need to spend some time learning to script, or choose some other video processing app.

EDIT: In the MediaFire link in my sig below this post, in the DATA folder, there is a compressed help (*.chm file for v2.60)
which you can put on a hotkey (create a shortcut, Properties, and add a Shortcut key).
You can access each and every file via the HTML table of files (so you dont have to wander around in circles,
never knowing if you have read everything).
__________________
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; 11th January 2019 at 00:28.
StainlessS is offline   Reply With Quote
Old 11th January 2019, 00:56   #269  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by StainlessS View Post
Again, I'm wondering what that means.
I fed exactly what I posted into VirtualDub and the only output is a single frame, not the source video.

Quote:
Originally Posted by StainlessS View Post
You need to spend some time learning to script, or choose some other video processing app.
Not quite true, but true if I want to be able to use this code. Time is the most precious resource and mine is far more productive placed elsewhere, which is the choice I’ve made. I was looking for a canned application without having to delve into the minutiae. I have to remind my chemists all the time that it’s good to understand the detail, but making it valued by the many, requires converting that detail into the practical.

Quote:
Originally Posted by StainlessS View Post
EDIT: In the MediaFire link in my sig below this post, in the DATA folder, there is a compressed help (*.chm file for v2.60)
which you can put on a hotkey (create a shortcut, Properties, and add a Shortcut key).
You can access each and every file via the HTML table of files (so you dont have to wander around in circles,
never knowing if you have read everything).
Thanks for attempting to help, but it’s a little too much for my end result. I’ll stay with “WhiteBalance”, which may be only slightly inferior.
Danette is offline   Reply With Quote
Old 11th January 2019, 12:02   #270  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
Quote:
output is a single frame, not the source video.
Yeh well as the input to the script in zip is a single frame, then that is not so surprising, if you want to process a video then feed it a video.

modified a bit
Code:
Imagesource(".\GreenChurch.png",end=0)        # SINGLE FRAME (end=0)
#Imagesource(".\Puppy.png",end=0)
#Imagesource(".\lennaRed.png",end=0)
#Avisource(".\SomeVideo.avi")                 # Video Clip

ConvertToRGB24.KillAudio
DC=Last

DC=DC.Blur(0.2)          # Detection Clip (uses source clip if dc not supplied, Denoised or whatever)

LockChan = 1            # Chan for lock to Ave, 0=R, 1=G, 2=B
                        #    -1 = Use LockVal below.
                        #    -2 = LockVal=(RedAve+GrnAve+BluAve)/3.0 for LockVal.
                        #    -3 = LockVal=Median(RedAve,GrnAve,BluAve)
Th        = 0.0
LockVal   = 128.0       # Only valid if LockChan == -1
Show      = True        # Metrics
Verb      = 5           # Verbocity FULL
DITHER=FALSE
x =0                    # Coords (for dc Detection Clip)
y =0
w=-0
h=-0

omin=0                  # Output channels minimum (footroom for manual editing).
omax=255                # Output channels maximum (headroom for manual editing).

#Return GamMac(DC,x=x,y=y,w=w,h=h,Coords=True)    # Show Coords only

Scale=2
RedMul=1.0
GrnMul=1.0
BluMul=0.95
C=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
    \ Th=Th,LockVal=LockVal,
    \ dc=DC,
    \ x=x,y=y,w=w,h=h,
    \ omin=omin,omax=omax,
    \ Show=Show,Verbosity=Verb,dither=DITHER)

#C=C.FlipHorizontal # or whatever

return C.ConvertToYV12
__________________
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; 11th January 2019 at 12:06.
StainlessS is offline   Reply With Quote
Old 12th January 2019, 00:33   #271  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by StainlessS View Post
Yeh well as the input to the script in zip is a single frame, then that is not so surprising, if you want to process a video then feed it a video.
Thanks, @StainlessS. It was, as you said in a previous post, a lack of in-depth understanding of the script functioning. I had both the AVIsource and Imagesource listed, thinking the script needed to reference the image to identify the needed changes. I removed the imagesource and it works fine.

Unfortunately, GamMac doesn't do nearly as good a job as the WhiteBalance filter ...in my case. I will keep it in mind, though, as it does provide much better balance than the original source and may be better than the WhiteBalance filter in other video that I will be restoring.
Danette is offline   Reply With Quote
Old 12th January 2019, 10:29   #272  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
EDIT:
This lot are all intended to be user configured,
Code:
LockChan = 1            # Chan for lock to Ave, 0=R, 1=G, 2=B
                        #    -1 = Use LockVal below.
                        #    -2 = LockVal=(RedAve+GrnAve+BluAve)/3.0 for LockVal.
                        #    -3 = LockVal=Median(RedAve,GrnAve,BluAve)
Th        = 0.0
LockVal   = 128.0       # Only valid if LockChan == -1
Show      = True        # Metrics
Verb      = 5           # Verbocity FULL
DITHER=FALSE
x =0                    # Coords (for dc Detection Clip)
y =0
w=-0
h=-0

omin=0                  # Output channels minimum (footroom for manual editing).
omax=255                # Output channels maximum (headroom for manual editing).

#Return GamMac(DC,x=x,y=y,w=w,h=h,Coords=True)    # Show Coords only

Scale=2
RedMul=1.0
GrnMul=1.0
BluMul=0.95
Scale=2, is a very ferocious setting,
you could also try eg Scale=1 (or Scale=0), and recommend change BluMul=1.0 (0.95 was specific to the Church image result which is too blue).

EDIT: You could also try Bernardd's automatic White Balance script:- https://forum.doom9.org/showthread.p...82#post1861382
__________________
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; 12th January 2019 at 15:17.
StainlessS is offline   Reply With Quote
Old 13th January 2019, 00:21   #273  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by StainlessS View Post
EDIT:
This lot are all intended to be user configured,

Scale=2, is a very ferocious setting,
you could also try eg Scale=1 (or Scale=0), and recommend change BluMul=1.0 (0.95 was specific to the Church image result which is too blue).

EDIT: You could also try Bernardd's automatic White Balance script:- https://forum.doom9.org/showthread.p...82#post1861382
Thanks for pointing those variables out. I played with them a little today, but saw no changes between scale=0 or scale=2 (and more). Same thing with the BluMul. Also took a look at Bernard’s white balance. since it's in avs form, I'll give it a try.

I think I’m settled on WhiteBalance. I find that setting the black RGB values initially to 0 and adjusting only the white RGB settings, I can get into the right ballpark. Then, using Histogram(levels) and adjusting the black R&B values to center the graphs, I can easily get what I find to be excellent color balance that I just can’t beat with any number of tweakings in many different color adjusters, such as GamMac, ColorYUV, AWB, Tweak, HDRAGC as well as several Vdub filters.
Danette is offline   Reply With Quote
Old 13th January 2019, 16:25   #274  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 831
Quote:
Originally Posted by Danette View Post
I played with them a little today, but saw no changes between scale=0 or scale=2 (and more). Same thing with the BluMul....
If you cant see any differences between scales 0 -> 2
and/or BluMul you must be blind or your gammac script simply does not work...
Please post you entire script.
Because for me even subtile changes from the defaults are altering the output sometimes in dramatical ways.
Taurus is offline   Reply With Quote
Old 14th January 2019, 00:21   #275  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by Taurus View Post
If you cant see any differences between scales 0 -> 2
and/or BluMul you must be blind or your gammac script simply does not work...
Please post you entire script.
Because for me even subtile changes from the defaults are altering the output sometimes in dramatical ways.
Below is the script. When I change the BluMul, I can see the 1st quadrant change. However, the 4th quadrant does not. Nor does any quadrant change when I change the scale to 0, 1 or 2.

Quote:
AVISource("C:\Users\Main\Desktop\Videos\Home Movies\1995-05-14 To 1996-01.avi")
Trim(209006,226575).FadeIn(60) + Trim(226679,237540).FadeOut2(60)

ConvertToRGB24.KillAudio
#Spline36Resize(512,384)
O=Last
DC=Last

#DC=DC.Blur(1.0) # Detection Clip (uses source clip if dc not supplied, Denoised or whatever)
#DC=DC.BilinearResize(320,240) # Test DC not same size as source

LockChan = 1 # Chan for lock to Ave, 0=R, 1=G, 2=B
# -1 = Use LockVal below.
# -2 = LockVal=(RedAve+GrnAve+BluAve)/3.0 for LockVal.
# -3 = LockVal=Median(RedAve,GrnAve,BluAve)
Scale=1
RedMul = 1.0 # Required Ave multiplier for Red Channel, applied when requesting GuessGamma(reqAve*RedMul), Even applied when LockChan=-1.
GrnMul = 1.0 # Same for Green channel. GrnMul even applies when LockChan is Green Channel, etc for chans.
BluMul = 1.0 # Same for Blue channel. Allows tinkering/fine tuning.
Th = 0.0
LockVal = 128.0 # Only valid if LockChan == -1
RngLim = 11
GamMax = 10.0
Show = True # Metrics
Verb = 5 # Verbocity FULL
SHOWCOORDS= True # Show Original with Coords
DITHER=FALSE
x =5 # Coords (for dc Detection Clip)
y =5
w=-5
h=-5

omin=5 # Output channels minimum (footroom for manual editing).
omax=250 # Output channels maximum (headroom for manual editing).

#Return GamMac(DC,x=x,y=y,w=w,h=h,Coords=True) # Show Coords only

Scale=0
A_TEXT = RT_String("Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul,GrnMul,BluMul)
A=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)


Scale=1 BluMul=1.05
B_TEXT = RT_String("Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul,GrnMul,BluMul)
B=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)

Scale=2 BluMul=0.95
C_TEXT = RT_String("Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul,GrnMul,BluMul)
C=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)

COORDS=O.GamMac(dc=DC,x=x,y=y,w=w,h=h,Coords=True)
ODC=((SHOWCOORDS)?COORDS.Spline36Resize(width,Height):O) # Resize COORDS (Not necessarily the same sizse as source clip)
ODC_TEXT=(SHOWCOORDS)?"Detect Clip with Coords":"Original"
TOP=StackHorizontal(TSub(ODC,ODC_TEXT,true),TSub(A,A_TEXT))
BOT=StackHorizontal(TSub(B,B_TEXT),TSub(C,C_TEXT))
StackVertical(TOP,BOT)
return Last


# Stack Overhead Subtitle Text, with optional FrameNumber shown.
Function TSub(clip c,string Tit,Bool "ShowFrameNo"){
c.BlankClip(height=20)
(Default(ShowFrameNo,False))?ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))"""):Subtitle(Tit)
Return StackVertical(c).AudioDubEx(c)
}

Last edited by Danette; 14th January 2019 at 00:32.
Danette is offline   Reply With Quote
Old 14th January 2019, 13:42   #276  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
Couple of comment suggestions,

Code:
DC=DC.Blur(0.2) # Denoise Detection Clip [ avoid 'sparkles', prevent a few high/low extreme pixels from affecting histogram extremes too much ]
Code:
x =0 # Coords (for dc Detection Clip) [ if you have no need to avoid crud/noise around edges of DC clip ]
y =0
w=-0
h=-0

Code:
     
omin=0   # Output channels minimum (footroom for manual editing). [ If no need for extra user modification 'footroom/headroom', ie no further manual tweaking required ]
omax=255 # Output channels maximum (headroom for manual editing).
__________________
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; 14th January 2019 at 13:46.
StainlessS is offline   Reply With Quote
Reply

Tags
color cast, correction, fade, gamma

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 08:49.


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