Path: news.mathworks.com!not-for-mail
From: "Jimmy " <testbest1@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Creating a video help
Date: Sat, 13 Mar 2010 18:50:22 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 37
Message-ID: <hngmpe$95a$1@fred.mathworks.com>
Reply-To: "Jimmy " <testbest1@yahoo.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1268506222 9386 172.30.248.37 (13 Mar 2010 18:50:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 13 Mar 2010 18:50:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1991178
Xref: news.mathworks.com comp.soft-sys.matlab:616562


    Hi everyone, 
I'm trying to create a video from a set of images. I've tried different codes but it doesn't seem that any of them is working very well. Has anyone already done that and can help me? Here is the last code that I use, it is creating a video but after that it doesn't run smooth, I mean it jumps over the images at a certain points and I don't what it is related to. Here it is:  

fileFolder = fullfile('C:\Users\Dimitar\Documents\MATLAB\Plot');
path=fullfile(fileFolder,'data*.tif');
dirOutput = dir(path);
fileNames ={dirOutput.name};
numFrames = numel(fileNames);
I = imread(fullfile(fileFolder,fileNames{+1}));
rmax=size(I,1);
cmax=size(I,2);


sequence = zeros([size(I,1) size(I,2) 3 numFrames], class(I));

% load in array

for p = 1:numFrames
  sequence(:,:,:,p) = imread(fullfile(fileFolder,fileNames{p}));
end


mov = avifile('test.avi','Compression','None','fps',8);

for j=1:size(sequence,4)
    imshow(sequence(:,:,:,j));
    f=getframe;
    mov = addframe(mov, f);
end

mov = close(mov);
close all;

 Please let me know if any of you has already solved that.
 
       Thank you
        Jimmy