Large 400fps .avi files won't read using VideoReader

9 views (last 30 days)
I am trying to read in some uncompressed .avi files that are just under 4GB each (huge i know) because they are 400fps. I am inevitably having difficulty with the simplest of functions but don't understand what it is that's different from other video files (which i have managed to read in in the same way) apart from the size/fps.
This is the error message I get using VideoReader: "Error using VideoReader/init (line 447) Failed to initialize internal resources.
Error in VideoReader (line 132) obj.init(fileName);"
I'm not able to convert the files if it means compression as i need them raw and uncompressed. What might be the problem? Is it the size or possibly something simple and unrelated?
  3 Comments
Charlie
Charlie on 21 Dec 2012
i do have 64 bit Matlab but you might be right in that i need more memory i think its using a lot to do the full files.
Charlie
Charlie on 21 Dec 2012
oh and i'm on a mac, i dont know if that changes things

Sign in to comment.

Answers (1)

Stefan Karlsson
Stefan Karlsson on 21 Dec 2012
From your question it is not clear whether the problem is due to lack of memory access or because videoReader has problems opening the file due to its size or fps. If you post your code, it will clarify.
If you have a large amount of data to process, then dont read the full file into memory, but process it by blocks (frames are common block sizes for video).
first advice to you is this however. Compress the video using a lossless encoder. Let me recommend lagarith, as i have used it myself for scientific applications.
If the problem is somehow connected to the fps, then simply change it for your files. Use the program ffmpeg for this, has a great command line interface.
If the problem is the size of the video files (even more doubtful) use ffmpeg once more to split your files into smaller ones.
  7 Comments
Image Analyst
Image Analyst on 23 Dec 2012
The documentation lists this issue with variable frame rate videos: " Some files store video at a variable frame rate, including many Windows Media Video files. For these files, VideoReader cannot determine the number of frames until you read the last frame." I don't know why it can't read the last frame itself - heck, the help even gives you the code to do it yourself but I don't know why it VideoReader doesn't do it itself internally. Anyway if you do read the last frame, there's nothing in the help that mentions any kind of size limit on the video. The read() function takes a frame number but I'm not sure how it finds the start of a frame in the file when the frame rate is variable. Normally it might just do a fseek() to skip right to the start but with variable, I'm not sure how it would know where to fseek to. Maybe it has to scan the file somehow looking for some kind of "frame start indicators" and count them. Perhaps that's why it might need the whole file in memory at one time - I'm not sure.
Charlie
Charlie on 31 Dec 2012
Damn! My upgraded ram came today but I still cant run VideoReader on these files. Why would it work on one computer but not another? The other computer I used was also a mac but with better specs all around.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!