**MATLAB** also called Matrix Laboratory is a numerical computing environment and a platform for programming language. it was designed and developed by MathWorks. MATLAB is a framework that allows you to perform matrix manipulations, implementing algorithms, plotting functions and data, creating user-interfaces and interfacing with programs that are written in different programming languages i.e. C, C++, python, java etc.

**Video:**

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.

**Framerate:**

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 convert a video in slow motion we have the decrease framerate of the video.

**Approach: **

- Load the video into a variable obj by using
**VideoReader()** - Use a new variable obj2 to create a new copy of this video which is appearing in fast mode by using

**VideoWriter()** - decrease the framerate of the video.
- open
*obj2*. - read all the frames one by one from obj and store them into a variable k.
- Write all the frames in obj2 using
**writeVideo()** - Close
*obj2*.

To get the link to the input video, click here.

Below is the imnplementaions:

`% MATLAB program to convert video into slow motion ` `clc;clear;close all; ` ` ` ` ` `% load the video. ` `obj = VideoReader(` `'C:/Users/Gfg/Desktop/Sample1280.avi'` `); ` ` ` `% Write in new variable ` `obj2= VideoWriter(` `'xyz.avi'` `); ` ` ` `% decrease framerate ` `obj2.FrameRate = 10; ` `open(obj2); ` ` ` `% for reading frames one by one ` `while` `hasFrame(obj) ` ` ` `k = readFrame(obj); ` ` ` ` ` `% write the frames in obj2. ` ` ` `obj2.writeVideo(k); ` `end` ` ` `close(obj2); ` |

*chevron_right*

*filter_none*

**Output: **

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.

## Recommended Posts:

- How slow HTTP can knock down a server?
- Slow Start Backoff Algorithm for Ad-Hoc
- MATLAB | Convert a video to fast mode
- What is Motion UI?
- Reverse Video in Matlab
- How to Extract Frames From a Video in MATLAB?
- 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
- Difference Between MATLAB and Scilab
- How to draw Japan 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 contribute@geeksforgeeks.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.