Book Image

Raspberry Pi Essentials

By : Jack Creasey
Book Image

Raspberry Pi Essentials

By: Jack Creasey

Overview of this book

Table of Contents (15 chapters)
Raspberry Pi Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Project 1 – Running raspivid as a background service


Let's set up raspivid so that, as it runs in the background, we can simply send a message to the process to stop or start video acquisition. This setup can also work for taking snapshot still images with raspistill too.

The script we will create allows you to easily control rapsivid from the command line. The command line in the script that instantiates the raspivid process looks like this:

sudo raspivid -w 800 -h 600 -i pause -n -o /media/data/video/test%03d.h264 -sg 10000 -s -t 0 &

Code

Description

raspivid

This could also be raspistill or raspiyuv with different options. For more details, visit

http://www.raspberrypi.org/documentation/usage/camera/raspicam/README.md.

-w 800
-h 600

This sets the height and width of the captured image.

-i pause

This starts the playback in a paused state.

-n

This sets the no-preview window. If you want preview, you can remove this flag and add either –f for a fullscreen preview or the ...