damichi
20th January 2008, 23:39
Hallo.
I try to move an image overlay over a clip.
The image should move every frame, based on different coordinates, which are stored in an array.
I tried to use a recursive function to apply the overlay on every single frame, but there's no overlay in the output video.
When I write 6 ApplyRange statements instead of the recursive function call, the overlay is visible.
Could anyone please help me and tell me, why it doesn't work?
LoadLibrary("avslib", CONFIG_AVSLIB_ARRAYS)
global XKoordinaten = ArrayCreate(100, 200, 300, 400, 500, 600)
global YKoordinaten = ArrayCreate(150, 150, 150, 150, 150, 150)
global myVideo = AviSource("D:\vid\myVideo.avi")
global myOverlayImage = ImageSource("D:\vid\myOverlayImage.bmp")
function myOverlay(clip myVideo, clip myOverlayImage, int z)
{
Overlay(myVideo, myOverlayImage, x=ArrayGet(XKoordinaten, z), y=ArrayGet(YKoordinaten, z), opacity=0.5)
}
function doTheJob(int d)
{
myVideo
ApplyRange(last, d, d, "myOverlay", myOverlayImage, d)
(d < 5) ? doTheJob((d+1)) : ApplyRange(last, d, d, "myOverlay", myOverlayImage, (d-1))
}
doTheJob(0)
Thanks in advance.
damichi
I try to move an image overlay over a clip.
The image should move every frame, based on different coordinates, which are stored in an array.
I tried to use a recursive function to apply the overlay on every single frame, but there's no overlay in the output video.
When I write 6 ApplyRange statements instead of the recursive function call, the overlay is visible.
Could anyone please help me and tell me, why it doesn't work?
LoadLibrary("avslib", CONFIG_AVSLIB_ARRAYS)
global XKoordinaten = ArrayCreate(100, 200, 300, 400, 500, 600)
global YKoordinaten = ArrayCreate(150, 150, 150, 150, 150, 150)
global myVideo = AviSource("D:\vid\myVideo.avi")
global myOverlayImage = ImageSource("D:\vid\myOverlayImage.bmp")
function myOverlay(clip myVideo, clip myOverlayImage, int z)
{
Overlay(myVideo, myOverlayImage, x=ArrayGet(XKoordinaten, z), y=ArrayGet(YKoordinaten, z), opacity=0.5)
}
function doTheJob(int d)
{
myVideo
ApplyRange(last, d, d, "myOverlay", myOverlayImage, d)
(d < 5) ? doTheJob((d+1)) : ApplyRange(last, d, d, "myOverlay", myOverlayImage, (d-1))
}
doTheJob(0)
Thanks in advance.
damichi