MATLAB provides algorithms and tools to process, analyze and interact with videos.
VideoReader lets you import videos into MATLAB. This function supports formats such as AVI, MPEG as well as platform specific formats for Windows, MAC and Linux.
A video is a set of images known as frames. It contains four dimensions i.e. 1st dimension is for the rows, the 2nd one is for the columns, 3rd is for the RGB channel representation and the other dimension also gets added called time or frame number.
Using a VideoReader object to read files containing video data. The object contains information about the video file and enables to read data from the video.
v = VideoReader(filename)
Using a VideoWriter object to create a video file. The object contains information about the video and the properties that control the output video. We can create a VideoWriter object using the VideoWriter function, specify its properties, and then write the video using object functions.
v = VideoWriter(filename)
Frame rate is defined as the number of frames per second or fps. It is the frequency (rate) at which consecutive images called frames to appear on a display.
To Reverse the video we reverse the frame rate.
- Load the video into a variable obj by using VideoReader.
- Create new variable and read the video present in the object(here obj).
- The rgb channels remains as it is.The frames are reversed and stored in new variable(here vid2).
- Use a new variable obj2 to create a new copy of this video which is appearing in reverse mode by using
- open obj2.
- Write all the reverse frames in obj2 using writeVideo()
- Close obj2.
Below is the implementation:
To get the link to input video, click here
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- MATLAB | Convert video into slow motion
- MATLAB | Convert a video to fast mode
- How to Extract Frames From a Video in MATLAB?
- Code Reverse Engineering - How To Reverse Engineer Your Expired Software
- Extract bit planes from an Image in Matlab
- Image Processing in MATLAB | Fundamental Operations
- MATLAB | RGB image representation
- MATLAB | RGB image to grayscale image conversion
- MATLAB | Complement colors in a Binary image
- MATLAB | Converting a Grayscale Image to Binary Image using Thresholding
- MATLAB | Complement colors in RGB Image
- MATLAB | Complement colors in a Grayscale Image
- Draw Switzerland Flag Using Matlab
- MATLAB | Display histogram of a grayscale Image
- LSB based Image steganography using MATLAB
- Draw Sweden Flag using matlab
- How to draw Japan flag using MATLAB
- Draw Kuwait Flag using MATLAB
- Draw Sudan Flag using MATLAB
- Draw Indian Flag using matlab
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.