Importing large .avi files into MATLAB

4 Ansichten (letzte 30 Tage)
Jason
Jason am 2 Dez. 2011
I am struggling to get a video imported into MATLAB with the error that "ran out of memory"
The video is just over 2000 frames and just over 1GB in size.
I have tried avireader and mmreader at no avail.
Can I import a large video into MATLAB frame-by-frame
  2 Kommentare
Doug Hull
Doug Hull am 2 Dez. 2011
Edited to simplify question. Each question should be a single question. Ask another question for the other aspects.
Jason Ross
Jason Ross am 2 Dez. 2011
Also, details of the hardware (specifically the amount of RAM) and OS bit-ness (32 or 64 bit) would be helpful.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 2 Dez. 2011
You should be able to using the VideoReader class. Here's the example from the help:
Examples
Construct a VideoReader object for the demo movie file xylophone.mpg and view its properties:
xyloObj = VideoReader('xylophone.mpg', 'Tag', 'My reader object');
get(xyloObj)
Read and play back the movie file xylophone.mpg:
xyloObj = VideoReader('xylophone.mpg');
nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.Width;
% Preallocate movie structure.
mov(1:nFrames) = ...
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
'colormap', []);
% Read one frame at a time.
for k = 1 : nFrames
mov(k).cdata = read(xyloObj, k);
end
% Size a figure based on the video's width and height.
hf = figure;
set(hf, 'position', [150 150 vidWidth vidHeight])
% Play back the movie once at the video's frame rate.
movie(hf, mov, 1, xyloObj.FrameRate);
  2 Kommentare
Jason
Jason am 7 Dez. 2011
Thank you for your response.
VideoReader does not work for my version of MATLAB but mmreader will.
The problem I am still getting is that eventually I run out of memory.
Is there a way where you can read in one frame at a time, show that frame, then ask MATLAB to read in the next frame and replace the previous frame, thus making a movie this way?
Thank you
Jason
Andreas Goser
Andreas Goser am 7 Dez. 2011
We're talking about a 64 Bit system, right?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by