If I have read several frames in VideoReader, how can I rewind to the first frame? In this example, let's say I stop the replay after 5 frames (enter 0 when prompted at the 5th frame). After that I want to rewind to the 1st frame, for example if I want to display the first frame again. How do I rewind?
vidObj = VideoReader('xylophone.mp4');
iStop = [];
while hasFrame(vidObj) & isempty(iStop)
vidFrame = readFrame(vidObj);
imagesc(vidFrame);
iStop = input('0 to stop, return to continue ');
end
4 Comments
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349124
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349124
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349408
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349408
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349436
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349436
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349460
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/272386-how-to-rewind-in-videoreader#comment_349460
Sign in to comment.