This commit is contained in:
2025-12-28 13:55:10 -08:00
commit 9b4219aa67
131 changed files with 32853 additions and 0 deletions

15
scripts/interactive.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh -e
echo "Select a window to record"
window_id=$(xdotool selectwindow)
echo -n "Enter video fps: "
read fps
echo -n "Enter output file name: "
read output_file_name
output_dir=$(dirname "$output_file_name")
mkdir -p "$output_dir"
gpu-screen-recorder -w "$window_id" -c mp4 -f "$fps" -a default_output -o "$output_file_name"

3
scripts/list-sinks.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
pactl list | grep -E '(Description: Monitor of)|(Monitor Source: )'

View File

@ -0,0 +1,6 @@
#!/bin/sh
window=$(xdotool selectwindow)
window_name=$(xdotool getwindowname "$window" || xdotool getwindowclassname "$window" || echo "Game")
window_name="$(echo "$window_name" | tr '/\\' '_')"
gpu-screen-recorder -w "$window" -f 60 -a default_output -o "$HOME/Videos/recording/$window_name/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"

View File

@ -0,0 +1,14 @@
#!/bin/sh
# This script should be passed to gpu-screen-recorder with the -sc option, for example:
# gpu-screen-recorder -w screen -f 60 -a default_output -r 60 -sc scripts/record-save-application-name.sh -c mp4 -o "$HOME/Videos"
window=$(xdotool getwindowfocus)
window_name=$(xdotool getwindowname "$window" || xdotool getwindowclassname "$window" || echo "Game")
window_name="$(echo "$window_name" | tr '/\\' '_')"
video_dir="$HOME/Videos/Replays/$window_name"
mkdir -p "$video_dir"
video="$video_dir/$(date +"${window_name}_%Y-%m-%d_%H-%M-%S.mp4")"
mv "$1" "$video"
sleep 0.5 && notify-send -t 2000 -u low "GPU Screen Recorder" "Replay saved to $video"

View File

@ -0,0 +1,6 @@
#!/bin/sh
window=$(xdotool selectwindow)
window_name=$(xdotool getwindowname "$window" || xdotool getwindowclassname "$window" || echo "Game")
window_name="$(echo "$window_name" | tr '/\\' '_')"
gpu-screen-recorder -w "$window" -f 60 -c mkv -a default_output -bm cbr -q 40000 -r 60 -o "$HOME/Videos/Replays/$window_name"

3
scripts/save-recording.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
killall -SIGINT gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low "GPU Screen Recorder" "Recording saved"

3
scripts/save-replay.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh -e
killall -SIGUSR1 gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low -- "GPU Screen Recorder" "Replay saved"

5
scripts/start-recording.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
pidof -q gpu-screen-recorder && exit 0
video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
gpu-screen-recorder -w screen -f 60 -a default_output -o "$video"

6
scripts/start-replay.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
pidof -q gpu-screen-recorder && exit 0
video_path="$HOME/Videos"
mkdir -p "$video_path"
gpu-screen-recorder -w screen -f 60 -a default_output -c mkv -bm cbr -q 40000 -r 30 -o "$video_path"

10
scripts/start-stop-recording.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Simple script to start recording if it's not recording and stop recording
# if it's already recording. This script can be bound to a single hotkey
# to start/stop recording with a single hotkey.
killall -SIGINT -q gpu-screen-recorder && exit 0
video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
gpu-screen-recorder -w screen -f 60 -a default_output -o "$video"
notify-send -t 2000 -u low "GPU Screen Recorder" "Video saved to $video"

3
scripts/stop-replay.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
killall -SIGINT gpu-screen-recorder

View File

@ -0,0 +1,9 @@
#!/bin/sh -e
killall -SIGINT gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low 'GPU Screen Recorder' 'Stopped recording' && exit 0;
window=$(xdotool selectwindow)
active_sink=default_output
mkdir -p "$HOME/Videos"
video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
notify-send -t 1500 -u low 'GPU Screen Recorder' "Started recording video to $video"
gpu-screen-recorder -w "$window" -c mp4 -f 60 -a "$active_sink" -o "$video"

6
scripts/toggle-recording.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh -e
killall -SIGINT gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low 'GPU Screen Recorder' 'Stopped recording' && exit 0;
video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
notify-send -t 1500 -u low 'GPU Screen Recorder' "Started recording video to $video"
gpu-screen-recorder -w screen -f 60 -a "default_output" -o "$video"

View File

@ -0,0 +1,7 @@
#!/bin/sh
# Stream on twitch while also saving the video to disk locally
[ "$#" -ne 4 ] && echo "usage: twitch-stream-local-copy.sh <window_id> <fps> <livestream_key> <local_file>" && exit 1
active_sink=default_output
gpu-screen-recorder -w "$1" -c flv -f "$2" -q high -a "$active_sink" | tee -- "$4" | ffmpeg -i pipe:0 -c copy -f flv -- "rtmp://live.twitch.tv/app/$3"

5
scripts/twitch-stream.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
[ "$#" -ne 3 ] && echo "usage: twitch-stream.sh <window_id> <fps> <livestream_key>" && exit 1
active_sink=default_output
gpu-screen-recorder -w "$1" -c flv -f "$2" -q high -a "$active_sink" -o "rtmp://live.twitch.tv/app/$3"

5
scripts/youtube-hls-stream.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
[ "$#" -ne 3 ] && echo "usage: youtube-hls-stream.sh <window_id> <fps> <livestream_key>" && exit 1
active_sink=default_output
gpu-screen-recorder -w "$1" -c hls -f "$2" -q high -a "$active_sink" -ac aac -o "https://a.upload.youtube.com/http_upload_hls?cid=$3&copy=0&file=stream.m3u8"