Re-reading a specific frame using VideoReader returns inconsistent frames
显示 更早的评论
I'm using VideoReader on R2011a to read in a file that has a variable frame rate. My code looks something like this:
f = figure;
frameNum = 3600; %arbitrary frame number
for i = 1:100
mov(frameNum).cdata = read(vidObj, frameNum);
imagesc(mov(frameNum).cdata);
drawnow;
end
This code should read and display the same video frame over the 100 reads. However, when I run it, the picture moves - it does not grab the same frame every time. The read function appears to iterate on every call.
Is this expected behaviour? What can I do to counteract this and ensure that I am grabbing the same frame every time?
Thank you for your help.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!