From c70c0c18bd57bc139b993c2fdf09055cf8f0acda Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 24 Jan 2024 21:05:04 +0100 Subject: Add example scripts to save recording in application specific directory --- scripts/record-application-name.sh | 5 +++++ scripts/replay-application-name.sh | 5 +++++ scripts/replay.sh | 2 +- scripts/start-replay.sh | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 scripts/record-application-name.sh create mode 100755 scripts/replay-application-name.sh diff --git a/scripts/record-application-name.sh b/scripts/record-application-name.sh new file mode 100755 index 0000000..723d067 --- /dev/null +++ b/scripts/record-application-name.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +window=$(xdotool selectwindow) +window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game") +gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -o "$HOME/Videos/recording/$window_name/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")" diff --git a/scripts/replay-application-name.sh b/scripts/replay-application-name.sh new file mode 100755 index 0000000..ada517c --- /dev/null +++ b/scripts/replay-application-name.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +window=$(xdotool selectwindow) +window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game") +gpu-screen-recorder -w screen -f 60 -c mkv -a "$(pactl get-default-sink).monitor" -r 60 -o "$HOME/Videos/replay/$window_name" diff --git a/scripts/replay.sh b/scripts/replay.sh index cf6c494..2781e1e 100755 --- a/scripts/replay.sh +++ b/scripts/replay.sh @@ -3,4 +3,4 @@ [ "$#" -ne 4 ] && echo "usage: replay.sh " && exit 1 active_sink="$(pactl get-default-sink).monitor" mkdir -p "$4" -gpu-screen-recorder -w "$1" -c mp4 -f "$2" -a "$active_sink" -r "$3" -o "$4" +gpu-screen-recorder -w "$1" -c mkv -f "$2" -a "$active_sink" -r "$3" -o "$4" diff --git a/scripts/start-replay.sh b/scripts/start-replay.sh index 29ff67a..e36d59d 100755 --- a/scripts/start-replay.sh +++ b/scripts/start-replay.sh @@ -2,4 +2,4 @@ video_path="$HOME/Videos" mkdir -p "$video_path" -gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -c mp4 -r 30 -o "$video_path" +gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -c mkv -r 30 -o "$video_path" -- cgit v1.2.3