フィルターのクリア

videoreader reads frames very slowly. how can I improve it?

7 ビュー (過去 30 日間)
nirit
nirit 2018 年 11 月 28 日
I have a movie, and selected list of frames (called frameNums) I want to read.
I tried reading them like this :
VR=VideoReader(aviFilename)
for t = 1:numel(frameNums)
currFrameNum = frameNums(t)
VR.read(currFrameNum)
%do something%
end
but this does not read the exact current frame at some of my movies (a probelm which sevral of others already noticed). so I switched to this:
VR=VideoReader(aviFilename)
videoFrameCount=0
for t = 1:numel(frameNums)
currFrameNum = frameNums(t)
while (hasFrame(VR) && (currFrameNum~=videoFrameCount))
CurrFrame = readFrame(VR);
videoFrameCount=videoFrameCount+1;
end
%do something%
end
which works out great, but if my first frame number is really big (like 22533) it takes forever to read the frame, and I cant work like that.
any tips of how to improve this?

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by