% Import video file
obj = VideoReader('D:\Spring 2022\MARS Capstone\Trimmed Videos\Reef 1\GH010063.MP4');
vid = read(obj);
% Read the total number of frames
frames = obj.NumFrames;
% File format of the frames to be saved
ST = ' .jpg';
% Reading and writing the frames
for x = 1 : frames
% Converting integers to string
Sx = num2str(x);
% Concatening 2 string
Strc = strcat(Sx, ST);
vid = vid(:, :, :, x);
% Exporting the frames
imwrite(vid, Strc);
end
this is a code i found online that helps me write the frames into images that I can use later but it stops because it needs 23.2 GB storage to run, so I wanted to reduce the number of frames that I pick up from this code.
