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 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 |