v = VideoWriter('Video_filename.avi');
open(v)
it looks like octave has started implementing a compatible VideoWriter class, but I don't know if its sufficiently compatible to work in this code. Did you try loading the video package to make the function available and see if you get any errors?
>> pkg load video
(I assume you have the package installed. You can check with "pkg list")