MATLAB视频读取转换为图片
程序员文章站
2024-03-25 10:09:58
...
% convert .mp4 to jpg picture
input='srcinput.mp4';
v = VideoReader(input);
i = 1;
while 1
if ~hasFrame(v)
break;
end
frame = readFrame(v);
temp=strcat('jpg\',num2str(i),'.','jpg');
imwrite(frame,temp);
i = i+1;
end
%end