MATLAB: How to convert a real time live video into frames sequentially

framesvideo processing

Should i put the code in infinite loop for continuous conversion?
is this code enough?
vreader = VideoReader(vidfile);
frames = 1:vreader.NumberOfFrames;
for f = frames
try
im = vreader.read(f);
catch err
<error processing>
end
<image processing>
end

Best Answer

Real-Time video does not know ahead of time how many frames will be present.
VideoReader is for reading from files, not for live video.