Log in

View Full Version : How to call Histogram ?


poisondeathray
26th September 2015, 23:55
It's probably something stupid, but I can't get Histogram to work . I tried bunch of combos, lower case "h", input = ret, etc... It works fine without the Histogram line

I either get a "There is no attribute or namespace named histogram", or "There is no function named histogram" message. "libhistogram.dll" is in my C:\Program Files (x86)\VapourSynth\core64\plugins directory

Can someone please give an example of the syntax ? I couldn't find any documentation or examples



import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()

ret = core.lsmas.LWLibavSource(source=r'E:\video.avi', format="YUV420P8")
#ret = core.std.Histogram(ret)
ret.set_output()



Thanks

Are_
27th September 2015, 00:06
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()

ret = core.lsmas.LWLibavSource(source=r'E:\video.avi', format="YUV420P8")
ret = core.hist.Classic(ret)
ret.set_output()



https://github.com/dubhater/vapoursynth-histogram/blob/master/src/histogram.c#L11

poisondeathray
27th September 2015, 00:25
Thanks!

Maybe the wrong thread to make a suggestion, but for many new users, I think if some simple examples were given in the documentation it would help. Not everyone knows how to read from the code

Are_
27th September 2015, 01:17
Certainly. Anyway, when documentation is too vague or nonexistent you can use this script:
import os
import vapoursynth as vs


core = vs.get_core()

filepath = "/path/to/somewhere"
filename = "vs_function_list.txt"

info = core.list_functions()

fn = os.path.join(filepath, filename)

os.remove(fn) if os.path.exists(fn) else None

with open(fn, 'a') as f:
for line in info:
f.write(line)

It will write a file you can search for reference on namespaces an function names.
From that file:
name: VapourSynth Histogram Plugin
namespace: hist
identifier: com.nodame.histogram
Classic(clip:clip)
Color(clip:clip)
Color2(clip:clip)
Levels(clip:clip; factor:float:opt)
Luma(clip:clip)

jackoneill
27th September 2015, 09:48
Thanks!

Maybe the wrong thread to make a suggestion, but for many new users, I think if some simple examples were given in the documentation it would help. Not everyone knows how to read from the code

I updated the documentation.

poisondeathray
27th September 2015, 15:35
Thanks guys