Be a video star

Now that we know our camera module is working, we can try and capture some video. To do this, we'll use the raspivid utility. The following command will take 5 seconds of high-definition video and save the file to your Raspberry Pi:

$ raspivid –o test.h264 –t 5000

You'll notice that file is called test.h264—this is because the video is captured as a raw H.264 video stream. Unfortunately, not many media players will handle these files (although VLC player will—it rocks and handles practically anything you throw at it—get it on your PC at www.videolan.org).

If you want to play the file on smartphones and conventional media players, then we will need to wrap it in a container format, such as MPEG-4, and give the file a .mp4 extension. ...

Get Raspberry Pi: Amazing Projects from Scratch 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.