我寫了一個腳本,將一組BMP轉換爲AVI。直到最近它工作正常。現在我得到這個奇怪的錯誤「無法寫入流數據」。我將5個bmp文件庫轉換爲avi後得到它。它運行在BMP的圖書館管理員並將每個圖書館轉換爲AVI。每次它在第6部電影中堆疊..第6部電影庫中沒有損壞的文件。任何想法爲什麼?無法寫入流數據,matlab
這是代碼:
%this works
clc
%path='C:/Documents and Settings/Ariel/Desktop/exp_brk_scrm/2.1/group1/exp_up/exp_up/4python/stims';
%FullPath=strcat(path,'/mov1.avi');
path4avi='G:/experiments/cfs3/building/Copy of StimBMP/avi/'; %dont forget the in the end of the path
pathOfFrames='G:/experiments/cfs3/building/Copy of StimBMP/stims/'; %here too
NumberOfFiles=70; %to be generated
NumberOfFrames=8; %in each avi file
for i=1:1:(NumberOfFiles)
FileName=strcat(path4avi,'Stim',int2str(i),'.avi') %the generated files
aviobj = avifile(FileName,'compression','None'); %due to changes in the new Media Players
aviobj.fps=10;%10 frames in Sec
for j=1:1:(NumberOfFrames)
Frame=strcat(pathOfFrames,'stim',int2str(i),'/stim',int2str(j),'.BMP') % the BMP's (not a good name for thedirectory)
%[Fa,map]=imread(Frame);
%imshow(Fa,map); %
[Fa,map]=imread(Frame);
imshow(Fa,map);
% imshow(Fa);
F=getframe();
aviobj=addframe(aviobj,F)
end
aviobj=close(aviobj);
end
是的。但除非您向我們展示一些代碼,否則我們不會告訴您。 – relet 2010-08-12 20:05:35
我相信你不需要'映射'BMP文件。 – yuk 2010-08-12 20:39:22
在imshow和imread中試圖用\沒有地圖的所有變化..問題依然存在 – ariel 2010-08-12 20:56:20