필터 지우기
필터 지우기

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 CenterFile Exchange에서 Audio 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