out of Memory ,when reading a video of 22 seconds

2 Ansichten (letzte 30 Tage)
Gova ReDDy
Gova ReDDy am 20 Nov. 2011
Hi..Im extracting frames from a video. Previously I extracted frames from a 5 seconds video clip and when Im trying to extract from a 22 seconds video clip using * aviread* it is showing error as *out of memory *.
How to solve this problem?
  2 Kommentare
Jan
Jan am 20 Nov. 2011
Well, do the data of 22 sec match into the available RAM? Is it really necessary to keep all these frames at the same time in the memory?
Gova ReDDy
Gova ReDDy am 20 Nov. 2011
only one frame is saved at a time using a loop as shown below
folder = fullfile('D:\videofiles\framesNEW');
movieFullFileName = fullfile(folder, 'video.avi');
movieInfo = aviinfo(movieFullFileName);
mov = aviread(movieFullFileName);
numberOfFrames = size(mov, 2);
[folder, baseFileName, extentions] = fileparts(movieFullFileName);
folder = pwd;
outputFolder = sprintf('%s/Frames%s', folder, baseFileName);
mkdir(outputFolder);
for frame =1:numberOfFrames
here I'm extracting each frame and saving it
end;

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 20 Nov. 2011
Use the VideoReader class and the read() function to pull out just one frame at a time rather than a call to aviread() to suck up the whole thing at once, which you apparently cannot do due to memory limitations. I'm not sure what version VideoReader was introduced in but I have it in R2011a.
  1 Kommentar
Gova ReDDy
Gova ReDDy am 21 Nov. 2011
Same probelm is existing even Im using mmreader also.Im having R2008a.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by