aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-03-07 08:01:40 -0300
committerEuAndreh <eu@euandre.org>2025-03-07 08:04:36 -0300
commitc70a8436a538b303aa8d9abd3d26d93513a4dfac (patch)
tree019a994f7907953fbb52856a84ac78380c657394
parentrm bin/record-my-screen (diff)
downloaddotfiles-c70a8436a538b303aa8d9abd3d26d93513a4dfac.tar.gz
dotfiles-c70a8436a538b303aa8d9abd3d26d93513a4dfac.tar.xz
bin/: Have video(1) for standalone screencasts and live(1) based on it
-rwxr-xr-xbin/live14
-rwxr-xr-xbin/video16
2 files changed, 17 insertions, 13 deletions
diff --git a/bin/live b/bin/live
index afe2623..f452144 100755
--- a/bin/live
+++ b/bin/live
@@ -5,16 +5,4 @@ DIR="live/data/$(timestamp)"/"$(now)"
mkdir -p "$DIR"
cd "$DIR"
-BT="$(pacmd ls | awk '/^Default sink name: / && $0 = $4')"
-
-COMPATOPTS='-codec:v libx264 -profile:v baseline -level 4 -pix_fmt yuv420p -preset veryfast -codec:a aac'
-QUIETOPTS='-hide_banner -loglevel warning'
-
-ffmpeg \
- -f x11grab -probesize 10M -i "$DISPLAY" \
- -f pulse -guess_layout_max 0 -i "$BT".monitor \
- -f pulse -guess_layout_max 0 -i default \
- -filter_complex '[1][2]amix' -ac 2 \
- $QUIETOPTS \
- $COMPATOPTS \
- -f dash live.mpd
+exec video -f dash live.mpd
diff --git a/bin/video b/bin/video
new file mode 100755
index 0000000..bf1de92
--- /dev/null
+++ b/bin/video
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -eu
+
+BT="$(pacmd ls | awk '/^Default sink name: / && $0 = $4')"
+
+COMPATOPTS='-codec:v libx264 -profile:v baseline -level 4 -pix_fmt yuv420p -preset veryfast -codec:a aac'
+QUIETOPTS='-hide_banner -loglevel warning'
+
+exec ffmpeg \
+ -f x11grab -probesize 10M -i "$DISPLAY" \
+ -f pulse -guess_layout_max 0 -i "$BT".monitor \
+ -f pulse -guess_layout_max 0 -i default \
+ -filter_complex '[1][2]amix' -ac 2 \
+ $QUIETOPTS \
+ $COMPATOPTS \
+ "$@"