Project 1a – Creating a Bash script to drive raspivid

In this project, we will use a small Bash shell script using the command line shown to instantiate raspivid as a root process. The script will only start raspivid if there is no instance already running, and it will start the process in a paused mode. Command-line parameters will let us start or pause recording and unload the process.

The following steps show you how to get started:

  1. Open File Manager and create a directory called camera in /home/pi for our work.
  2. Download the picam.sh file from the Chapter 3 folder at http://1drv.ms/1ysAxkl; make it executable and ensure that the owner is pi.
  3. Open picam.sh in the Leafpad editor.

The Bash script code for picam.sh is fully documented in the file; ...

Get Raspberry Pi Essentials 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.