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!