Playing back videos in MATLAB

Now that you know how to load a video, it is time to learn how to play it back. As you can recall, images can be displayed in an open figure, using imshow. However, playing back a movie is a slightly more complex process. The function that can be used for this process is called movie. This function takes the name of the variable as input, in which we have stored the video frames, and plays it back in the current axes (if there aren't any, it creates them). The process described has two issues; one is that the variable containing the video must be a movie struct (similar to the one generated by aviread) and the other is that the figure that will be used to display the movie must be resized to exactly fit the video dimensions. Otherwise, we may have a result that will include a visible white part of the axes apart from the video.

Movie can also use extra inputs that define playback details. More specifically, it can get the number of times the movie will be played, the order in which the frames will be displayed, and the frame rate. Let's see all of these with an example.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset