2015-10-21-Matlab coding
[fname,pname]=uigetfile({'*.avi';'*.mp4'},'选择视频');
str=[pname fname];
video = VideoReader(str);
nFrames = video.NumberOfFrames;
vidHeight = video.Height;
vidWidth = video.Width;
T_frames=nFrames-1;
% Preallocate movie structure.
frame = struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),'colormap', []);
%read each frame in the video;
for i=1:T_frames
frame.cdata=read(video,i);
end
浙公网安备 33010602011771号