summaryrefslogtreecommitdiff
path: root/.old/screenrec
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2024-11-17 23:34:54 -0600
committerTim Keller <tjkeller.xyz>2024-11-17 23:34:54 -0600
commit09ada24d4ec23cf24ab136141b354953d1bbc2fa (patch)
tree2c41e87c71ad3f3cd67a8bea0c1413efbab4087d /.old/screenrec
parent090a3a31683eb08b91351e4d1508a0a73a310a38 (diff)
downloadscripts-09ada24d4ec23cf24ab136141b354953d1bbc2fa.tar.xz
scripts-09ada24d4ec23cf24ab136141b354953d1bbc2fa.zip
reorganize scripts
Diffstat (limited to '.old/screenrec')
-rwxr-xr-x.old/screenrec24
1 files changed, 24 insertions, 0 deletions
diff --git a/.old/screenrec b/.old/screenrec
new file mode 100755
index 0000000..8f65514
--- /dev/null
+++ b/.old/screenrec
@@ -0,0 +1,24 @@
+#!/bin/sh
+newname() { defname="video"; name=$defname`ls | grep "^$defname[0-9]*" | wc -l | tr -d '[:blank:]'`.mkv; }
+[ -z "$1" ] && newname || name="$1"
+# Get screen info. I suspect this script wouldn't work too well with multiple screens. Somebody else can add that
+resinfo="$(xrandr | grep '*' | tr -s ' ')"
+vs="$(echo "$resinfo" | cut -d' ' -f2)"
+fr="$(echo "$resinfo" | sed 's/.*\s\([0-9]*\.[0-9]*\)\*.*/\1/')"
+# -i is screen coordinates for top-leftmost screen
+# Encoder settings are basically lossless and optimized for good speed, decent size, and great quality
+# yuv444p colorspace is needed for a 24 bit rgb monitor, change for hdr. yuv420p is the default and is good for video, but is inadequate for screencasts
+ffmpeg -hide_banner \
+ -video_size $vs \
+ -framerate $fr \
+ -f x11grab \
+ -i :0.0+0,0 \
+ -f alsa -channels 1 -sample_rate 48000 \
+ -i hw:3 \
+ -c:v libx264 \
+ -c:a libopus \
+ -b:a 128k \
+ -preset ultrafast \
+ -qp 1 \
+ -pix_fmt yuv444p \
+ "$name"