Re-reading a specific frame using VideoReader returns inconsistent frames
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!