Search code examples
matlabvideosignal-processingpixelavi

Matlab: Creating a video using VideoWriter


How can I create an avi video in Matlab using the VideoWriter class, but defining its content pixel by pixel?

Having the original pixel by pixel, line by line information, is there any way to implement this on Videowriter when using open?


Solution

  • Use im2frame, something like

    myVideo  = VideoWriter('c:\temp\myVideo.avi');
    open(myVideo);
    writeVideo(myVideo ,im2frame(rand(20,20,3)));
    close(myVideo);