hi
I have writtring a script that convert a set of BMPs to avi. up until recently it worked fine. now I get this wierd error "Failed to write stream data". I get it after converting 5 libraries of bmps to avi. It runs over librarirs of BMPs and convert each library to avi. each time it stacks in the 6th movie.. there are no corrupts files in the 6th library. any idea why?
this is the code:
%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