Video compression of .avi video made by .png images using VideoWriter command

I have a question about a video I'm trying to make of pictures made in advance by Matlab. Before I run the code the pictures are already on my pc in .png format in the folder named myfolder in the code below. When I change the framerate to 1 I only get to see the PIlL004LE7_1V.png image(nothing changing in time) rather than all 53 images. When the framerate is for example 3 or 6 I get all 53 pictures(1200x900 pixels). Also I would like to know how to do a good compression. I thought there is a alread a compression by default, but the file is large(640mb) at rate 3 and (2.10Gb!) at rate 6. This is probably also because the whole sequence of 53 pictures is repeated about resp. 55 and 57times, why? Only displaying each voltage picture once for 1 sec would be sufficient. Thanks for your help, Antoine ____________________________________________________________________________________________________ myfolder = 'C:\Users\Antoine\Documents\AT\Bachelor opdracht\images\PILL004images\PILL004EL7\'; writerObj = VideoWriter('PILL004EL7video.avi') ext = {'1V','2V','3V','4V','5V','6V','7V',.....,'3V_c','4V_c','5V_c'}; % in total 53 images, each about 1285kB, 1200x900pixels writerObj.FrameRate = 1; writerObj.Quality = 80; open(writerObj) %axis tight; for framenumber = 1:length(pngfiles) for extra = 1:length(ext) fullFileName = sprintf('%sPILL004EL7_%s.png',myfolder,ext{extra}); thisimage = imread(fullFileName); writeVideo(writerObj,thisimage); end end close(writerObj);

Answers (0)

This question is closed.

Products

Asked:

on 2 Dec 2014

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!