I tried to use ArrayOpArrayFunc of avslib (Avisynth plugin) to crop each frame differently based on the contents of an array.
I start with image files, say 20, build my arrays, and try to apply the filters, but I must make a mistake as I cannot get this to work. Any idea how to fix my script?
Import("C:\Program Files (x86)\AVSLib\avslib\loader.avsi")
Import("C:\Program Files (x86)\AVSLib\avslib\avslib.avsi")
LoadLibrary("avslib", CONFIG_AVSLIB_ARRAYS)
LoadModule("avslib", "base", "constants")
LoadModule("avslib", "filters", "frames")
dx001 = ArrayCreate(1250, 1250, 2110, 1250, 1250, 1250, 1250, 1250, 1250, 1250)
dx011 = ArrayCreate(1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250)
dx = dx001.ArrayInsRange(dx011)
dy001 = ArrayCreate(1300, 1300, 1300, 2000, 1300, 1300, 1300, 1300, 1300, 1300)
dy011 = ArrayCreate(1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300)
dy = dy001.ArrayInsRange(dy011)
FirstFrame = 1
LastFrame = 20
FrameRate = 25
function MyCrop(dx, dy, clip, w, h)
{
return Crop(clip, dx, dy, w, h)
}
Raw = ImageReader("GOPR%04d.JPG", FirstFrame, LastFrame, FrameRate)
Crop = ArrayOpArrayFunc(dx, dy, "MyCrop", "Raw,1600,1200")
BilinearResize(Crop, 800, 600)
The error message is 'I don't know what "Raw" means'.
The original images are 4000x3000, they need to be cropped variously (simplified version of the arrays above), then resized to final video format.