How to Extract Frames From a Video in MATLAB? Last Updated : 20 Aug, 2020 Improve Improve Like Article Like Save Share Report Let us see how to extract frames from a video in MATLAB. Approach : Import the video which is to be converted into frames into the current matlab environment. Extract the total number of frames in the video. Make an empty directory named frames before the execution. Run a for loop and start extracting the frames into the directory. In our demonstration, we shall consider the following video : https://media.geeksforgeeks.org/wp-content/uploads/20200724085331/org.mp4 % import the video file obj = VideoReader('org.mp4'); vid = read(obj); % read the total number of frames frames = obj.NumberOfFrames; % file format of the frames to be saved in ST ='.jpg'; % reading and writing the frames for x = 1 : frames % converting integer to string Sx = num2str(x); % concatenating 2 strings Strc = strcat(Sx, ST); Vid = vid(:, :, :, x); cd frames % exporting the frames imwrite(Vid, Strc); cd .. end Output : The frames directory will look something like this : Images saved in the frames folder Like Article Suggest improvement Next How To Create Video From An Image Using MATLAB? Share your thoughts in the comments Add Your Comment Please Login to comment... Similar Reads How to extract numbers from cell array in MATLAB? Extract Subsets of Consecutive Entries in a Matrix in MATLAB Extract bit planes from an Image in Matlab MATLAB | Convert video into slow motion MATLAB | Convert a video to fast mode Reverse Video in Matlab How To Create Video From An Image Using MATLAB? How To Add Subtitle To Video in MATLAB? How To Create Video From Sequence of Images Using MATLAB? Python Regex to extract maximum numeric value from a string Like N nithinviswakarma0010 Follow Article Tags : MATLAB Algorithms Computer Subject DSA MATLAB Practice Tags : Algorithms