Large 400fps .avi files won't read using VideoReader
조회 수: 5 (최근 30일)
이전 댓글 표시
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?
답변 (1개)
Stefan Karlsson
2012년 12월 21일
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
Image Analyst
2012년 12월 23일
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!