global filename file_path  obj_numberofframe

file_name = strcat(pwd, '\videos\', filename,'.avi');
obj = VideoReader(file_name);
obj_numberofframe = obj.NumberOfFrames;

for k = 1:3:obj_numberofframe
frame = read(obj,k);
frameName = strcat(file_path,num2str(k),'.jpg');
imwrite(frame,frameName,'jpg');
end

for k = 2:3:obj_numberofframe
frame = read(obj,k);
frameName = strcat(file_path,num2str(k),'.jpg');
imwrite(frame,frameName,'jpg');
end

for k = 3:3:obj_numberofframe
frame = read(obj,k);
frameName = strcat(file_path,num2str(k),'.jpg');
imwrite(frame,frameName,'jpg');
end
