View Single Post
Old 26th February 2011, 16:59   #5  |  Link
um3k
Registered User
 
Join Date: May 2007
Posts: 220
Thanks, guys. I found a workaround on my own, simply resizing to the minimum (8 pixels), then using HorizontalReduceBy2 three times to get it down to 1 pixel. I'm sure it's nowhere near exact, but the results were satisfactory for my purposes. If you're interested, here's a peek:


Based on this website: http://moviebarcode.tumblr.com/

Script:
Code:
function MovieBarcode(clip src, int w, int h)
{
GScript("""
    src = src.ConvertToRGB24()
    comp = src.BlankClip(width=1, height=h)
    for(f=1,w,1)
    {
        fc = src.framecount
        cf = (fc / w) * f
        s = src.SelectEvery(fc, cf).BilinearResize(8, h).HorizontalReduceBy2().HorizontalReduceBy2().HorizontalReduceBy2()
        comp = StackHorizontal(comp, s)
    }
    return comp.Crop(1, 0, 0, 0).Trim(0,1)
""")
}
Thanks, Gavino, for GScript. I probably could have done this particular script with recursion, but the for loop was much more straightforward.

The movie is the one in my sig...
um3k is offline   Reply With Quote