xxwhirlpool
·
2026-05-14
webcamimg
1#!/usr/bin/env bash
2
3# check if it's running anywhere else but laptop
4if [[ "$(hostname)" != "mariposa" ]]; then
5 echo "only works on your laptop, dumbass"
6 exit 1
7fi
8
9PICPATH="/home/kat/Pictures/Camera/webcam"
10
11# turn on webcam for a bit so the brightness isn't fucked
12echo "starting camera, wait 5s"
13timeout 5s v4l2-ctl --silent -d /dev/video0 -d0 --stream-mmap
14
15# take the pic
16echo "taking the pic!"
17ffmpeg -f video4linux2 -i /dev/video0 -vframes 5 -video_size 1920x1080 "$PICPATH/webcam_pic_$(today time)_%3d.jpeg" -hide_banner -loglevel error