I have this repeal here and in this repeal, I have this mean that's why file, which is empty and this
video that MP for File, if you click vets rebels should normally be able to place if you click here.
So this is a three seconds long video.
It just a simple video, it doesn't have all do, and we don't need the old, you know, video processing
could involve different activities such as you could extract frames.
So to take individual images out of that video, you could resize the video, etc. And for each of these
processing activities, you first need to know some basic information about the video.
For example, if you want to recite the video from 180 pixels, you want to first know the resolution,
so you want to get the information that this video is actually 180 pixels.
So in this lecture, we're going to extract via Python the resolution of the video.
In other words, the width so the number of pixels horizontally and the height, the number of pixels
vertically, that's the resolution.
We're also going to extract the number of frames, the total number of frames, because a video basically
is just a bunch of images which the video player is stacking on top of each other, and it just shows
one image after the other.
Very quickly, and we see that video and each video has a number of images and also a video has frames
per second, which is also related to the number of frames.
So if this video is three seconds and the video has 90 images and 90 frames in total, that means this
video has 30 frames per second.
So let's see how we can load this video in open TV and then print out those pieces of information.
So video would be a variable key to that.
VIDEO Capture video capture is the class which expects as argument either the webcam source if we were
using the webcam, but that's not the case here.
The webcam you could define, it's either by zero if you want the main webcam of your computer or one
if you want the secondary webcam, depending on how many webcams you have.
So zero or one for webcam, for video files you do VIDEO That's MP for the path to your file and then
you could get different.
Parameters from your video, such as.
Servitude that kept.
Prop frame would.
So that's a property of Creta.
And if you supply this property to the gets methods and the get method points to the video object.
That entire thing will give you the width.
So let's test its print with.
And that's the the ultimate silver width of this video is one, nine 20.
So I would like to add something here.
And indeed, since later on this number, we're going to need it as an integer.
And similarly, you can get behind.
VIDEO that get quite to do it.
Cap prop frame height.
Then the number of frames you can get to if we do not get to that cap prop frame count.
And lastly, FP s, which stands from frames per second, is video dots.
Get to that cap prop FP s and let's print all of them all to your height.
Number of frames and fires run heights.
Oh, I have a typo.
And as a result.
So the width.
The hides, which also makes the resolution of the video advanced the resolution of video.
90 frames in total make of that video, 30 frames per second.
So the video is three seconds in total, 30 times three makes 90.
So now that we have these four pieces of information, we can go ahead and perform other actions, specifically
in the next video.
We're going to get all the frames over 90 frames over the video and save each of them as a JPEG image
file.
So see you there.