Video Processing
Read a video
This first example is opening an AVI video file, and displaying the different frames compisong the video:
n = aviopen(fullpath(getIPCVpath() + "/images/video.avi")); im = avireadframe(n); //get a frame imshow(im); aviclose(n); |
Create a video from images
This second example is displaying how to create a video based on several photos:
im = imread(fullpath(getIPCVpath() + "/images/puffin.png")); n = avifile('puffin.avi', [300;300], 30,'xvid'); for ii=1:100 ims = im(ii:192-ii, ii:161-ii, :); addframe(n, ims); end aviclose(n);
The function avifile creates a video
--> n = avifile('puffin.avi', [300;300], 30,'xvid'); Following file has been created for saving video. Filename : puffin.avi Size : [300,300] FPS : 30
and the functions aviaddframe is adding frame to this video.