View Single Post
Old 3rd March 2017, 17:26   #7  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
I made a small revision; now each single bar is not a resized frame, but its average color; result is really similar, but now it's "smoother", and, when saved as image, takes a lot see space.

Code:
function MovieBarCode2(clip clip, int "w", int "h")
{
GScript("""
w=default(w,1280)	h=default(h,480)

	       clip.ConvertToYV24
    src  = mt_lutf(last, mode="avg", expr="x", u=3, v=3)
    comp = src.BlankClip(width=1, height=h)

    for(f=1,w,1)
    {
        fc   = src.framecount
        cf   = (fc / w) * f
        s    = src.SelectEvery(fc, cf).PointResize(1, h)
		comp = StackHorizontal(comp, s)
    }

    return comp.Crop(1, 0, 0, 0).Trim(0,-1)

""")

}
spoRv is offline   Reply With Quote