Clear Filters
Clear Filters

Out of memory problem

1 view (last 30 days)
Pan
Pan on 12 Feb 2012
clear all
mov = aviread('book.avi');
xy=zeros(size(mov(1).cdata));
for i=1:196
figure(10)
xy(:,:,:,i)=mov(i).cdata;
imshow(uint8(xy(:,:,:,i)));
end
save book xy
when I read the file code,matlab will show this message
??? Out of memory. Type HELP MEMORY for your options.
Error in ==> framebook at 9
xy(:,:,:,i)=mov(i).cdata;

Accepted Answer

Walter Roberson
Walter Roberson on 12 Feb 2012
You can try using
xy=zeros([size(mov(1).cdata),length(mov)], 'uint8');
and change your imshow line to
imshow(xy(:,:,:,i));
Do not be surprised if this runs out of memory. Not matter how much memory you have, there will always be a movie large enough that you cannot make two fully-decompressed copies of it in memory.
What is it that you are going to do with your xy array? Is it certain that you cannot do the processing on the mov structure instead ?

More Answers (0)

Categories

Find more on Files and Folders in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!