Showing specific frame in a video file

38 views (last 30 days)
hey I am trying to show a particular frame from video . I did following but it is showing error : Expected outputformat to match one of these strings: 'native', 'default' The input did not match any of the valid strings. Caused by: Error using validatestring>checkString (line 86) Expected input to be one of these types: char Instead its type was double.
vid1=VideoReader('D:\DDP\TEST\new.avi');
numofFrames=vid1.NumberOfFrames;
image=readFrame(vid1,numofFrames/2);
imshow(image);
Can someone help what I am doing wrong. and value of numofFrames=511.

Accepted Answer

Walter Roberson
Walter Roberson on 23 Sep 2015
The deprecated method read() will accept an index.
readFrame() does not accept an index. The recommended interface is to set the currenttime property to the time corresponding to the frame and then readFrame from that. See http://www.mathworks.com/help/matlab/import_export/read-video-files.html
  7 Comments
Sushil Chaskar
Sushil Chaskar on 24 Sep 2015
Can you provide some links through which I can get the information?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!