aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-03-22 13:04:08 +0100
committerdec05eba <dec05eba@protonmail.com>2022-03-22 13:04:08 +0100
commitd4bc7b420ec258040f8f36234d7f2b08f2dd1c38 (patch)
treebc063a403164937959f1ccce678739dab33eae46
parentf81bdfb29e2747c39c982a9f4cbbdaa830c2560a (diff)
Add script to record the selected window (with the active audio device)
-rw-r--r--TODO1
-rw-r--r--project.conf2
-rwxr-xr-xrecord-selected.sh8
3 files changed, 10 insertions, 1 deletions
diff --git a/TODO b/TODO
index f276aa8..f2abf1c 100644
--- a/TODO
+++ b/TODO
@@ -2,6 +2,7 @@ Check for reparent.
Only add window to list if its the window is a topmost window.
Use nvEncoder api directly? maybe with this we could copy the window opengl texture directly to the gpu which doesn't work right now for some reason.
Right now we are required to copy the opengl texture to another opengl texture first.
+ nvEncRegisterResource allows registering an opengl texture directly with NV_ENC_INPUT_RESOURCE_OPENGL_TEX and using that directly in the encoding.
Load cuda at runtime with dlopen.
Track window damages and only update then. That is better for output file size.
Remove cuda to cuda copy when using nvFBC if possible. ffmpeg is getting in the way.
diff --git a/project.conf b/project.conf
index 882e1d5..03c74fb 100644
--- a/project.conf
+++ b/project.conf
@@ -6,7 +6,7 @@ platforms = ["posix"]
[config]
include_dirs = ["/opt/cuda/targets/x86_64-linux/include"]
-libs = ["/usr/lib/libcuda.so"]
+libs = ["/usr/lib64/libcuda.so"]
[define]
PULSEAUDIO = "1"
diff --git a/record-selected.sh b/record-selected.sh
new file mode 100755
index 0000000..5782ac3
--- /dev/null
+++ b/record-selected.sh
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+window=$(xdotool selectwindow)
+active_sink="$(pactl get-default-sink).monitor"
+mkdir -p "$HOME/Videos"
+video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
+gpu-screen-recorder -w "$window" -c mp4 -f 60 -a "${active_sink}.monitor" -o "$video"
+notify-send "GPU Screen Recorder" "Saved video to $video"