Recording a video with the RPi camera

Now that we know how to take a picture with the RPi camera, let's look at how to record video with it. The command for recording a video clip is as follows:

raspivid -o video1.h264 -t 5000 

The preceding command doesn't yield any output, as shown in the following screenshot:

In our command, we used raspivid to record the video and named it video1. We recorded the video in the h264 format. The number 5000 represents 5,000 milliseconds, that is, we recorded a 5-second video. You can open the pi folder and double-click on the video file to open it:

Now that we know how to take a picture and record a video, ...

Get Hands-On Robotics Programming with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.