Log in

View Full Version : VideoTek (Avisynth and MPV Waveform Monitor)


FranceBB
3rd February 2018, 16:32
Hi,
I love the Tektronix Videoscope I have at work, but I can't use it at home, that's why I tried to reproduce a similar output using Avisynth built-in videoscope (Histogram).
Please welcome VideoTek, a Tektronix-like waveform monitor for Avisynth and MPV.

VideoTek() (Avisynth Version) (https://github.com/FranceBB/VideoTek) - VideoTek (MPV Version) (https://github.com/FranceBB/mpv-scripts)

https://camo.githubusercontent.com/2a10c4ff771352a315bec8424fea3cb10c2a3967/68747470733a2f2f7332302e706f7374696d672e63632f336c35666f6f736a312f566964656f5f54656b2e6a7067 (https://github.com/FranceBB/VideoTek)

picture (top left), luma (top right)
chroma (bottom left), audio channels and Lissajou (bottom right)


Avisynth Usage:

just call the function: VideoTek() in your script


MPV Usage:

Press "Y" to turn on the waveform monitor while you're playing back a video.


Please note that due to the limitation of LAV Filter Complex, the MPV version is slightly different from the Avisynth Version:

https://github.com/FranceBB/mpv-scripts/raw/master/Screenshots/VideoTek1.jpg


Changelog:

v0.5 Crappy original version by FranceBB
v0.6 Commit by magiblot
v0.7 Major code cleanup by StainlessS
v0.8 Added 6ch display with the graph of the first two by Stainless
v0.9 Fixed a bug occurring with 1ch in the Lissajou graph by Stainless
v1.0 Added yv16 and yv24 planar 8bit support by FranceBB
v1.1 Introduced High Bit Depth Support, Frame Properties, Timecode and Luma Values in Volts by FranceBB
v1.2 Added support to all color spaces and code cleanup by StainlessS
v1.3 Added MPV Support by Algie
v1.4 Added frame properties support by FranceBB
v1.5 Improved small monitor image conversion and fixed a bug that would sometimes report invalid info at the bottom on the left by FranceBB
v1.6 Added Fractional Framerates Support.
v1.7 Implemented the new VideoTek(Mode="PQ") with the new 0.406V 58% Reference White marker
v1.8 Implemented new "Type" parameter to allow nits display instead of volts VideoTek(Mode="HLG", Type="nits"), but by default Type="volts".
v1.9 Introduced Type="nits" support for the recently introduced PQ Mode to display the 0, 203, 1000, 5000 and 10000 nits markers and Detailed=true to see all the 1k nits increments.

Cheers.

lansing
3rd February 2018, 23:25
To me the real deal of Tektronix's hardware is the double diamond vectorscope, it makes color matching looks so easy. But I think they patented it.
https://www.youtube.com/watch?v=8NTLqybQQSU

FranceBB
4th February 2018, 16:12
@lansing... yep, that's really useful, but I mainly work on post-production, so this is how I set it:

Tektronix (https://i.imgur.com/HRLItw3.jpg) - Avisynth (https://i.imgur.com/2UwzgyX.png)

Another example: https://i.imgur.com/EF3VWbu.png

lansing
6th February 2018, 20:50
Taking more look into the screenshot, the proportion of the graphs should be independent from the video window, they shouldn't be scaled 16:9 along with the video. And there needs to be boxes in the vectorscope to indicate the legal saturation range for standard definition and high definition. Also the wave form needs to have a some kind of indication of brightness, such as percentage.

I have a video only clip and it just return an error because I don't have an audio.

FranceBB
21st July 2018, 11:07
I updated it to a newer version. It's supposed to automatically detect the audio channels number and make a graph accordingly, but... it doesn't work... I think I broke my own code xD

Do you have any idea why it doesn't show the audio graph anymore?

magiblot
21st July 2018, 11:36
Well, you store things into the my_audio_levels_overlayX variables and then leave them unused.

FranceBB
21st July 2018, 12:06
That's the thing. I'd like to use Overlay(audio_levelsx) according to how many channels are detected, but I don't know how to do it.

magiblot
21st July 2018, 13:41
No problem :)

Try with the following changes:


source_audio_channels = clp.AudioChannels() #Does this return 0 if there is no audio?

myaudio = (source_audio_channels==0) ? GetChannels(myfakeaudio, 1, 2) :
\ (source_audio_channels==1) ? GetChannels(clean, 1) :
\ (source_audio_channels==2) ? GetChannels(clean, 1, 2) :
\ (source_audio_channels==3) ? GetChannels(clean, 1, 2, 3) :
\ (source_audio_channels==4) ? GetChannels(clean, 1, 2, 3, 4) :
\ (source_audio_channels==5) ? GetChannels(clean, 1, 2, 3, 4, 5) :
\ (source_audio_channels==6) ? GetChannels(clean, 1, 2, 3, 4, 5, 6) :
\ (source_audio_channels==7) ? GetChannels(clean, 1, 2, 3, 4, 5, 6, 7) :
\ (source_audio_channels==8) ? GetChannels(clean, 1, 2, 3, 4, 5, 6, 7, 8) :
\ NOP()

for_audio_levels = AudioDub(myblack, myaudio)

audio_levels = for_audio_levels.Histogram("audiolevels").Crop(0, 0, -736, -0).BilinearResize(340, 420)

my_audio_levels_overlay = Overlay(audio_levels, x=700, y=450, opacity=1.0, mode="blend", greymask=true, ignore_conditional=false, pc_range=false)


final=Overlay(my_audio_levels_overlay) #you will probably want to add additional parameters


There could be syntax errors, I edited this from mobile.

StainlessS
21st July 2018, 14:10
Where is 'mylissajou' supposed to come from ? (what histogram or whatever plug).

EDIT: Histogram(mode="StereoOverlay") ???

StainlessS
21st July 2018, 15:02
Looks about right, might need [EDIT: WILL NEED] some adjustment to dimension, overlay coords.
Have used Histogram(mode="StereoOverlay") for the mylissajou thing, hope that its correct.


#simple Videoscope by FranceBB:- https://forum.doom9.org/showthread.php?t=175249
#it resembles Tektronix WVR 7020
#Accepts 8bit clip only. It works internally in 4:2:0 (yv12)
#Accepts up to 8 audio channels

Function VideoTek(clip clp) {
clp
nChannels=(HasAudio)?AudioChannels:0 # ssS, HasAudio = audio_samples_per_second!=0
#Assert block
Assert(IsYV12,"VideoTek: source must be yv12 (YUV 4:2:0 8bit)")
# Assert(IsFrameBased, "VideoTek: source must be progressive") # ssS, IsFrameBased means SeparateFields NOT used, does not indicate Progressive
Assert(nChannels<9,"VideoTek: sources with more than 8 audio channels are not supported")

SilentStereo=Last.BlankClip(width=1480, height=920,audio_rate=48000,channels=2,sample_type="Float")
myBlack= (nChannels>0) ? SilentStereo.AudioDubEx(Last) : SilentStereo.Killaudio
Stereo = (nChannels>=2) ? Last.GetChannels(1,2) : (nChannels==1) ? MergeChannels(GetChannels(1),GetChannels(1)) : SilentStereo
StereoClip = Last.BlankClip(width=460,height=460).AudioDub(Stereo) # Histogram(mode="StereoOverlay") requires 2 channel only clip.

clean1=PointResize(704, 396)
Picture = clean1
luma = clean1.TurnRight.Histogram(mode="classic").TurnLeft.Crop(0,0,0,256).BilinearResize(704, 396)
chroma = clean1.Histogram("color2").Crop(704, 0, 256,256).BilinearResize(480,480)
Audio = myBlack.Crop(0,0,340,420).Histogram(Mode="audiolevels")
mylissajou = StereoClip.Histogram(mode="StereoOverlay") # Dont know where to get lissajou from, so improvised

Result = MyBlack
Result = Result.Overlay(Picture, x=0, y=0) # ssS, Removed all of the Optional Args assigned with Defaults
Result = Result.Overlay(luma, x=710, y=0)
Result = Result.Overlay(chroma, x=100, y=430)
Result = Result.Overlay(Audio, x=700, y=450)
Result = Result.Overlay(mylissajou, x=1000,y=450)
return Result
}

EDIT: BugFixed : EDIT: Same bug fixed AGAIN !!!

Untested with more than 2 channels. [EDIT: or with single channel, tested on 0 and 2 channels only]


ColorBars(Pixel_Type="YV12")
VideoTek
Return Last.Spline64Resize(854,480)


https://s20.postimg.cc/c1qnnemrh/Video_Tek.jpg (https://postimages.org/)

EDIT: Below bottom right image is more like what I remember as lissajou figure [EDIT: perhaps samplerate just too low]
https://uk.tek.com/sites/default/files/media/image/A002_0453-L.jpg

EDIT:
Stereo = (nChannels>=2) ? Last.GetChannels(1,2) : SilentStereo
Not sure how to process/mix multiple channels into stereo, above, just selected Left and Right.

FranceBB
21st July 2018, 17:55
Thank you magiblot and StainlessS :D

@StainlessS... yes, it's Histogram(mode="StereoOverlay"). The idea is to pick both Left and Right channel when stereo and pick just Front Left and Front Right when is Dolby.

It might not be as complex and detailed as the official waveform provided by Tektronix, but it kinda reminds its layout and it uses the internal filters already available in Avisynth, so I thought it was kinda cool to have a similar layout. ^_^

Thank you both, once again, this is exactly what I wanted. ^_^

StainlessS
21st July 2018, 18:32
bugFix,

was

Stereo = (nChannels>=2) ? Last.GetChannels(1,2) : (nChannels==2) ? MergeChannels(GetChannels(1),GetChannels(1)) : SilentStereo

should have been

Stereo = (nChannels>=2) ? Last.GetChannels(1,2) : (nChannels==1) ? MergeChannels(GetChannels(1),GetChannels(1)) : SilentStereo


I'll leave it to you to perfect it. :)
Fixed in prev post.

EDIT: Your original Big Buck Bunny Link (downsized to 854,480)
https://s20.postimg.cc/lntx2ctwt/France_BB.jpg (https://postimages.org/)

And current script(approx same frame, needs some coords fixed a bit)

https://s20.postimg.cc/tdw3tlty5/Video_Tek.jpg (https://postimages.org/)

EDIT:
The idea is to pick both Left and Right channel when stereo and pick just Front Left and Front Right when is Dolby.


From Avs Docs
Every file format has a different internal channel ordering. The following table gives this internal ordering for some formats (useful for plugin writers), but it is a decoder task supply to AviSynth the expected channel order (like WAV), if you use decoders like NicAudio/BassAudio or ffdshow/AC3_filter you don't need to worry about this:


reference: channel 1: channel 2: channel 3: channel 4: channel 5: channel 6:
5.1 WAV front left front right front center LFE rear left rear right


So I take it that channels 1 and 2 should be correct whether DOLBY or not (as we are dealing with WAV order).

StainlessS
21st July 2018, 22:12
Bit more fiddling about.

Function VideoTek(clip clp) {
clp
nChannels=(HasAudio)?AudioChannels:0 # ssS, HasAudio = audio_samples_per_second!=0
Assert(IsYV12,"VideoTek: source must be yv12 (YUV 4:2:0 8bit)")
Assert(nChannels<9,"VideoTek: sources with more than 8 audio channels are not supported")
CSZ = 480 # Chroma Size box (W & H)
A_W = 320 # Audio Box Width
A_H = 460 # Audio Box Height (Audio & Lissajoua)
L_W = (704+704+6)-700-A_W # Lissajous Width
SilentStereo=Last.BlankClip(width=1480, height=920,audio_rate=48000,channels=2,sample_type="Float")
myBlack= (nChannels>0) ? SilentStereo.AudioDubEx(Last) : SilentStereo.Killaudio
Stereo = (nChannels>=2) ? Last.GetChannels(1,2) : (nChannels==1) ? MergeChannels(GetChannels(1),GetChannels(1)) : SilentStereo
StereoClip = Last.BlankClip(width=16,height=16).AudioDub(Stereo) # Histogram(mode="StereoOverlay") requires 2 channel only clip.
Picture = BicubicResize(704, 396)
luma = TurnRight.Histogram(mode="classic").TurnLeft.Crop(0,0,0,256).BiCubicResize(704, 396)
chroma = Histogram("color2").Crop(clp.Width, 0, 0,256).BilinearResize(CSZ,CSZ)
Audio = myBlack.Crop(0,0,A_W,A_H).Histogram(Mode="audiolevels")
lissajous = StereoClip.Histogram(mode="StereoOverlay").BicubicResize(L_W,A_H)
MyBlack
Overlay(Picture, x=0, y=0)
Overlay(luma, x=704+6, y=0)
Overlay(chroma, x=(704-chroma.Width)/2,y=396 + (920-396-chroma.height)/2)
Overlay(Audio, x=704-4, y=396 + (920-396-audio.height) /2)
Overlay(lissajous, x=700+Audio.Width, y=396 + (920-396-lissajous.height) /2)
return Last
}


Can mess with this lot to auto center stuff, when happy then might want to hard code numbers.

CSZ = 480 # Chroma Size box (W & H)
A_W = 320 # Audio Box Width
A_H = 460 # Audio Box Height (Audio & Lissajoua)
L_W = (704+704+6)-700-A_W # Lissajous Width


Have also converted from PointResized source to input source for histogram stuff, and used Bicubic instead where resize necessary,
if too slow, then change BiCubics to BiLinear.

EDIT: Added Levels() on Lissajous trying to make more visible, only minor improvement (before downsize).

Here, downsized,
https://s20.postimg.cc/3l5foosj1/Video_Tek.jpg (https://postimages.org/)

EDIT:
In Steinberg, I think that the Lissajous thing is known as Phase (or Phase Scope), when spreads out horizontally, is broader stereo,
if dot or vertical line, then is mono, height being amplitude (I guess FranceBB, already knows this).
The Phase Scope, shows info from only first two channels (Left & Right, it is stereo specific, perhaps eg 5.1 should be downmixed somehow).

EDIT: Moved Levels() before BiCubicResize() for Lissajous.
(Levels improvement is only on the cross hair thing, is a bit more visible on FranceBB linked image than in this script)

EDIT:
Changed Levels 126-4 and 126+4, to 126-1, 126+1. (126 being TV levels mid point)

lissajous = StereoClip.Histogram(mode="StereoOverlay").Levels(126-1,1.0,126+1,16,235,coring=false).BicubicResize(L_W,A_H)


EDIT: Damn, below bug crept back in again, fixed in blue [was (nChannels==2)].

Stereo = (nChannels>=2) ? Last.GetChannels(1,2) : (nChannels==1) ? MergeChannels(GetChannels(1),GetChannels(1)) : SilentStereo


EDIT: Levels() removed from Lissajous thing, it emphasized the cross hairs stuff, but messed with the dust cloud a bit.

StainlessS
23rd July 2018, 08:23
FrancBB, I see your there,
NOTE, the bug that crept back in is also present in your 1st post, must have edited on-line and forgot to make same bug fix in my script
and then made mod with unfixed script.
(2nd last edit in above post).

FranceBB
23rd July 2018, 10:38
when spreads out horizontally, is broader stereo,
if dot or vertical line, then is mono, height being amplitude (I guess FranceBB, already knows this).

Yes, I use it on a daily basis at work to check whether there's difference between channels in a stereo pair or not.

NOTE, the bug that crept back in is also present in your 1st post

Oh, I see...

So I take it that channels 1 and 2 should be correct whether DOLBY or not (as we are dealing with WAV order).

Yes, it's always gonna follow the wav order 'cause Avisynth internally works with this order, so, if someone indexes a video file that has an AC3 Dolby audio track with an indexer, it's up to the indexer to return a WAV audio order to Avisynth.



Anyway, thank you for modifying the code. I owe you a beer.
Perhaps, one day, when there'll be perfect 3D scanners... xD

reisub
22nd February 2020, 10:35
FranceBB, thanks for the script. At work, for quality control, I use mainly Aurora Tektronix. But I was pleasantly surprised by the possibilities of this script.

FranceBB
9th November 2020, 03:05
Version 1.1 Released:
- Introduced High Bit Depth Support (***)
- Introduced Frame Properties and Timecode
- Introduced Luma Values in Volts


*** I actually cheated as I'm doing things in 8bit planar, however it works as bit-shifting is done in a way that preserves fullrange/limitedrange values


In the bottom left, you're now gonna see the resolution, framerate, colorspace and bit depth of the clip you indexed and on the bottom right you're gonna see the timecode which scales according to the framerate, just like you would in the Tektronix waveform monitor (or in a Sony VTR). ;)

https://i.imgur.com/w92kFaw.png
https://i.imgur.com/sHsDioV.png
https://i.imgur.com/CAMTE6k.png
https://i.imgur.com/0PPGCHr.png


FranceBB, thanks for the script. At work, for quality control, I use mainly Aurora Tektronix. But I was pleasantly surprised by the possibilities of this script.

I'm glad you like it. I wanted to bring those waveform monitors to Avisynth so that I could check the files I encode before sending them to the QC guys without having to be in the office with my workstation connected to a piece of hardware via SDI. ;)

StainlessS
9th November 2020, 03:45
FBB,
Some Comments flagged by ssS:


Function VideoTek(clip clp) {
clp
nChannels=(HasAudio)?AudioChannels:0 # HasAudio = audio_samples_per_second!=0

#Errors checking
Assert(IsPlanar && IsYUV, "VideoTek: source must be planar YUV") # ssS: IsPlanar simpler than IsYV12 etc
Assert(nChannels<9,"VideoTek: sources with more than 8 audio channels are not supported")

#Getting info
#Resolution
x=clp.Width()
y=clp.Height()
#Framerate
fps=clp.FrameRate() # ssS: Not FrameRateNumerator (check Src with eg Assumefps(30000,1001)
#ColorSpace
colorspace=clp.PixelType()

#Taking care of High bit Depth
Bpc = clp.BitsPerComponent
clp.ConvertBits(bits=8) # ssS: If already 8 bits then ConvertBits should do nothing anyway (return original)


# ...


See SendSpace below sig for Avs (not avsi, remove my comments and test code, and rename to avsi).

Appended testcode after your script, in the avs


AviSource("d:\Parade.avi")

Assumefps(30000,1001) # Test FrameRate

# UnComment ONLY ONE of below

#ConvertToRGB32 # RGB32
#ConvertToRGB24 # RGB24
#ConvertToYUY2 # YUY2
#ConvertToYV12 # YV12
# v2.60 +
#ConvertToYV411 # YV411
#ConvertToYV16 # YV16
#ConvertToYV24 # YV24
#ConvertToY8 # Y8
# Avs+
#ConvertToRGB48 # RGB48 Intereleaved RGB 16 bit
#ConvertToRGB64 # RGB64 Intereleaved RGBA 16 bit

# ... + Loads more

# 32 Bit Float
#ConvertToRGB48.ConvertToPlanarRGB.ConvertBits(32) # RGBPS
#ConvertToRGB64.ConvertToPlanarRGBA.ConvertBits(32) # RGBAPS
#ConvertToY8.ConvertBits(32) # Y32
#ConvertToYV12.ConvertBits(32) # YUV420PS
#ConvertToYV16.ConvertBits(32) # YUV422PS
#ConvertToYV24.ConvertBits(32) # YUV444PS
#ConvertToYV12.ConvertBits(32).AddAlphaPlane # YUVA420PS
#ConvertToYV16.ConvertBits(32).AddAlphaPlane # YUVA422PS
ConvertToYV24.ConvertBits(32).AddAlphaPlane # YUVA444PS
###################

Videotek


EDIT: Fix your avsi script and I'll remove this post.

EDIT:
More mods, posted on SendSpace. [also, removed references to clp after initializing Last].

Function VideoTek(clip clp) {
clp
nChannels=(HasAudio)?AudioChannels:0 # HasAudio = audio_samples_per_second!=0

#Errors checking # ssS: Might as well do at beginning (after errchk, known Planar YUV & < 9 channels)
# Assert(IsPlanar && IsYUV, "VideoTek: source must be planar YUV") # ssS: IsPlanar simpler than IsYV12 etc
Assert(nChannels<9,"VideoTek: sources with more than 8 audio channels are not supported")

#Getting info
#Resolution
x=Width()
y=Height()
#Framerate
fps=FrameRate() # ssS: Not FrameRateNumerator (check Src with eg Assumefps(30000,1001)
#ColorSpace
colorspace=PixelType()

#Taking care of High bit Depth
Bpc = BitsPerComponent


# ConvertBits(bits=8) # ssS: If already 8 bits then ConvertBits should do nothing anyway (return original)
ConvertToYUV444.ConvertBits(bits=8) # ssS: Convert To YV444, 8 bit, support all colorspace input

# ...


Supports ALL input colorspace, not just Planar YUV. [Only tested with YUY2, RGB64, RGBPS + a few more, but all should work]

EDIT: Fixed Error in either Avs+ or VD2.
Bug report here in devs forum:- https://forum.doom9.org/showthread.php?p=1927858#post1927858

fix [Updated script on SendSpace]

Function VideoTek(clip clp) {
clp
nChannels=(HasAudio)?AudioChannels:0 # HasAudio = audio_samples_per_second!=0

#Errors checking
Assert(nChannels<9,"VideoTek: sources with more than 8 audio channels are not supported")

#Getting info
#Resolution
x=Width()
y=Height()
#Framerate
fps=FrameRate()
#ColorSpace
colorspace=PixelType()

#Taking care of High bit Depth
Bpc = BitsPerComponent

ConvertToYUV444
(HasAlpha) ? RemoveAlphaPlane : NOP # ssS: Avoid eg YUVA444 error in VirtualDub2 (OK in PotPlayer but grey screen in VD2 if YUVA)
ConvertBits(bits=8) # ssS: Convert To YUV444, 8 bit, NO ALPHA, support all colorspace input

# ...


https://i.postimg.cc/6y7kCLJN/Video-Tek-00.jpg (https://postimg.cc/6y7kCLJN)

FranceBB
9th November 2020, 09:06
Woah, thank you for that!
I just tested it, it works like a charm.
I've just updated the code on GitHub.

Version 1.2 released.
Updated Changelog:
v1.2 Added support to all planar color spaces and code cleanup by StainlessS

p.s if you have a GitHub account, I'll give you full access to the repository ;)
p.p.s you know why I used millivolt (or rather Volts) as a measurement instead of putting 16-235 in the luma monitor? 'cause Volt levels are the same for each signal, no matter the bit depth, while bit values (16-235) change with bit depth (like 10bit, 64-940 etc) and I didn't want to write a conditional based on that xD Still, the Tektronix engineers did the same and showed Volts as scale, so... I guess it's fine. xD

StainlessS
9th November 2020, 17:20
v1.2 Added support to all planar color spaces ...
Should be
"v1.2 Added support for all input color spaces ..."

I will not remove my prev post, as it gives some background to bugrep in devs forum.

EDIT: Nope, no GitHub account just yet, one day maybe.

Temp VideoTek.avs removed from SendSpace.

FranceBB
9th November 2020, 23:16
Should be
"v1.2 Added support for all input color spaces ..."

Modified. ;)



I will not remove my prev post, as it gives some background to bugrep in devs forum.

Yeah, keep it, it's nice to have a list of changes in the discussion here on Doom9 so that we can always go back to a previous version. You could have left the previous posts as well. ;)


Nope, no GitHub account just yet, one day maybe.


Oh... :(

DTL
25th November 2020, 12:41
This is great vector-rasterizer but it do not have graticule for unkonwn reason. Especially with IQ axies overlaid that are good enough for control the most important 'euro-standard' skintone with +I axis direction (angle). So it is good addition for this plugin to have option to overlay 'typical' or any hand-designed graticule with degrees markings (at least with 10-degree step) and IQ axies or at least vector-marking to that typical skintone to control.

I though about why magically NTSC skintone vector so good aligned with one of the system axises (and also why IQ axises are rotated to magical angle about 33-deg) - the idea was simple: because NTSC was very buggied with phase-distortions in analog TV so engineers trying to keep at least the most important skintone color make additional rotation of IQ axies so at skintone the I channel is at its maximum amplitude and Q channel close to zero - so any possible cross-distortions between I and Q channels makes minimum real color shift. And also engineers for color tone setting for video cameras got very simple tool for bringing skintone to standard value using vectoroscope screen with overlayed graticule with IQ axies.

Also at typical vectorscope the +I axis is pointed to the upper-left corner so it is good to have option for vertical-flipping of vectorscope image (keeping symbol markings not flipped).

In 2020 I tried to make multi-channel SDI vectorscope for our engeneers for easy setup and in-between cameras aligning of skintone using old Blackmagic Decklink cards as SDI inputs to windows-based computer and directshow multigraphs with ffdshow and this vectorscope rasteriser (with graticule applied as layer via avisynth). Unfortunately due to old card and old drivers the system start to lower update framerate after about 1 hour of running. If anyone interested in this project you can e-mail me.

Also as practice shows it is good to have ROI-selected vectorscope - so some control for setting ROI coordinates at runtime and passing to crop engine or ROI selecting engine inside vectorscope is good. So operator can get cleaner image of the interested part of frame instead of less-informative all-frame colors.

FranceBB
20th June 2021, 12:52
New Version Released

- Avisynth users: no need to update, no changes have been made.
- MPV Users: Added support for MPV, check it out here: https://github.com/FranceBB/mpv-scripts

Please note that due to the limitation of LAV Filter Complex, the MPV version is slightly different from the Avisynth Version:

https://github.com/FranceBB/mpv-scripts/raw/master/Screenshots/VideoTek1.jpg

wonkey_monkey
20th June 2021, 13:42
Is the oscilloscope thing on the bottom left upside down? Isn't it usually white at the top, black at the bottom?

FranceBB
20th June 2021, 21:30
Dammit, it is, I just checked...

https://i.pinimg.com/originals/92/e8/48/92e848ffd6bfc479590934a928dbdd0f.jpg

Fix in progress, hold on.

FranceBB
21st June 2021, 09:04
Fixed, check new version: https://github.com/FranceBB/mpv-scripts/releases

https://github.com/FranceBB/mpv-scripts/raw/master/Screenshots/VideoTek.jpg

kedautinh12
21st June 2021, 09:39
Thanks

FranceBB
26th August 2022, 18:26
VideoTek v1.3 Released! (https://github.com/FranceBB/VideoTek/releases)




Changelog:
- Introduced support to the new HLG Scope via VideoTek(Mode="HLG") which now shows where the reference white of HLG should be, namely 75% of the Limited TV Range signal, so 0.525 Volts. By default, Mode stays as SDR.



Usage Example with HDR HLG videos:

#Indexing a video
video=LWLibavVideoSource("test_shooting.mxf")
audio=LWLibavAudioSource("test_shooting.mxf")
AudioDub(video, audio)


#Calling VideoTek with HLG Mode
VideoTek(Mode="HLG")

https://user-images.githubusercontent.com/18946343/186958373-6f20978f-766d-45bd-841c-5ca0ba177b59.png

The HLG Mode will enable the 75% Reference White marker at 0.525V.

frank
3rd September 2022, 15:58
Sorry, the mpv VideoTek.lua doesn't work.
On 'y' player stops at end with black screen.
Next 'y' gets video and next 'y' gets audio.
No return to normal play is possible.

I use mpv\portable_config\scripts
The mpv is version v3.

mpv.confvo=gpu
hwdec=auto

FranceBB
3rd September 2022, 19:18
Next 'y' gets video and next 'y' gets audio.
No return to normal play is possible.


yeah, 'cause this line was missing:

return "[aid1] asetpts=PTS [ao]; [vid1] setpts=PTS [vo]"

Fixed, new release coming.


MPV Waveform Monitor v1.3 Released (https://github.com/FranceBB/mpv-scripts/releases/tag/1.3)


Changelog:
Fixed a bug where audio and video were returned separately instead of together when the function was deactivated


Now cycling through "y" works

https://i.imgur.com/GmEaXGz.png
https://i.imgur.com/y6tAvYB.png
https://i.imgur.com/GmEaXGz.png

frank
4th September 2022, 09:38
Many thx

But, doesn't work with hw decoding (Intel)
Searching is very slow.

So I stay on Avisynth plugin.

FranceBB
4th September 2022, 16:47
Many thx

But, doesn't work with hw decoding (Intel)
Searching is very slow.

So I stay on Avisynth plugin.

Yeah, hardware decoding won't work.
This is probably 'cause I suck at LUA and I still don't know much about MPV.
The original intent was to play files in real time without having to index them in Avisynth, which... worked... for SD files only. :|
I made it open source hoping that people would actually help me and improve it, but no one seemed interest...

Just FYI, I use the Avisynth plugin regularly, but I don't use the MPV one myself 'cause real time playback is impossible (unless you use SD) and at that point it's just better to do stuff in Avisynth... :(

FranceBB
23rd March 2023, 17:35
VideoTek v1.4 Released! (https://github.com/FranceBB/VideoTek/releases)


Changelog:
- v1.4 Added frame properties support

FranceBB
24th April 2023, 11:03
VideoTek v1.5 Released! (https://github.com/FranceBB/VideoTek/releases)


Changelog:
- Improved small monitor image conversion
- Fixed a bug that would sometimes report invalid info at the bottom on the left

https://user-images.githubusercontent.com/18946343/233964818-8bfc4ec9-f09d-41f8-bd37-34155f846ab0.png

FranceBB
2nd January 2024, 11:10
VideoTek v1.6 Released! (https://github.com/FranceBB/VideoTek/releases)

Changelog:

- Added Fractional Framerates Support


Non common, fractional Framerates like 24.5, 24.9, 25.2fps etc are now supported and won't error out as there's a try-catch before ShowSMPTE(). In other words, when non common / non standard framerates are detected, ShowTime() is gonna be used instead.

Normal 24fps (first image)
Fractional 24.5fps (second image)

https://i.imgur.com/pVWbjlq.png
https://i.imgur.com/7WBNiUm.png


Bear in mind that in this latter case there will be 3 digits at the end instead of two in the "timecode" as the last portion ain't gonna be frames but rather ms. ;)

DTL
2nd January 2024, 15:53
Heh - where is our professional 'european reference skintone' colour hue mark at the vectoroscope ? Maybe in the version of 2.0 will be available ?

With some DirectShow input plugin (maybe even current DirectShowSource() is working already too) it is possible to run real pro hardware quality monitor realtime with SDI (or some modern IP-based or optical) input for realtime studio camera engineering setup. So checking/adjusting of the Main Important colour tone of (european) human skin hue is very important. Also for quick alignment of 2 and more physical video cams maybe useful to display several sources vectoroscope render at the same place/window to simplify alignment of the skintone vectoroscope render to the reference mark and between several sources.

Also it is good to have Zoom/Scale (Saturation) control from 1.0 and higher for Vectoroscope window separately to see natural low-saturated data with better precision. It sometime may required about 2x or even 3x zoom/scale to put typical natural scene vectoroscope render to fit window better.

As you show at this example
https://user-images.githubusercontent.com/18946343/233964818-8bfc4ec9-f09d-41f8-bd37-34155f846ab0.png

for real natural scene complete vectoroscope render takes only about 10% or less from full window but it is 100% real and important data to control and adjust if required.

Maybe even in AVS+ scripting (via Eval ?) it is possible to change saturation amplitude display from linear scale to some non-linear (log ? or powered ?) so low saturated natural colours will be more visible in the window area. So it is good to have also switch to scale display of Vectoroscope window (Zoom and saturation transfer function Linear/Log/...).

FranceBB
1st March 2024, 14:06
VideoTek v1.7 Released! (https://github.com/FranceBB/VideoTek/releases)

Changelog:

- Implemented the new VideoTek(Mode="PQ") with the new 0.406V 58% Reference White marker



I know that Tormento has been asking for this for a long time, so he'll definitely be happy. Big thanks to fzold for cross-checking the 58% reference white at 0.406V.

Usage Example (HDR PQ)

#Indexing a video
video=LWLibavVideoSource("test_shooting_PQ.mxf")
audio=LWLibavAudioSource("test_shooting_PQ.mxf")
AudioDub(video, audio)

#Calling VideoTek with PQ Mode
VideoTek(Mode="PQ")

https://private-user-images.githubusercontent.com/18946343/309265926-8879d890-6548-4f67-94bb-e70271802979.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDkyOTg2NjcsIm5iZiI6MTcwOTI5ODM2NywicGF0aCI6Ii8xODk0NjM0My8zMDkyNjU5MjYtODg3OWQ4OTAtNjU0OC00ZjY3LTk0YmItZTcwMjcxODAyOTc5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzAxVDEzMDYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFkN2Y3ODkxNmYyNjUwMTA0NDExNGEwYzhkOTE4NzgyYjBmZGMzZWQyZGIyNGYwNmFkZDYwNDU4ZDA4NmU5NTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.tcPGe51dxQcomuyMynjKJOffixk4nqfQHTgXw-pxUrI

The PQ Mode will enable the 58% Reference White marker at 0.406V.

tormento
1st March 2024, 15:36
I know that Tormento has been asking for this for a long time
:thanks:

FranceBB
27th March 2024, 21:56
VideoTek v1.8 Released! (https://github.com/FranceBB/VideoTek/releases)

Changelog:

- Implemented new "Type" parameter to allow nits display instead of volts if explicitly set via VideoTek(Mode="HLG", Type="nits"), but by default it's Type="volts".


As always a big thanks to fzold for cross-checking the values.

Usage Example (HDR HLG Type nits)

#Indexing a video
video=LWLibavVideoSource("test_shooting.mxf")
audio=LWLibavAudioSource("test_shooting.mxf")
AudioDub(video, audio)

#Calling VideoTek with HLG Mode and Type nits
VideoTek(Mode="HLG", Type="nits")


https://private-user-images.githubusercontent.com/18946343/317513207-16b2932b-c048-4537-ba43-206580f5db74.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTE1NzMyMzMsIm5iZiI6MTcxMTU3MjkzMywicGF0aCI6Ii8xODk0NjM0My8zMTc1MTMyMDctMTZiMjkzMmItYzA0OC00NTM3LWJhNDMtMjA2NTgwZjVkYjc0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzI3VDIwNTUzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1YzRjN2E3MGJiYWI1ZGU3OWQzMzllMGZjZDNlN2UzODc1YmJhNmM2NzY4NTA3YjBkNWQzZjA3YTRiY2U0OTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.98VV4mGkf1mUrySKOnKIuHleJw1y2UXp1j3lOM0pIjE


The nits reference in HLG mode will enable the 0, 100, 200, 400, 600 and 1000 nits markers.

FranceBB
17th May 2024, 17:58
VideoTek v1.9 Released! (https://github.com/FranceBB/VideoTek/releases)

Changelog:

- Introduced Type="nits" support for the recently introduced PQ Mode to display the 0, 203, 1000, 5000 and 10000 nits markers.
- Introduced Detailed=true support to allow the user to see all the 1k nits increments in PQ mode (i.e the 0, 203, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000 nits markers).


When Mode="PQ" and Type="nits", then it's possible to set a boolean option Detailed=true to include a detailed visualization with a 1000 nits step all the way up to 10k nits. Given that such a visualization can make the whole monitor very crowded (especially in the upper region given that PQ is logarithmic), by default it's set to "false" which means that it will only show 0 nits, 203 nits, 1000 nits, 5000 nits and 10000 nits.

As always a big thanks to fzold for cross-checking the values.

Usage Example (HDR PQ Type nits)

#Indexing a video
video=LWLibavVideoSource("test.mxf")
audio=LWLibavAudioSource("test.mxf")
AudioDub(video, audio)

#Calling VideoTek with PQ Mode
VideoTek(Mode="PQ", Type="nits")

https://private-user-images.githubusercontent.com/18946343/331662156-69273731-3eab-48d7-b78b-67b01189e181.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5NjUyODMsIm5iZiI6MTcxNTk2NDk4MywicGF0aCI6Ii8xODk0NjM0My8zMzE2NjIxNTYtNjkyNzM3MzEtM2VhYi00OGQ3LWI3OGItNjdiMDExODllMTgxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDE2NTYyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRkOGY2NmY1NjJlM2JiOTRjNjViODFkNjQwZDQyM2VkY2ZmMzBlZTRlNWVkZjIyN2Y3NDZiMTYyMjRhNzM4MGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ChFr5Hs6oH-PrV3EDf_NIo3FDC8OsDRhtztEE0tER2Q

The nits reference in PQ mode will enable the 0, 203, 1000, 5000 and 10000 nits markers.
It's also possible to increase the level of details by making VideoTek display all the 1k nits increments with Detailed=true.

#Indexing a video
video=LWLibavVideoSource("test5.mxf")
audio=LWLibavAudioSource("test5.mxf")

AudioDub(video, audio)

#Calling VideoTek with PQ Mode with Detailed set to true
VideoTek(Mode="PQ", Type="nits", Detailed=true)


https://private-user-images.githubusercontent.com/18946343/327808954-e008e111-7fed-4c07-83cd-02792a751a4b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5NjUyODMsIm5iZiI6MTcxNTk2NDk4MywicGF0aCI6Ii8xODk0NjM0My8zMjc4MDg5NTQtZTAwOGUxMTEtN2ZlZC00YzA3LTgzY2QtMDI3OTJhNzUxYTRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDE2NTYyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2ZGM2ZmQ4NTFjZTRkMjM4ZTBhNTc1ZDJjNDUwZjRhY2FiMDUwMWQ4MGU4MjMwMmZkOWMxMGE5YTZhMWFmMjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.McCCNl0t4cBtW9ChbnGy4SydBjrMz7Ako416cU3vzVw

FranceBB
17th May 2024, 18:05
A few examples with

VideoTek(Mode="PQ", Type="nits", Detailed=true)

https://private-user-images.githubusercontent.com/18946343/327816896-c94f76a8-868a-43a7-9d40-82468fc07bff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5NjU3NzQsIm5iZiI6MTcxNTk2NTQ3NCwicGF0aCI6Ii8xODk0NjM0My8zMjc4MTY4OTYtYzk0Zjc2YTgtODY4YS00M2E3LTlkNDAtODI0NjhmYzA3YmZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDE3MDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ0NjBhMzgwMzI5YzdlZTdjZTc1MDYxNWY3M2U2YzhmZTM4MmZhMWUxNDJkNzBmYzZlNDRkMzliN2M0NmRlNjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.EAbnHitOx993vaQG2E798UmRL2sEiD22TBepDV_micI
https://private-user-images.githubusercontent.com/18946343/327816913-49e7693f-30b2-4b0d-8b3e-d55ce203770a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5NjU3NzQsIm5iZiI6MTcxNTk2NTQ3NCwicGF0aCI6Ii8xODk0NjM0My8zMjc4MTY5MTMtNDllNzY5M2YtMzBiMi00YjBkLThiM2UtZDU1Y2UyMDM3NzBhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDE3MDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFjN2I5MTdhNzg4NDVmMzhlYzg4N2ZhYTkzMzIzM2Q1NjI4ZGRlMGMyNTQ3MThkN2RhNGJjZmQ3Mjk0ZWY5YTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1PCP6vmgx-fR_wHBCAYB2yEqDVA7XJwYRrgf3U3PDoA
https://private-user-images.githubusercontent.com/18946343/327816936-8e75e347-819e-4354-b07d-48f434db82e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5NjU3NzQsIm5iZiI6MTcxNTk2NTQ3NCwicGF0aCI6Ii8xODk0NjM0My8zMjc4MTY5MzYtOGU3NWUzNDctODE5ZS00MzU0LWIwN2QtNDhmNDM0ZGI4MmU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDE3MDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFkNTgyMDgyMmFjOWQ1ZTA4MzYzMjdkMDNmMGU2MzA4MTIxMWRlZjA2NGI4NTRhOTUzNzc0OTRlMzI0ZDFmNWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YTPckZR54K2cUdy97ECV24yvNoadBrFb6S-CRGeLJ1s
https://private-user-images.githubusercontent.com/18946343/327816999-2121a3e6-d92b-496c-bb68-0df1422d284b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5NjU3NzQsIm5iZiI6MTcxNTk2NTQ3NCwicGF0aCI6Ii8xODk0NjM0My8zMjc4MTY5OTktMjEyMWEzZTYtZDkyYi00OTZjLWJiNjgtMGRmMTQyMmQyODRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE3VDE3MDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE4NTZkYzliODZmMDNiOTU5MmY1YmYwZjhmOGZhNDRmYzQ4NjIwZjQ0NTU1MzY1NzBhOTI5Mzg5NGI1MDYyZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WGxD4PY6hyzFKu6y2AdGhZtr0CqmFAIUPGO_5DF4ViE

FranceBB
11th May 2025, 19:09
In honor of the upcoming Avisynth 25th birthday (May 19th) I wanted to make VideoTek() compatible with both the old Avisynth 2.6.1 and the new Avisynth+ versions. To do that, I created 3 functions in the same .avsi file:

- VideoTek()
- VideoTekLegacy()
- VideoTekModern()

The idea was to have VideoTek() check the Avisynth version by grabbing the output of VersionString(), bringing the string to lowercase, checking whether it says "avisynth" or "avisynthplus" and if that's the case then set modern_version to true, otherwise set it to false.
At that point, if modern_version is false, I call VideoTekLegacy() otherwise I call VideoTekModern().


Function VideoTek(clip clp, String "Mode", String "Type", Bool "Detailed") {

#Check Avisynth version for backwards compatibility
#The old version has limited functionality
my_version=LCase(VersionString)
modern_version = (FindStr(my_version, "avisynth+") > 0) || (FindStr(my_version, "avisynthplus") > 0) ? true : false
(modern_version == false) ? VideoTekLegacy(clp) : VideoTekModern(clp, Mode, Type, Detailed)

}


So far so good, right? Well, not quite.
You see, if I do something like this:


ColorBars(848, 480, pixel_type="YV12")

VideoTek()


in the new Avisynth+ 3.7.5 then everything works like a charm as it calls VideoTekModern() under the hood, however if I do the same on Avisynth 2.6.1, it should technically call VideoTekLegacy() but Avisynth keeps going and checks the whole avsi so by the time it *sees* the modern syntax in the new function it errors out.

https://i.imgur.com/XiEi8VM.png

Anyway, in case anyone was curious, here's an Avisynth 2.6.1 compatible version


Function VideoTekLegacy(clip clp, String "Mode") {

clp
nChannels=(HasAudio)?AudioChannels:0

#Errors checking
Assert(nChannels<9,"VideoTek: sources with more than 8 audio channels are not supported")

#Mode
Mode = Default(Mode, "SDR")

#Main
CSZ = 480 # Chroma Size box (W & H)
A_W = 320 # Audio Box Width
A_H = 460 # Audio Box Height (Audio & Lissajoua)
L_W = (704+704+6)-700-A_W # Lissajous Width
SilentStereo=Last.BlankClip(width=1480, height=920,audio_rate=48000,channels=2,sample_type="Float")
myBlack= (nChannels>0) ? SilentStereo.AudioDubEx(Last) : SilentStereo.Killaudio
Stereo = (nChannels>=2) ? Last.GetChannels(1,2) : (nChannels==1) ? MergeChannels(GetChannels(1),GetChannels(1)) : SilentStereo
Stereoclip = Last.BlankClip(width=16,height=16).AudioDub(Stereo) # Histogram(mode="StereoOverlay") requires 2 channel only clp.
Picture = BicubicResize(704, 396)
luma = TurnRight.Histogram(mode="classic").TurnLeft.Crop(0,0,0,256).BiCubicResize(704, 396)
chroma = Histogram("color2").Crop(Width, 0, 0,256).BilinearResize(CSZ,CSZ)
Audio = myBlack.Crop(0,0,A_W,A_H).Histogram(Mode="audiolevels")
lissajous = Stereoclip.Histogram(mode="StereoOverlay").BicubicResize(L_W,A_H)

#Putting the 4 blocks together with a black background
MyBlack
Overlay(Picture, x=0, y=0)
Overlay(luma, x=704+6, y=0)
Overlay(chroma, x=(704-chroma.Width)/2,y=396 + (920-396-chroma.height)/2)
Overlay(Audio, x=704-4, y=396 + (920-396-audio.height) /2)
Overlay(lissajous, x=700+Audio.Width, y=396 + (920-396-lissajous.height) /2)


#Displaying Values for Luma (top right)
Subtitle("0.00V", x=1430.0, y=362.0, size=18)
Subtitle("0.70V", x=1430.0, y=20.0, size=18)
Subtitle("0.35V", x=1430.0, y=192.0, size=18)

#Displaying TimeCode (bottom right), BitDepth and ColorSpace (bottom left)
Subtitle("TC:", size=18, x=1309, y=896)
ShowSMPTE(size=18, x=1383, y=910)

return Last
}



Windows98SE likes it.

https://i.imgur.com/jq4e1Vb.png


As to the conditional itself, if I try it with a simple Subtitle() it just works (which isn't a surprise as I've seen plenty of people do something similar and even the wiki recommends it):

https://i.imgur.com/aSi1RnR.png

so... it's just that Avisynth 2.6.1 keeps going, reaches VideoTekModern(), and errors out, instead of ignoring the second function and just calling VideoTekLegacy()... :(

real.finder
11th May 2025, 21:13
non-plus don't have "if" so you can hide that in EVAL or with another trick, or try to put it in sub folder and call it only if avs+ is used

you can have a look here https://forum.doom9.org/showthread.php?t=181989

buddha9
12th September 2025, 08:47
Heh - where is our professional 'european reference skintone' colour hue mark at the vectoroscope ? Maybe in the version of 2.0 will be available ?


nice to have :)