【发布时间】:2014-02-21 06:31:31
【问题描述】:
在这里,我正在尝试将图像帧转换为视频。图像帧包含在文件夹“folder_1”中。每当我尝试运行它时,我都会收到错误消息:''RIFF' 没有按预期出现'。下面是代码。这里可能有什么问题?是的,图像采用高动态范围格式。
files = dir('folder_1');
aviobj = avifile('a.avi'); %creating a movie object
for i=1:numel(files) %number of images to be read
a = hdrread(file(i));
a = uint8(a);%convert the images into unit8 type
M = im2frame(a);%convert the images into frames
aviobj = addframe(aviobj,M);%add the frames to the avi object created previously
fprintf('adding frame = %i\n', i);
end
disp('Closing movie file...')
aviobj = close(aviobj);
disp('Playing movie file...')
implay('a.avi');
【问题讨论】:
-
平台和版本?
-
Matlab R2013a 学生版
-
尝试
videowriter而不是avifile。另外,您能否确认错误发生在什么时候?在尝试创建对象时?在添加框架?在关闭对象?只有当你尝试播放它?如果是最后一个,如果在 MATLAB 之外打开 *.avi 可以播放吗?