How can I read a frame from a video?

>> M=mmreader('00097.avi');
for ii = 1:length(M)
oneFrame = read(M, ii);
end
imshow(oneFrame);xx=imread(oneFrame);
??? Error using ==> strfind
Input strings must have one row.
Error in ==> imread at 340
if (strfind(filename, '://'))

Answers (1)

imread() is used to read files, such as .jpg files, and it requires a filename as its argument. You are instead passing it the frame data array that you are getting back from the read() operation, which is already a decoded image.
and also pay attention to the way they figure out the number of frames there.

This question is closed.

Asked:

on 17 Mar 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!