Thread Subject: Extracting frames from very large AVI file

Subject: Extracting frames from very large AVI file

From: Nathan

Date: 13 Aug, 2009 04:15:03

Message: 1 of 2

Hello. I need to extract all of the fames from a very large AVI file in order to do analysis. The largest video is 8 GB. I have been unable to extract the frames because the computer runs out of memory. I have been able to do 1 GB videos, however. I use
the mmreader function and create an array of the entire video as shown below. Is there a better way to do this?

This is the beginning of my program, I then use vidFrames and take each image array from it one by one.

readerobj = mmreader('cam1.avi');
       % Read in all video frames.
       vidFrames = read(readerobj);
 
       % Get the number of frames.
       numFrames = get(readerobj, 'numberOfFrames');

Subject: Extracting frames from very large AVI file

From: Nick Haddad

Date: 13 Aug, 2009 14:35:10

Message: 2 of 2

Nathan,

Since the files are so large I would recommend changing your algorithm
to work on single frames or a set of frames. You can then use
mmreader's read function in a loop:

readerobj = mmreader('cam1.avi');

for ii=1:readerobj.NumberOfFrames
     % read in a single frame
     currentFrame = read(readerobj, ii);

     % Insert algorithm here
end



-Nick

Nathan wrote:
> Hello. I need to extract all of the fames from a very large AVI file in order to do analysis. The largest video is 8 GB. I have been unable to extract the frames because the computer runs out of memory. I have been able to do 1 GB videos, however. I use
> the mmreader function and create an array of the entire video as shown below. Is there a better way to do this?
>
> This is the beginning of my program, I then use vidFrames and take each image array from it one by one.
>
> readerobj = mmreader('cam1.avi');
> % Read in all video frames.
> vidFrames = read(readerobj);
>
> % Get the number of frames.
> numFrames = get(readerobj, 'numberOfFrames');

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
getframe Sprinceana 13 Aug, 2009 01:48:40
reference Sprinceana 13 Aug, 2009 01:48:40
rssFeed for this Thread

Contact us at files@mathworks.com