Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WebCam capture script for HAL9000 and save them to /home/
#!/bin/bash
# Check out https://www.raspberrypi.org/documentation/usage/webcams/ for more info
# on using webcams and installing necessary software on your raspberry PI.
IMAGE=/tmp/webcam.jpg
fswebcam \
-d /dev/video0 \
-p YUYV \
-r 1600x1200 \
--jpeg 85 \
-F 4 \
--set Gamma=4 \
--no-banner \
$IMAGE
TARGET_DIR="${HOME}/webcam"
if [ ! -d "$TARGET_DIR" ]; then
mkdir -p "$TARGET_DIR"
fi
cp $IMAGE $TARGET_DIR/$(date +\%Y\%m\%d\%H\%M).jpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.