Let's now see how to take a video from the terminal with the Raspberry Pi camera.
And this one is going to be quite easy if you understood how to take a photo.
While taking a video is not going to be that much different.
So we had the RPI cam and then Dash still for the photo.
Well, for the video we have RPI cam, Dash V and then the same thing as before.
If we want to actually save the video in a file, we need to provide the output with dash o.
I'm going to go inside the camera and then name it uh, video tests for example dots.
And I'm going to use the MP4 extension okay.
So that's going to be a video file right.
So RPI cam video with Dash oh option for output.
And we provide an MP4 extension for the file.
Let's press enter.
Let's run that.
So it's going to open a preview.
And and what you see what I can put my hand I can do some movement.
We have something that should be saved in the camera folder.
Yes.
So I can play that one.
It's going to be for five seconds.
Okay.
So it's moving because my table was moving.
But okay.
You can see it's working once again.
You can see the well it's upside down.
So I can use the same option as before.
I'm going to play it again.
And I can use the v flip and H flip to do a vertical flip and a horizontal flip.
So let's run that.
Okay.
And now you see the camera is correctly orientated.
And we can see that on the file as well.
If I play the video okay it's working well.
And now if you want you can also modify the resolution with the same options that we had before.
So if I come back to the previous command, you see, we have the dash dash width with a number and
then dash dash height with a number.
You can use the same for the camera, but here actually we might not even need to because well let's
look at the logs.
That's a lot of logs okay.
But okay.
The information is in a few places.
But you can see for example here we have the while the video stream that's with this resolution okay
640 times 480.
So that's 480 P.
That's the default resolution for the camera.
It can't go higher okay.
So it can go higher.
But the default is that one.
So it's already quite small okay.
So if you want you can increase actually the width and the height.
So you can increase the resolution with those two parameters.
But here I'm going to keep it like this because we have for example for five seconds we have just 500kB.
That's quite small okay.
And in the end you don't need actually for many applications you don't need a high resolution.
You might need that.
You need a high resolution.
But high resolution is needed for like for example, if you want to shot a movie or a video that people
are going to watch.
But anything that you use for, let's say, a security camera or even to do image processing, if you
want to recognize a face or some object, you actually don't need a high resolution.
Okay, so 400 and ATP, I would recommend to well, if it's the default one, just don't change it.
That's probably going to be enough.
And just one last thing.
So here the video where I told you it's going to take a five seconds video.
If you want to modify this you can add a dash T.
So that's going to be only one dash here.
Dash T.
And then you need to provide a milliseconds.
So for example if you want seven seconds that's going to be 7000 milliseconds okay.
So you add a dash t here.
You can add a dash T before okay.
The order of the parameters here is not important.
So let's press enter.
It's going to take a video for seven seconds.
All right.
So let's wait a bit.
And now we have a new file.
And it's going to be seven.
So it shows six.
But it's it's going to be seven.
All right.
And you might wonder why we have only one dash here and two dashes here.
Actually all the commands have two dashes.
For example that one is dash dash output.
But for some options there is a kind of a shortcut.
So usually you have the full word like this.
And then the shortcut is just dash o which basically means dash dash output.
And the same for dash T I think the full name is going to be dash dash timeout.
Okay.
But you can replace with dash T.
So sometimes you have the option sometimes not.
All right.
And now you know how to take a photo and a video from the terminal.