Handling large AVI videos
이전 댓글 표시
Im using MATLAB R2010b with Core2Duo 2.1GHz & 3 GB RAM. I need to analyse AVI videos frame-by-frame. Im using AVIREAD but it let's me read videos only upto 15 sec or 2-3 MB. How can I read larger videos into Frames ?
답변 (2개)
Jiro Doke
2011년 4월 7일
You say you need to analyze the video "frame-by-frame". That seems to indicate that you don't need to store all of the frames in memory at once. You can just do the processing one frame at a time and clear it as you move on to the next frame.
vid = VideoReader('video.avi');
for iFrame = 1:vid.NumberOfFrames
frame = read(vid, iFrame);
%
% analyze the frame
%
end
Walter Roberson
2011년 4월 6일
0 개 추천
2 - 3 Mb ? Ummm, how big are your frames and what frame rate are you using? I estimate 15 seconds at being roughly 400 megabyte at 24 frames per second of 768 x 512 with 3 bytes per pixel.
댓글 수: 5
Viraj Lad
2011년 4월 7일
Walter Roberson
2011년 4월 7일
What frame rates are the files? 20 seconds of 640 x 480 at 24 frames per second would exceed 400 megabytes.
Compression can have great deal to do with the size, especially if large portions of the background are static.
Are you using the 32 bit version of Matlab for Windows? If so then at the point where you would do the reading of the file, insert a call to memory() http://www.mathworks.com/help/techdoc/ref/memory.html to find out how much free memory you have available.
Viraj Lad
2011년 4월 7일
Walter Roberson
2011년 4월 7일
What does aviinfo() return for the file?
Walter Roberson
2011년 4월 7일
Also, to cross-check, did you invoke memory() at the command prompt, or did you put the call in right at the place the file would be read? To me the values look like what would be returned at the command prompt (unless your program did almost nothing before trying to read the file.)
카테고리
도움말 센터 및 File Exchange에서 Video Formats and Interfaces에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!