【发布时间】:2015-09-10 10:31:37
【问题描述】:
嗨,谁能告诉我我的 Matlab 代码将视频转换为帧序列有什么问题。它不起作用。
clc
clear all
close all
file=aviinfo('test.avi');
frm_cnt=file.NumFrames
FileExtension='.bmp'
h = waitbar(0,'Please wait');
for i=1:frm_cnt
% Read the Frame of the Video file
frm(i)=VIDEOREADER ('test1.avi',i);
% Convert Frame to image file
frm_name=frame2im(frm(i));
%Create Filename to store
Filename=strcat(strcat(num2str(i)),FileExtension);
% Write image file to the current folder
imwrite(frm_name,Filename);
waitbar(i/frm_cnt,h)
end
%Close Progress bar
close(h)
【问题讨论】:
-
怎么不行?你的电脑着火了?您收到错误消息?另外,您只需要定义 1 个
VideoReader对象 -
确定不想使用 FFMPEG?更好的工具。