Log in

View Full Version : Load avs x64 core function into vapoursynth x64 ?


poisondeathray
16th February 2020, 06:17
Is there a way to load a native(internal) x64 avisynth core function (not an external .dll plugin) in vapoursynth x64 ?

eg. RGBAdjust()

avsproxy can embed x86 avs+ in x64 vapoursynth, but I don't think it can do x64 avs

Myrsloik
16th February 2020, 08:58
No, not unless you recompile then as separate plugins. If you look at the rgbadjust documentation you'll see it's trivial to implement using expr.

poisondeathray
16th February 2020, 16:02
No, not unless you recompile then as separate plugins. If you look at the rgbadjust documentation you'll see it's trivial to implement using expr.

Thanks,

In this case I was more interested in the analyze=true parameter ? Same with ColorYUV(analyze=true).

Or does vapoursynth have another similar function where it can display min/max values

Myrsloik
16th February 2020, 16:10
Thanks,

In this case I was more interested in the analyze=true parameter ? Same with ColorYUV(analyze=true).

Or does vapoursynth have another similar function where it can display min/max values

This will show you what you want (untested)

vs.std.PlaneStats(clip).text.FrameProps()

poisondeathray
16th February 2020, 16:21
It works and does what I want, thanks

poisondeathray
16th February 2020, 16:26
Is there a smart python way to display results for planes 0,1,2 together in 1 command ?

Myrsloik
16th February 2020, 16:54
Is there a smart python way to display results for planes 0,1,2 together in 1 command ?
vs.std.PlaneStats(clip, plane=0, prop='PlaneStatsR').std.PlaneStats(clip, plane=1, prop='PlaneStatsG').std.PlaneStats(clip, plane=2, prop='PlaneStatsB').text.FrameProps()

poisondeathray
16th February 2020, 17:04
Thanks, it works

_Al_
16th February 2020, 22:33
nice, and to analyze those frames it could go like this for example:
import vapoursynth
from vapoursynth import core
import threading

clip = core.lsmas.LibavSMASHSource(r'C:\video.mp4')
clip = core.resize.Point(clip, format = vs.RGB24, matrix_in_s = '709')

class Analyze:
LABELS = [
'RMin',
'RMax',
'GMin',
'GMax',
'BMin',
'BMax'
]

def __init__(self, c):
self.c = c
self.illegal_R = 0
self.illegal_G = 0
self.illegal_B = 0

c = core.std.PlaneStats(c, plane=0, prop = 'PlaneStatsR' )\
.std.PlaneStats(c, plane=1, prop = 'PlaneStatsG' )\
.std.PlaneStats(c, plane=2, prop = 'PlaneStatsB' )

for frame in range(len(c)):
props_dict = dict(c.get_frame(frame).props)
for label in self.LABELS:
setattr(self, label, props_dict['PlaneStats'+label])
#print('frame:', frame, label,'=', getattr(self, label))
self.analyze_frame(frame)

self.resolution()

def analyze_frame(self, frame):
if self.RMin < MIN or self.RMax > MAX:
self.illegal_R +=1
#and something with other channels

def resolution(self):
print(f'channel R has {self.illegal_R} illegal frames out of {len(self.c)} frames')
#etc.


#checking illegal RGB values
MIN = 5
MAX=246
test_clip = clip
p = threading.Thread(target=Analyze, args=(test_clip,))
p.start()
clip.set_output()