Created
August 6, 2015 13:11
-
-
Save saevarb/9449a4ed6e540c8040c0 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
#!/usr/bin/env bash | |
# This will not work with set -e because killing ffmpeg means whole script | |
# ends. | |
set -xuo pipefail | |
dorecord() { | |
local filename="$(date "+%F_%V_%H-%M-%S").webm" | |
local start="$(date "+%s")" | |
notify-send "Recording started.." | |
ffmpeg -f x11grab -s 1366x768 -an -i :0.0 -c:v libvpx -b:v 5M -crf 10 -quality realtime -y -loglevel quiet $filename | |
scp $filename vps:sbrg/screenshots/$filename | |
local end="$(date "+%s")" | |
echo "http://sbrg.me/screenshots/$filename" | xclip -i -sel clipboard | |
notify-send "Done recording after $((end-start)) seconds" | |
rm $filename | |
} | |
pidof ffmpeg && kill -SIGINT $(pidof ffmpeg) || dorecord |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment