divide the multiple frames

sir,
In the movie file consists the 498 frames i process the all frames for my project gone for out of memory so that i would like to process only the 7multiples of frames. my doubt is regards how to taken the all multiples of 7 frames in the loop format
i did
readerobj = mmreader('dec.wmv');
frame = read(readerobj,inf);
y=readerobj.NumberOfFrames;
for loop=1:y
loop=loop+7;
Image = read( readerobj,loop);
but its not taken the 7 multiples of frame how to resolve it

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 1 月 21 日
編集済み: Walter Roberson 2013 年 1 月 21 日

0 投票

for loop=1:7:y
Images = read( readerobj,[loop loop+6]);

5 件のコメント

ajith
ajith 2013 年 1 月 21 日
y =498
for loop=1:7:y
Images = read( readerobj,[loop]);
shows the error ??? The frame index requested is beyond the end of the file.
Error in ==> mmreader.read at 74 videoFrames = read(getImpl(obj), index);
Error in ==> mainfunctionclc at 17 Image = read( readerobj,[loop]);
how to resolve the error sir
Walter Roberson
Walter Roberson 2013 年 1 月 21 日
Is your dec.wmv file a Variable Frame Rate? Are you getting warnings about it being variable frame rate, or is readerobj.NumberOfFrames returning reasonable values?
ajith
ajith 2013 年 1 月 28 日
yes sir shows the reasonable value as 498
Walter Roberson
Walter Roberson 2013 年 1 月 28 日
Try
for loop = 480:498
fprintf('about to try frame %d\n', loop);
try
Images = read(readerobj, loop);
fprintf('got frame %d\n', loop);
catch ME
fprintf('problem on frame %d\n, loop);
end
end
and see how far it gets.
ajith
ajith 2013 年 1 月 29 日
Warning: Unable to determine the number of frames in this file.
about to try frame 480
got frame 480
upto 498 frames are processed sir but loop starts from 1 to 498 frames shows beyond the out of frames

サインインしてコメントする。

カテゴリ

質問済み:

2013 年 1 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by