Hi,
As you know the indices of frames to mark, you can use readFrame function to read those frames from video and then use insertMarker function to add marker to the frame at specific position. If you want to add markers to frames with indices 2, 4 and 6, your code will look something like this:
v = VideoReader('xylophone.mp4');
markFrames = [2 4 6];
frameidx = 0;
videoPlayer = vision.VideoPlayer;
while hasFrame(v)
frame = readFrame(v);
frameidx = frameidx + 1;
if any(ismember(markFrames, frameidx))
markedFrame = insertMarker(frame, [50 50]);
videoPlayer(markedFrame);
else
videoPlayer(frame);
end
end
Hope this helps.
Best Answer