commit c3cc6209122a049b20d4211fe43d390b5176a9a6 parent f46044b1bcd65772895736828c8454e690bc4f02 Author: dwrz <dwrz@dwrz.net> Date: Sat, 21 Oct 2023 20:53:26 +0000 Add screen-capture script Diffstat:
A | scripts/screen-capture | | | 20 | ++++++++++++++++++++ |
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/scripts/screen-capture b/scripts/screen-capture @@ -0,0 +1,20 @@ +#!/bin/sh + +readonly RESOLUTION="$(xrandr --current | grep '*' | uniq | awk '{print $1}')" +readonly OUTPUT="file:$(date '+%Y-%m-%dT%H:%M:%S%:z').mp4" + +if [ "$1" = "audio" ]; then + >&2 echo "capturing audio" + + ffmpeg -video_size "${RESOLUTION}" \ + -f x11grab \ + -i :0.0 \ + -f pulse \ + -ac 2 \ + -i default \ + "${OUTPUT}" +else + >&2 echo "not capturing audio" + + ffmpeg -video_size "${RESOLUTION}" -f x11grab -i :0.0 "${OUTPUT}" +fi