Skip to content

Instantly share code, notes, and snippets.

@ArtBIT
Last active June 5, 2016 21:17
Show Gist options
  • Select an option

  • Save ArtBIT/7a1707496b7d4079473f69d8ec97c973 to your computer and use it in GitHub Desktop.

Select an option

Save ArtBIT/7a1707496b7d4079473f69d8ec97c973 to your computer and use it in GitHub Desktop.
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