Problem with a conversion into avi file
17 views (last 30 days)
Hi,I want to convert a stored images to avi file but when i run my code i get this error: Frames of type double must be in the range 0 to 1. Can anyone help me to solve the problem? Thanks in advance.
writerObj = VideoWriter('Uncompressed AVI.avi'); writerObj.FrameRate = 10;
[m n number]=size(sub_movie); %the images are stored in sub_movie for k = 1:number frame = sub_movie(:,:,k); writeVideo(writerObj,frame); end close(writerObj);
Ben11 on 20 Aug 2014
You just need to convert sub_movie(:,:,k) to a double before exporting. For example:
for k = 1:number
writeVideo(writerObj,double(sub_movie(:,:,k))/65536); % store as 16-bit data (2^16 = 65536).