WEBVTT

00:00.110 --> 00:05.390
Let's now see how to take a video from the terminal with the Raspberry Pi camera.

00:05.390 --> 00:08.660
And this one is going to be quite easy if you understood how to take a photo.

00:08.690 --> 00:11.870
While taking a video is not going to be that much different.

00:11.870 --> 00:17.300
So we had the RPI cam and then Dash still for the photo.

00:17.330 --> 00:23.690
Well, for the video we have RPI cam, Dash V and then the same thing as before.

00:23.690 --> 00:31.820
If we want to actually save the video in a file, we need to provide the output with dash o.

00:31.880 --> 00:39.860
I'm going to go inside the camera and then name it uh, video tests for example dots.

00:39.860 --> 00:42.530
And I'm going to use the MP4 extension okay.

00:42.560 --> 00:44.720
So that's going to be a video file right.

00:44.750 --> 00:49.160
So RPI cam video with Dash oh option for output.

00:49.160 --> 00:53.000
And we provide an MP4 extension for the file.

00:53.000 --> 00:54.320
Let's press enter.

00:54.320 --> 00:54.980
Let's run that.

00:54.980 --> 00:56.510
So it's going to open a preview.

00:56.510 --> 01:01.860
And and what you see what I can put my hand I can do some movement.

01:01.860 --> 01:05.730
We have something that should be saved in the camera folder.

01:05.760 --> 01:06.300
Yes.

01:06.300 --> 01:08.220
So I can play that one.

01:09.570 --> 01:11.280
It's going to be for five seconds.

01:11.730 --> 01:11.940
Okay.

01:11.970 --> 01:14.160
So it's moving because my table was moving.

01:14.160 --> 01:15.900
But okay.

01:15.930 --> 01:18.690
You can see it's working once again.

01:18.720 --> 01:21.990
You can see the well it's upside down.

01:25.110 --> 01:28.320
So I can use the same option as before.

01:29.130 --> 01:30.420
I'm going to play it again.

01:30.420 --> 01:39.330
And I can use the v flip and H flip to do a vertical flip and a horizontal flip.

01:39.330 --> 01:41.400
So let's run that.

01:43.470 --> 01:43.980
Okay.

01:43.980 --> 01:48.840
And now you see the camera is correctly orientated.

01:49.020 --> 01:51.960
And we can see that on the file as well.

01:52.890 --> 01:56.580
If I play the video okay it's working well.

01:56.580 --> 02:02.650
And now if you want you can also modify the resolution with the same options that we had before.

02:02.680 --> 02:08.710
So if I come back to the previous command, you see, we have the dash dash width with a number and

02:08.710 --> 02:10.810
then dash dash height with a number.

02:10.810 --> 02:16.780
You can use the same for the camera, but here actually we might not even need to because well let's

02:16.780 --> 02:17.890
look at the logs.

02:17.890 --> 02:19.330
That's a lot of logs okay.

02:19.330 --> 02:20.560
But okay.

02:20.590 --> 02:22.900
The information is in a few places.

02:22.900 --> 02:29.800
But you can see for example here we have the while the video stream that's with this resolution okay

02:29.830 --> 02:32.650
640 times 480.

02:32.680 --> 02:34.270
So that's 480 P.

02:34.270 --> 02:37.360
That's the default resolution for the camera.

02:37.360 --> 02:38.830
It can't go higher okay.

02:38.860 --> 02:39.970
So it can go higher.

02:39.970 --> 02:41.620
But the default is that one.

02:41.620 --> 02:43.990
So it's already quite small okay.

02:44.020 --> 02:47.710
So if you want you can increase actually the width and the height.

02:47.710 --> 02:51.850
So you can increase the resolution with those two parameters.

02:51.850 --> 02:57.400
But here I'm going to keep it like this because we have for example for five seconds we have just 500kB.

02:57.400 --> 02:58.750
That's quite small okay.

02:58.780 --> 03:03.740
And in the end you don't need actually for many applications you don't need a high resolution.

03:03.740 --> 03:04.490
You might need that.

03:04.490 --> 03:05.690
You need a high resolution.

03:05.690 --> 03:11.930
But high resolution is needed for like for example, if you want to shot a movie or a video that people

03:11.930 --> 03:12.740
are going to watch.

03:12.740 --> 03:19.040
But anything that you use for, let's say, a security camera or even to do image processing, if you

03:19.040 --> 03:24.440
want to recognize a face or some object, you actually don't need a high resolution.

03:24.470 --> 03:31.430
Okay, so 400 and ATP, I would recommend to well, if it's the default one, just don't change it.

03:31.490 --> 03:33.260
That's probably going to be enough.

03:33.260 --> 03:34.520
And just one last thing.

03:34.520 --> 03:40.010
So here the video where I told you it's going to take a five seconds video.

03:40.010 --> 03:43.580
If you want to modify this you can add a dash T.

03:43.610 --> 03:45.650
So that's going to be only one dash here.

03:45.650 --> 03:46.340
Dash T.

03:46.340 --> 03:49.640
And then you need to provide a milliseconds.

03:49.640 --> 03:56.330
So for example if you want seven seconds that's going to be 7000 milliseconds okay.

03:56.330 --> 03:57.830
So you add a dash t here.

03:57.830 --> 03:59.990
You can add a dash T before okay.

04:00.020 --> 04:02.780
The order of the parameters here is not important.

04:02.790 --> 04:04.320
So let's press enter.

04:04.350 --> 04:07.440
It's going to take a video for seven seconds.

04:08.760 --> 04:09.060
All right.

04:09.060 --> 04:10.800
So let's wait a bit.

04:12.330 --> 04:15.450
And now we have a new file.

04:15.450 --> 04:17.460
And it's going to be seven.

04:18.810 --> 04:19.830
So it shows six.

04:19.830 --> 04:21.840
But it's it's going to be seven.

04:22.320 --> 04:23.010
All right.

04:23.610 --> 04:27.450
And you might wonder why we have only one dash here and two dashes here.

04:27.480 --> 04:31.350
Actually all the commands have two dashes.

04:31.830 --> 04:35.490
For example that one is dash dash output.

04:35.490 --> 04:38.880
But for some options there is a kind of a shortcut.

04:38.880 --> 04:41.760
So usually you have the full word like this.

04:41.760 --> 04:46.770
And then the shortcut is just dash o which basically means dash dash output.

04:46.770 --> 04:53.640
And the same for dash T I think the full name is going to be dash dash timeout.

04:54.570 --> 04:55.140
Okay.

04:55.170 --> 04:56.880
But you can replace with dash T.

04:56.910 --> 04:59.370
So sometimes you have the option sometimes not.

04:59.400 --> 04:59.850
All right.

04:59.880 --> 05:03.750
And now you know how to take a photo and a video from the terminal.
