I'd say this is a problem with the AFX, not with the AVS. Mind making the overlay.avi available?
On another note, that AVS contains a few weirdnesses. First of all, there's a syntax error on line 1, where it says
Code:
function insertclip(clip clip1, clip clip2, int framebefore, int {
- the last parameter should be "int frameafter)".
Second, I'd use Overlay() instead of Layer(). It means slightly more typing since you need to explictly tell it to use the alpha channel as a mask, but it avoids converting back and forth between YV12 and RGB32. Not that anyone would notice, but anyway...
(the Overlay() equivalent of what you have there would be:
Code:
Overlay(middle, clip2, mask=clip2.showalpha())
# note: "middle" does not need to be RGB32, and the output colorspace will whatever middle was
)