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 27th January 2019, 14:22   #41  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
WaveForm_FilmStrip Update, added W, H args, Width, Height of FilmStrip thumbnail images.
Hope this is Final version.

Code:
#AviSource("D:\G.avi")
Colorbars.Trim(0,-100)

WINDOW    = 1           # Frames Wide = 2 * WINDOW + 1
HEIGHT    = 1.0         # Audio graphs height, 0.333 = 1/3 of result filmstrip image height.
UNDER     = True        # True, then audio graphs stacked under video, else overlay over video.
ZOOM      = 1.0         # Amplify audio signal for viewing (1.0=No Amp).
SUBSIZE   = 0.5         # Suggest 0.0(off) to about 0.5. (0.0 <= SubSize <= 1.0) : 0.0 = No Frame Number,  1.0=biggest size for current clip Height (probably too big).
SHOWAUDIO = True        # Default True. If False, Switches OFF WaveForm Display, Shows FilmStrip Only.
W         = -1          # Default -1, (or 0 or +ve). -1 = Normal Downscale behaviour, filmstrip width ~= input clip width.
H         = Undefined   # Undefined, Let W govern height of thumbnail images (or just dont use h=H in function call, same as h=Undefined).

###### Can Remove this lot ######
TONE      = False       # Replace Colorbars tone with selected TONETYPE tone
TONETYPE  ="NOISE"      # Pick from:- "Silence", "Sine", "Noise", "Square", "Triangle" or "Sawtooth"
TONECHANS = 5           # Tone Channels Count (test channels display)
#
(TONE)    ? AudioDub(Tone(Length=FrameCount/FrameRate,Type=TONETYPE,Channels=TONECHANS))  : Last
###### End Of Can Remove   ######

Return WaveForm_FilmStrip(window=WINDOW,Height=HEIGHT,under=UNDER,zoom=ZOOM,subSize=SUBSIZE,ShowAudio=SHOWAUDIO,w=W,h=H)

Function WaveForm_FilmStrip(clip c,int "Window",Float "Height",Bool "Under",Float "Zoom",Bool "Marks",Float "SubSize",Bool "ShowAudio",Int "W",Int "H") {
/*  Waveform_FilmStrip:- by StainlessS @ Doom9 ::: https://forum.doom9.org/showthread.php?p=1863963#post1863963
        Where ShowAudio=True, Requires WaveForm plugin (c) Wonkey_Monkey, https://forum.doom9.org/showthread.php?t=165703
           [Wonkey_Monkey, The Prince formerly known as David.]

    WaveForm_FilmStrip(clip c,int "Window"=0,Float "Height"=0.333,Bool "Under"=True,Float "Zoom"=1.0,Bool "Marks"=True,Float "SubSize"=0.0,Bool "ShowAudio"=True,Int "W"=-1,Int "H"=W_Based)

        Window,       Default 1 (0 <= Window <=3), Filmstrip thumbnail Images across = 2 * Window + 1.
        Height,       Default 0.333=1/3 of FilmStrip Height. See Waveform docs for more.
        Under,        Default True, If True, then audio graph stacked under video, else overlay over video.
        Zoom,         Default 1.0. Amplify audio signal for viewing (1.0=No Amp).
        SubSize,      Default 0.0(0.0 <= SubSize <= 1.0). Suggest 0.0(No Frame Number) to about 0.5. : 1.0=biggest size for current clip Height (probably too big).
        ShowAudio,    Default True. If False, Switches OFF WaveForm Display, Shows FilmStrip Only.
        W,            Default -1. Governs width of thumbnail images making up the FilmStrip.
                         -ve) Entire FilmStrip width (multiple thumbnail images based on Window arg) will be about same as input clip width.
                           0) Each FilmStrip thumbnail image is SAME size as input clip, result could be a quite wide clip.
                        Else) Each FilmStrip thumbnail image Width is set by W (best Mod 2).
        H,            Default based off W. (Suggest Dont supply H arg, let it default based on W arg. Can call with H=Undefined where will behave as if defaulting).
                        IF H is Supplied ie not defaulted THEN     H = Supplied H    # could be -ve, 0, or +ve(explicit height).
                        else                                       if W <= 0, then H = W, ELSE H = input clip height Aspect Ratio Scaled to match W.
                        Here, H could be -ve, 0, or +ve, defaulted or non defaulted.
                        Where H,
                         -ve) FilmStrip height scaled down to Aspect Ratio match FilmStrip width of individual thumbnail images.
                           0) Each FilmStrip thumbnail image Height is SAME size as input clip height.
                        Else) Each FilmStrip thumbnail image Height is set by H (best Mod 2).
*/
    Window=Default(Window,0)  Height=Max(Default(Height,0.333),0.0)  Under=Default(Under,True)  SubSize=Default(SubSize,0.0)  ShowAudio=Default(ShowAudio,True)
    W=Default(W,-1)  H=Default(H,W<=0?W:Round(W.Float/c.Width*c.Height+1)/2*2)
    Assert(0 <= window <= 3,"WaveForm_FilmStrip: 0 <= window <= 3")
    Assert(0.0 <= SubSize <= 1.0,"WaveForm_FilmStrip: 0.0 <= SubSize <= 1.0")
    Frms    = 1 + (2*Window)      WW=(W<0)?(c.Width+Frms)/(Frms*2)*2:(W==0)?c.width:W        HH=(H<0)?(c.Height+Frms)/(Frms*2)*2:(H==0)?c.Height:H
    sc=(WW!=c.Width||HH!=c.Height) ?c.BiCubicResize(WW,HH,b=-0.5,c=0.25) :c    scSubsSz=Round(sc.Height*SubSize)
    SSS="""Subtitle(String(current_frame,"%.0f")""" + String(scSubsSz,",SIZE=%.0f") + String((sc.Height-scSubsSz)/2.0,",Y=%.0f") + """,align=8)"""
    sc=(scSubsSz!=0)?sc.ScriptClip(SSS):sc          bc=sc.BlankClip(Length=1,Color=$000000)
    p1c=bc+sc               p2c=bc+p1c              p3c=bc+p2c
    n1c=sc.FrameCount>1?sc.Trim(1,0)+bc:bc          n2c=n1c.FrameCount>1?n1c.Trim(1,0)+bc:bc        n3c=n2c.FrameCount>1?n2c.Trim(1,0)+bc:bc
    Select(Window,sc,StackHorizontal(p1c,sc,n1c),StackHorizontal(p2c,p1c,sc,n1c,n2c),StackHorizontal(p3c,p2c,p1c,sc,n1c,n2c,n3c))
        \ .AudioDubEx(c).Trim(0,-c.FrameCount).DelayAudio(0.0)
    return (ShowAudio && HasAudio) ? WaveForm(window=Window,height=Height,under=Under,zoom=Zoom,marks=Marks) : Last
}
__________________
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; 28th January 2019 at 12:53.
StainlessS is offline   Reply With Quote
Old 12th June 2019, 16:41   #42  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Small mod in blue, round size DOWN rather than nearest, easier to addborders to filmstrip to match up with original clip width. -ve H also now round down rather than nearest.
Quote:
W, -ve) Entire FilmStrip width (multiple thumbnail images based on Window arg) will be about same [smaller or equal] as input clip width.
Code:
Function WaveForm_FilmStrip(clip c,int "Window",Float "Height",Bool "Under",Float "Zoom",Float "SubSize",Bool "ShowAudio",Int "W",Int "H") {
/*  Waveform_FilmStrip:- by StainlessS @ Doom9 ::: https://forum.doom9.org/showthread.php?p=1965005#post1965005
        Where ShowAudio=True, Requires WaveForm v2.0 plugin (c) Wonkey_Monkey, https://forum.doom9.org/showthread.php?t=182866
           [Wonkey_Monkey, The Prince formerly known as David.]

    WARNING - Marks arg no longer a setting in WaveForm v0.3 x64 or v2.0 - so removed from WaveForm_FilmStrip
    Also, Made Under default False as Suggested by Wonkey.

    WaveForm_FilmStrip(clip c,int "Window"=0,Float "Height"=0.333,Bool "Under"=FALSE,Float "Zoom"=1.0,Float "SubSize"=0.0,Bool "ShowAudio"=True,Int "W"=-1,Int "H"=W_Based)

        Window,       Default 1 (0 <= Window <=3), Filmstrip thumbnail Images across = 2 * Window + 1.
        Height,       Default 0.333=1/3 of FilmStrip Height. See Waveform docs for more.
        Under,        Default False, If True, then audio graph stacked under video, else overlay over video.
        Zoom,         Default 1.0. Amplify audio signal for viewing (1.0=No Amp).
        SubSize,      Default 0.0(0.0 <= SubSize <= 1.0). Suggest 0.0(No Frame Number) to about 0.5. : 1.0=biggest size for current clip Height (probably too big).
        ShowAudio,    Default True. If False, Switches OFF WaveForm Display, Shows FilmStrip Only.
        W,            Default -1. Governs width of thumbnail images making up the FilmStrip.
                         -ve) Entire FilmStrip width (multiple thumbnail images based on Window arg) will be about same [smaller or equal] as input clip width.
                           0) Each FilmStrip thumbnail image is SAME size as input clip, result could be a quite wide clip.
                        Else) Each FilmStrip thumbnail image Width is set by W (best Mod 2).
        H,            Default based off W. (Suggest Dont supply H arg, let it default based on W arg. Can call with H=Undefined where will behave as if defaulting).
                        IF H is Supplied ie not defaulted THEN     H = Supplied H    # could be -ve, 0, or +ve(explicit height).
                        else                                       if W <= 0, then H = W, ELSE H = input clip height Aspect Ratio Scaled to match W.
                        Here, H could be -ve, 0, or +ve, defaulted or non defaulted.
                        Where H,
                         -ve) FilmStrip height scaled down to Aspect Ratio match FilmStrip width of individual thumbnail images.
                           0) Each FilmStrip thumbnail image Height is SAME size as input clip height.
                        Else) Each FilmStrip thumbnail image Height is set by H (best Mod 2).
*/
    Window=Default(Window,0)  Height=Max(Default(Height,0.333),0.0)  Under=Default(Under,false)  SubSize=Default(SubSize,0.0)  ShowAudio=Default(ShowAudio,True)
    W=Default(W,-1)  H=Default(H,W<=0?W:Int(W.Float/c.Width*c.Height)/2*2)
    Assert(0 <= window <= 3,"WaveForm_FilmStrip: 0 <= window <= 3")
    Assert(0.0 <= SubSize <= 1.0,"WaveForm_FilmStrip: 0.0 <= SubSize <= 1.0")
    Frms    = 1 + (2*Window)      WW=(W<0)?c.Width/(Frms*2)*2:(W==0)?c.width:W        HH=(H<0)?c.Height/(Frms*2)*2:(H==0)?c.Height:H
    sc=(WW!=c.Width||HH!=c.Height) ?c.BiCubicResize(WW,HH,b=-0.5,c=0.25) :c           scSubsSz=Round(sc.Height*SubSize)
    SSS="""Subtitle(String(current_frame,"%.0f")""" + String(scSubsSz,",SIZE=%.0f") + String((sc.Height-scSubsSz)/2.0,",Y=%.0f") + """,align=8)"""
    sc=(scSubsSz!=0)?sc.ScriptClip(SSS):sc          bc=sc.BlankClip(Length=1,Color=$000000)
    p1c=bc+sc               p2c=bc+p1c              p3c=bc+p2c
    n1c=sc.FrameCount>1?sc.Trim(1,0)+bc:bc          n2c=n1c.FrameCount>1?n1c.Trim(1,0)+bc:bc        n3c=n2c.FrameCount>1?n2c.Trim(1,0)+bc:bc
    Select(Window,sc,StackHorizontal(p1c,sc,n1c),StackHorizontal(p2c,p1c,sc,n1c,n2c),StackHorizontal(p3c,p2c,p1c,sc,n1c,n2c,n3c))
        \ .AudioDubEx(c).Trim(0,-c.FrameCount).DelayAudio(0.0)
    return (ShowAudio && HasAudio) ? WaveForm(window=Window,height=Height,under=Under,zoom=Zoom) : Last
}
client
Code:
#AviSource("D:\G.avi")
Colorbars.Trim(0,-100)

WINDOW    = 3           # Frames Wide = 2 * WINDOW + 1
HEIGHT    = 0.33        # Audio graphs height, 0.333 = 1/3 of result filmstrip image height.
UNDER     = false       # True, then audio graphs stacked under video, else overlay over video.
ZOOM      = 1.0         # Amplify audio signal for viewing (1.0=No Amp).
SUBSIZE   = 0.5         # Suggest 0.0(off) to about 0.5. (0.0 <= SubSize <= 1.0) : 0.0 = No Frame Number,  1.0=biggest size for current clip Height (probably too big).
SHOWAUDIO = True        # Default True. If False, Switches OFF WaveForm Display, Shows FilmStrip Only.
W         = 264         # Default -1, (or 0 or +ve). -1 = Normal Downscale behaviour, filmstrip width ~= input clip width.
#H         = Undefined  # Undefined, Let W govern height of thumbnail images (or just dont use h=H in function call, same as h=Undefined).

###### Can Remove this lot ######
TONE      = False       # Replace Colorbars tone with selected TONETYPE tone
TONETYPE  ="NOISE"      # Pick from:- "Silence", "Sine", "Noise", "Square", "Triangle" or "Sawtooth"
TONECHANS = 5           # Tone Channels Count (test channels display)
#
(TONE)    ? AudioDub(Tone(Length=FrameCount/FrameRate,Type=TONETYPE,Channels=TONECHANS))  : Last
###### End Of Can Remove   ######
WaveForm_FilmStrip(window=WINDOW,Height=HEIGHT,under=UNDER,zoom=ZOOM,subSize=SUBSIZE,ShowAudio=SHOWAUDIO,w=W) #,h=H)
Return Last
Window=3 W=128 [individual thumb width = 128 : Full width (Window*2+1)*128 = 7*128=896 ]


Window=3 W=-1(total width smaller or equal original width[640], out width=630[each thumb width mod 2, ie (Window*2+1)*90 = 7*90=630])


EDIT: Removed Marks arg, Made Under default False as Wonkey suggestion.
__________________
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; 2nd March 2022 at 20:54.
StainlessS is offline   Reply With Quote
Old 5th August 2019, 17:08   #43  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Wonkey, can we have some kind of center/zero marking, ta. [EDIT: maybe dotted, eg every 4th pixel]
__________________
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; 5th August 2019 at 17:10.
StainlessS is offline   Reply With Quote
Old 5th August 2019, 17:32   #44  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
I'll bear it in mind for the next version. For now, you could create a second video with amplify(0) and overlay/layer it with the first, maybe with mode = "lighten" or some variation of that.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 5th August 2019, 17:49   #45  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
No great urgency W, takes your time.
Thank you for your consideration
__________________
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 11th November 2019, 11:06   #46  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Mod to dotted request, maybe eg every 4th pixels, with alternate black/white dots.
__________________
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 2nd January 2020, 08:55   #47  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
wonkey_monkey,

The link in the opening post is labelled waveform0.3.zip, but the file that downloads is waveform0.2.zip, which seems odd as the link location is http://horman.net/waveform0.3.zip

PS The link in post 20 downloads waveform0.3.zip which I assume is the correct one.
http://horman.net/avisynth/download/waveform0.3.zip

Cheers.

Last edited by hello_hello; 2nd January 2020 at 08:59.
hello_hello is offline   Reply With Quote
Old 2nd January 2020, 10:50   #48  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
That's my stupid web host trying to be helpful. Fixed.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 11th February 2020, 17:41   #49  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Wonkey, can you please delete links in these two posts [to old v0.2, 2nd link says 0.3 and even name on server says 0.3 but is 0.2]
Post #11, https://forum.doom9.org/showthread.p...25#post1589325 [EDIT: This link actually says v0.2, maybe you decide to keep it]
Post #30, https://forum.doom9.org/showthread.p...47#post1845947

EDIT: Hello_Hello post [2 ahead] has correct link, as does 1st post link, and so does your "My Avisynth Filters" link.
__________________
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 February 2020 at 18:01.
StainlessS is offline   Reply With Quote
Old 11th February 2020, 21:45   #50  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
StainlessS,
I appear to have overlooked your WaveForm_FilmStrip() function until now. Maybe I didn't understand it or didn't pay enough attention at the time, but I made a similar a while back, originally only displaying meters, as I didn't discover the WaveForm plugin until somewhat recently. Minus your filmstrip idea though, because I'm not smart enough to think of that.

It's probably the definition of pointless, but it amused me watching the kids play together.

AudioWaveL(FT=true, Zoom=5.0)
WaveForm_FilmStrip(Window=1, Zoom=5.0)



AudioMeterR(FT=true)
WaveForm_FilmStrip(Window=1, Zoom=5.0)


Last edited by hello_hello; 26th February 2020 at 11:16.
hello_hello is offline   Reply With Quote
Old 11th February 2020, 22:03   #51  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Looks good HH.
WaveForm_FilmStrip() handy for sync audio to loud noise, gunshot or whatever [with multi-windows].

I considered recently (today I think, when seeing you post something in another thead) adding timestamp, instead_of / as_well_as frame number, maybe ShowSMPTE() or ShowTime().
__________________
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 February 2020 at 22:11.
StainlessS is offline   Reply With Quote
Old 21st January 2021, 10:29   #52  |  Link
Roemer
Registered User
 
Join Date: Oct 2020
Posts: 20
Today I tried the waveform and found out that it causes severe audio crackling when the Tempo of the audio is increased.
My test file is pretty simple:
Code:
LoadPlugin("C:\Programme (Portable)\AviSynth Addons\Plugins\ffms2-2.40-msvc\x64\ffms2.dll")
LoadPlugin("C:\Programme (Portable)\AviSynth Addons\Plugins\waveform0.3\x64\waveform.dll")

FFmpegSource2(source="SomeFile.avi", atrack=-1).TimeStretch(tempo=120)
waveform()
If I play that with ffplay, the audio is crackling. If I just remove the waveform, the audio plays fine. What could be the cause of that? Can this be fixed?
Thanks for your help.
Roemer is offline   Reply With Quote
Old 21st January 2021, 12:13   #53  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
waveform doesn't alter the audio. Either it's just too slow for ffplay to keep up, or there's some kind of audio seeking issue - waveform will cause audio access to be non-linear, because it will be seeking ahead while audio playback will be requesting the current frame's audio. You could try adding preroll(0,1) (or a higher value for the second parameter, depending how wide the waveform is) before waveform.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 21st January 2021, 22:05   #54  |  Link
Roemer
Registered User
 
Join Date: Oct 2020
Posts: 20
I tried with Preroll(0,x) with x=0,1,2,5,10,100. No difference. The file is directly playing from SSD and the CPU is pretty much totally idle.
Edit: I found out that the audio file I had was broken. I reencoded it to aac and now everything works!

Last edited by Roemer; 22nd January 2021 at 23:47.
Roemer is offline   Reply With Quote
Old 2nd March 2022, 20:16   #55  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Updated post #42, WaveForm_Filmstrip(Bool Under="False") # As Wonkey suggestion,
also removed marks arg as no longer supported in v0.3 x64 or Waveform v2.0.
__________________
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 14th March 2023, 21:45   #56  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
I am trying to cobble an allscope script together, like VideoTek()
which tiles multiple scopes around the source frame plus overlays on top
but waveform() behaves different as I would expect.

The line StackVertical(topbar,unprop)
makes waveform() see a silent 2-track audio.
So waveform() does not want to see last audio from last StackVertical,
but giving that clip a named variable and hand that to waveform() won't work either.

If I give an explicit clip to waveform (unprop) waveform respects it.
But then the last StackVertical() does nothing anymore, as if waveform would contain an implicit return()

(AviSynth+64 3.7.3 test 7 under Win10Pro64, waveform 2.0.2)

Code:
function allscopes (clip clp)
{
src=clp.ConvertToYV24()
levcolsize=256
stereosize=512
level=src.Histogram(mode="levels", keepsource=false)
color=src.Histogram(mode="color2", keepsource=false)#.ColorYUV(cont_Y=1000,cont_U=1000,cont_V=1000)
histoy=src.Histogram(mode="classic", keepsource=false).ColorYUV(gamma_Y=200)
histox=src.turnleft.Histogram(mode="classic", keepsource=false).ColorYUV(gamma_Y=200).turnleft()
bargraph=src.Histogram(mode="audiolevels", keepsource=false) #overlay only,  starts from left border and uses full height
stereo=Histogram(src,mode="stereoY8", keepsource=false).ColorYUV(gamma_Y=200).ConvertToYV24()#512 x 512, Y8 or YV12 only
luma=src.Histogram(mode="luma", keepsource=false)
padup=src.height-(2*levcolsize)
stackR=StackVertical(color, level)
stackR=padup>0 ? StackVertical(stackR,BlankClip(level,height=padup)) : stackR
stackC=StackHorizontal(src,histoy)
stackC=padup<0 ? StackVertical(stackC,BlankClip(src,width=src.width+levcolsize,height=-padup)) : stackC
stackA=stereo
stackA=padup>0 ? StackVertical(stackA,BlankClip(stackA,width=stereosize,height=padup)) : stackA
allstack=StackHorizontal(stackA,stackC,stackR)
unprop=StackHorizontal(stackA,stackC,stackR).Histogram(mode="audiolevels")
#unprop=AudioDub(unprop,allstack) #overlay only,  starts from left border and uses full height
topbarwidth=unprop.width
topbarheight=24
topbartextshift=levcolsize
topbar=src.BlankClip(width=topbarwidth,height=topbarheight).ShowFrameNumber(scroll=false, size=18, x=topbartextshift+16, y=16)\
.Subtitle("/"+String(src.framecount),align=4,x=topbartextshift+62,y=16).Subtitle("f",align=4,x=topbartextshift+110,y=16)\
.Subtitle("TC",align=4,x=topbartextshift+130,y=16).ShowSMPTE(size=18, x=topbartextshift+198)\
.ShowTime(size=18, x=topbartextshift+300).Subtitle("ms",align=4,x=topbartextshift+350,y=16)\
.Subtitle(String(clp.width)+"x"+String(clp.height)+"@"+String(clp.framerate)+"fps"+"  " +String(clp.pixeltype)\
+"  "+String(clp.bitspercomponent)+"bpc"+"  |  "+String(clp.audiochannels)+"-CH "+"@"+String(clp.audiorate)+"Hz"\
+"  "+String(clp.audiobits)+"bit"+" " +String(clp.IsAudioFloat ? "float" : "int"),size=18, align=4, x=topbartextshift+384, y=16)
StackVertical(topbar,unprop)
waveform(height=0.25, window=2)
return(last)
}
Am I overlooking something ?
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 14th March 2023 at 23:07.
Emulgator is offline   Reply With Quote
Old 14th March 2023, 23:22   #57  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
StackVertical returns audio from the first clip, which is the BlankClip, so it's silent. Try

Code:
StackVertical(topbar,unprop)
AudioDub(unprop)
Waveform(height=0.25, window=2)
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 15th March 2023, 02:19   #58  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
Yees ! Many thanks, David.
So simple: I shall not assume that my preferred audio is kept, I just have to specify.

Code:
function allscopes (clip clp)
{
src=clp.ConvertToYV24()
isSMPTE= \
round(framerate(clp))*1000==23976 || round(framerate(clp))*1000==24000 || round(framerate(clp))*1000 == 25000 || round(framerate(clp)) ==29970 || round(framerate(clp)) ==30000 \
round(framerate(clp))*1000==47952 || round(framerate(clp))*1000==48000 || round(framerate(clp))*1000 == 50000 || round(framerate(clp)) ==59940 || round(framerate(clp)) ==60000 ? true : false 
levcolsize=256
stereosize=512
level=src.Histogram(mode="levels", keepsource=false)
color=src.Histogram(mode="color2", keepsource=false)#.ColorYUV(cont_Y=1000,cont_U=1000,cont_V=1000)
histoy=src.Histogram(mode="classic", keepsource=false).ColorYUV(gamma_Y=200)
histox=src.turnleft.Histogram(mode="classic", keepsource=false).ColorYUV(gamma_Y=200).turnleft()
bargraph=src.Histogram(mode="audiolevels", keepsource=false) #overlay only,  starts from left border and uses full height
stereo=Histogram(src,mode="stereoY8", keepsource=false).ColorYUV(gamma_Y=200).ConvertToYV24()#512 x 512, Y8 or YV12 only
luma=src.Histogram(mode="luma", keepsource=false)
padup=src.height-(2*levcolsize)
stackR=StackVertical(color, level)
stackR=padup>0 ? StackVertical(stackR,BlankClip(level,height=padup)) : stackR
stackC=StackHorizontal(src,histoy)
stackC=padup<0 ? StackVertical(stackC,BlankClip(src,width=src.width+levcolsize,height=-padup)) : stackC
stackA=stereo
stackA=padup>0 ? StackVertical(stackA,BlankClip(stackA,width=stereosize,height=padup)) : stackA
allstack=StackHorizontal(stackA,stackC,stackR)
unprop=StackHorizontal(stackA,stackC,stackR).Histogram(mode="audiolevels")
#unprop=AudioDub(unprop,allstack) #overlay only,  starts from left border and uses full height
topbarwidth=unprop.width
topbarheight=24
topbartextshift=levcolsize
isSMPTE==true ? Eval("""
topbar=src.BlankClip(width=topbarwidth,height=topbarheight).ShowFrameNumber(scroll=false, size=18, x=topbartextshift+16, y=16)\
.Subtitle("/"+String(src.framecount),align=4,x=topbartextshift+62,y=16).Subtitle("f",align=4,x=topbartextshift+0,y=16)\
.ShowTime(size=18, x=topbartextshift+172).Subtitle("ms",align=4,x=topbartextshift+222,y=16)\
.Subtitle("TC",align=4,x=topbartextshift+258,y=16)\
.ShowSMPTE(size=18, x=topbartextshift+328, y=16)\
.Subtitle(String(clp.width)+"x"+String(clp.height)+"@"+String(clp.framerate)+"fps"+"  " +String(clp.pixeltype)\
+"  "+String(clp.bitspercomponent)+"bpc"+"  |  "+String(clp.audiochannels)+"-CH "+"@"+String(clp.audiorate)+"Hz"\
+"  "+String(clp.audiobits)+"bit"+" " +String(clp.IsAudioFloat ? "float" : "int"),size=18, align=4, x=topbartextshift+384, y=16,text_color=$00FF00) """) \
: Eval("""
topbar=src.BlankClip(width=topbarwidth,height=topbarheight).ShowFrameNumber(scroll=false, size=18, x=topbartextshift+16, y=16)\
.Subtitle("/"+String(src.framecount),align=4,x=topbartextshift+62,y=16).Subtitle("f",align=4,x=topbartextshift+0,y=16)\
.ShowTime(size=18, x=topbartextshift+172).Subtitle("ms",align=4,x=topbartextshift+222,y=16)\
.Subtitle("(no SMPTE-TC)",align=4,x=topbartextshift+258,y=16,text_color=$EE8800)\
.Subtitle(String(clp.width)+"x"+String(clp.height)+"@"+String(clp.framerate)+"fps"+"  " +String(clp.pixeltype)\
+"  "+String(clp.bitspercomponent)+"bpc"+"  |  "+String(clp.audiochannels)+"-CH "+"@"+String(clp.audiorate)+"Hz"\
+"  "+String(clp.audiobits)+"bit"+" " +String(clp.IsAudioFloat ? "float" : "int"),size=18, align=4, x=topbartextshift+384, y=16,text_color=$00FF00) """)
StackVertical(topbar,unprop)
AudioDub(unprop)
waveform(height=0.25, window=2)
return(last)
}
So far for today.
Thinking about narrower audio bargraphs now, 2 of them already eating too much screen.
There are so many nice and tiny bargraphs in other apps, lets see.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 15th March 2023 at 02:26.
Emulgator is offline   Reply With Quote
Old 15th March 2023, 09:04   #59  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
With autoscaling topbar and bits>=8
color2 is not HBD ready yet (graph too wide), well, levels looks wrong too in HBD, graph too narrow.
histox is for later, lets see where I put it.
Code:
function allscopes (clip clp)
{
src=clp.ConvertToYUV444()
bpc=clp.bitspercomponent()
fontsize= 6+ceil(width(clp)/480.0)*6
isSMPTE= \
round(framerate(clp))*1000==23976 || round(framerate(clp))*1000==24000 || round(framerate(clp))*1000 == 25000 || round(framerate(clp))*1000 ==29970 || round(framerate(clp))*1000 ==30000 \
round(framerate(clp))*1000==47952 || round(framerate(clp))*1000==48000 || round(framerate(clp))*1000 == 50000 || round(framerate(clp))*1000 ==59940 || round(framerate(clp))*1000 ==60000 ? true : false 
levcolsize=256
stereosize=512
level=src.Histogram(mode="levels", keepsource=false)
color=src.Histogram(mode="color2", keepsource=false)#.ColorYUV(cont_Y=1000,cont_U=1000,cont_V=1000)
histoy=src.Histogram(mode="classic", keepsource=false).ColorYUV(gamma_Y=200)
histox=src.turnleft.Histogram(mode="classic", keepsource=false).ColorYUV(gamma_Y=200).turnleft()
bargraph=src.ConvertBits(8).ConvertToYV24().Histogram(mode="audiolevels", keepsource=false).ConvertBits(bpc) #overlay only,  starts from left border and uses full height
stereo=src.ConvertBits(8).Histogram(mode="stereoY8", keepsource=false).ColorYUV(gamma_Y=200).ConvertToYV24().ConvertBits(bpc)#512 x 512, Y8 or YV12 only
luma=src.Histogram(mode="luma", keepsource=false)
padup=src.height-(2*levcolsize)
stackR=StackVertical(color, level)
stackR=padup>0 ? StackVertical(stackR,BlankClip(level,height=padup)) : stackR
stackC=StackHorizontal(src,histoy)
stackC=padup<0 ? StackVertical(stackC,BlankClip(src,width=src.width+levcolsize,height=-padup)) : stackC
stackA=stereo
stackA=padup>0 ? StackVertical(stackA,BlankClip(stackA,width=stereosize,height=padup)) : stackA
allstack=StackHorizontal(stackA,stackC,stackR)
unprop=StackHorizontal(stackA,stackC,stackR).ConvertBits(8).Histogram(mode="audiolevels").ConvertBits(bpc)
topbarwidth=unprop.width
topbarheight=fontsize*4/3
topbartextshift=levcolsize
isSMPTE==true ? Eval("""
topbar=src.BlankClip(width=topbarwidth,height=topbarheight).ShowFrameNumber(scroll=false, size=fontsize, x=topbartextshift+fontsize, y=topbarheight*2/3)\
.Subtitle("/"+String(src.framecount),size=fontsize, align=4,x=topbartextshift+(fontsize*4),y=topbarheight*2/3).Subtitle("f",size=fontsize, align=4,x=topbartextshift+0,y=topbarheight*2/3)\
.ShowTime(size=fontsize, x=topbartextshift+(fontsize*41/4), y=topbarheight*2/3).Subtitle("ms",size=fontsize, align=4,x=topbartextshift+(fontsize*13),y=topbarheight*2/3)\
.Subtitle("TC",align=4,x=topbartextshift+(fontsize*15), y=topbarheight*2/3)\
.ShowSMPTE(size=fontsize, x=topbartextshift+(fontsize*19), y=topbarheight*2/3)\
.Subtitle(String(clp.width)+"x"+String(clp.height)+"@"+String(clp.framerate)+"fps"+"  " +String(clp.pixeltype)\
+"  "+String(clp.bitspercomponent)+"bpc"+"  |  "+String(clp.audiochannels)+"-CH "+"@"+String(clp.audiorate)+"Hz"\
+"  "+String(clp.audiobits)+"bit"+" " +String(clp.IsAudioFloat ? "float" : "int"),size=fontsize, align=4, x=topbartextshift+(fontsize*22), y=topbarheight*2/3,text_color=$00FF00) """) \
: Eval("""
topbar=src.BlankClip(width=topbarwidth,height=topbarheight).ShowFrameNumber(scroll=false, size=fontsize, x=topbartextshift+fontsize, y=topbarheight*2/3)\
.Subtitle("/"+String(src.framecount),size=fontsize, align=4,x=topbartextshift+(fontsize*4),y=topbarheight*2/3).Subtitle("f",size=fontsize, align=4,x=topbartextshift+0,y=topbarheight*2/3)\
.ShowTime(size=fontsize, x=topbartextshift+(fontsize*41/4), y=topbarheight*2/3).Subtitle("ms",size=fontsize, align=4,x=topbartextshift+(fontsize*13),y=topbarheight*2/3)\
.Subtitle("(no SMPTE-TC)",size=fontsize, align=4,x=topbartextshift+(fontsize*15), y=topbarheight*2/3,text_color=$EE8800)\
.Subtitle(String(clp.width)+"x"+String(clp.height)+"@"+String(clp.framerate)+"fps"+"  " +String(clp.pixeltype)\
+"  "+String(clp.bitspercomponent)+"bpc"+"  |  "+String(clp.audiochannels)+"-CH "+"@"+String(clp.audiorate)+"Hz"\
+"  "+String(clp.audiobits)+"bit"+" " +String(clp.IsAudioFloat ? "float" : "int"),size=fontsize, align=4, x=topbartextshift+(fontsize*22), y=topbarheight*2/3,text_color=$00FF00)  """)
StackVertical(topbar,unprop)
AudioDub(unprop)
waveform(height=0.25, window=2)
return(last)
}
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 15th March 2023 at 09:39.
Emulgator is offline   Reply With Quote
Reply

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 23:11.


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