Created
April 22, 2017 01:06
-
-
Save leafo/474cef17f6f0d6175bc3a723978fb6ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
rawdir="$1" | |
[ -z "$rawdir" ] && echo "missing dir" && exit | |
dir=$(cd "$rawdir" && pwd) | |
tmp=$(mktemp -d) | |
( | |
cd "$tmp" | |
ffmpeg -f v4l2 -s 640x480 -ss 00:00:3 -i /dev/video0 -vframes 1 -qscale:v 2 webcam.jpg | |
scrot -q 1 desktop.png | |
# composite | |
gm composite -gravity SouthEast -geometry +10+10 webcam.jpg desktop.png composite.png | |
ts=$(date +%s) | |
cp composite.png "$dir/$ts.png" | |
echo "Wrote " "$dir/$ts.png" | |
) | |
rm -r "$tmp" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment