How to rewind in VideoReader?
22 views (last 30 days)
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'); % Make a video object of an example video on everyone's path
iStop = ; % Stop the frame display if this is not empty
while hasFrame(vidObj) & isempty(iStop) % Loop through all frames
vidFrame = readFrame(vidObj);
iStop = input('0 to stop, return to continue ');