Showing specific frame in a video file
38 views (last 30 days)
Show older comments
Sushil Chaskar
on 23 Sep 2015
Commented: Walter Roberson
on 24 Sep 2015
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.
0 Comments
Accepted Answer
Walter Roberson
on 23 Sep 2015
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
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!