It is difficult to answer the question without knowing what camera you are using, and what frame grabber you are acquiring the video with.
My best guess is that the video image is configured one or two pixels larger in the Y direction than will work. Each successive picture slides up a pixel or two to compensate. It probably ends up looking like an old TV would when the vertical hold wasn't working, and if you waited long enough it would probably come back to the original position.
My best guess for a solution to this problem would be trim the Y dimension of the acquired image (in MAX) by a couple of pixels.
If this doesn't work, describe your camera, frame grabber, and the problem in more detail. Does it happen in MAX as well as your program?
Bruce
Bruce Ammons
Ammons Engineering