Video Processing is easy to process on Matlab but more memory needed.So videos are converted into Frames then apply all Image Processing techniques. here we give some example of video processing approach.In below we give matlab example for read avi files and converted into JPG Frames from avi file.
Code :
filename = "input.avi";
file=aviinfo(filename); % to get inforamtaion abt video file frm_cnt=file.NumFrames % No.of frames in the video file
h = waitbar(0,'Please wait...');
for i=1:frm_cnt
frm(i)=aviread(filename,i); % read the Video file
frm_name=frame2im(frm(i)); % Convert Frame to image file
filename1=strcat(strcat(num2str(i)),str2);
imwrite(frm_name,filename1); % Write image file
waitbar(i/frm_cnt,h)
end
close(h)
This code extract the video frames on current directory.
Related Search : Matlab Video Processing : Read Avi File , Matlab convert video into JPG Frames,Matlab read avi files examples,Matlab extract frames from video example code.
You can use the Matlab VideoUtils toolbox:
ReplyDeletehttp://sourceforge.net/projects/videoutils/
It is very easy to use.