mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Fix systemd service file
This commit is contained in:
@@ -94,7 +94,7 @@ When compiling GPU Screen Recorder with portal support (`-Dportal=true`, which i
|
|||||||
# How to use
|
# How to use
|
||||||
Run `gpu-screen-recorder --help` to see all options and also examples.
|
Run `gpu-screen-recorder --help` to see all options and also examples.
|
||||||
## Recording
|
## Recording
|
||||||
Here is an example of how to record your monitor and the default audio output: `gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -o ~/Videos/test_video.mp4`.
|
Here is an example of how to record your monitor and the default audio output: `gpu-screen-recorder -w screen -f 60 -a default_output -o ~/Videos/test_video.mp4`.
|
||||||
Yyou can stop and save the recording with `Ctrl+C` or by running `killall -SIGINT gpu-screen-recorder`.
|
Yyou can stop and save the recording with `Ctrl+C` or by running `killall -SIGINT gpu-screen-recorder`.
|
||||||
You can see a list of monitor names to record if you use an invalid monitor name, for example: `gpu-screen-recorder -w invalid -f 60 -o video.mp4`.
|
You can see a list of monitor names to record if you use an invalid monitor name, for example: `gpu-screen-recorder -w invalid -f 60 -o video.mp4`.
|
||||||
## Streaming
|
## Streaming
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ CONTAINER=mp4
|
|||||||
QUALITY=very_high
|
QUALITY=very_high
|
||||||
CODEC=h264
|
CODEC=h264
|
||||||
AUDIO_CODEC=opus
|
AUDIO_CODEC=opus
|
||||||
AUDIO_DEVICE=alsa_output.pci-0000_0a_00.4.iec958-stereo.monitor
|
AUDIO_DEVICE=default_output
|
||||||
SECONDARY_AUDIO_DEVICE=alsa_input.some-mic.mono-fallback
|
SECONDARY_AUDIO_DEVICE=default_input
|
||||||
FRAMERATE=60
|
FRAMERATE=60
|
||||||
REPLAYDURATION=60
|
REPLAYDURATION=60
|
||||||
OUTPUTDIR=/run/media/dec05eba/SSD1TB/Videos/aaaa
|
OUTPUTDIR=/run/media/dec05eba/SSD1TB/Videos/aaaa
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Environment=CONTAINER=mp4
|
|||||||
Environment=QUALITY=very_high
|
Environment=QUALITY=very_high
|
||||||
Environment=CODEC=auto
|
Environment=CODEC=auto
|
||||||
Environment=AUDIO_CODEC=opus
|
Environment=AUDIO_CODEC=opus
|
||||||
Environment=AUDIO_DEVICE=
|
Environment=AUDIO_DEVICE=default_output
|
||||||
Environment=SECONDARY_AUDIO_DEVICE=
|
Environment=SECONDARY_AUDIO_DEVICE=
|
||||||
Environment=FRAMERATE=60
|
Environment=FRAMERATE=60
|
||||||
Environment=REPLAYDURATION=30
|
Environment=REPLAYDURATION=30
|
||||||
@@ -18,7 +18,8 @@ Environment=COLOR_RANGE=limited
|
|||||||
Environment=KEYINT=2
|
Environment=KEYINT=2
|
||||||
Environment=ENCODER=gpu
|
Environment=ENCODER=gpu
|
||||||
Environment=RESTORE_PORTAL_SESSION=yes
|
Environment=RESTORE_PORTAL_SESSION=yes
|
||||||
ExecStart=/bin/sh -c 'AUDIO="${AUDIO_DEVICE:-$(pactl get-default-sink).monitor}"; gpu-screen-recorder -v no -w "$WINDOW" -c "$CONTAINER" -q "$QUALITY" -k "$CODEC" -ac "$AUDIO_CODEC" -a "$AUDIO" -a "$SECONDARY_AUDIO_DEVICE" -f "$FRAMERATE" -r "$REPLAYDURATION" -o "$OUTPUTDIR" -df "$MAKEFOLDERS" $ADDITIONAL_ARGS -cr "$COLOR_RANGE" -keyint "$KEYINT" -restore-portal-session "$RESTORE_PORTAL_SESSION" -encoder "$ENCODER"'
|
Environment=ADDITIONAL_ARGS=
|
||||||
|
ExecStart=gpu-screen-recorder -v no -w "${WINDOW}" -c "${CONTAINER}" -q "${QUALITY}" -k "${CODEC}" -ac "${AUDIO_CODEC}" -a "${AUDIO_DEVICE}" -a "${SECONDARY_AUDIO_DEVICE}" -f "${FRAMERATE}" -r "${REPLAYDURATION}" -o "${OUTPUTDIR}" -df "${MAKEFOLDERS}" $ADDITIONAL_ARGS -cr "${COLOR_RANGE}" -keyint "${KEYINT}" -restore-portal-session "${RESTORE_PORTAL_SESSION}" -encoder "${ENCODER}"
|
||||||
KillSignal=SIGINT
|
KillSignal=SIGINT
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5s
|
RestartSec=5s
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
selected_audio_input="$(pactl get-default-sink).monitor"
|
|
||||||
|
|
||||||
echo "Select a window to record"
|
echo "Select a window to record"
|
||||||
window_id=$(xdotool selectwindow)
|
window_id=$(xdotool selectwindow)
|
||||||
|
|
||||||
@@ -14,4 +12,4 @@ read output_file_name
|
|||||||
output_dir=$(dirname "$output_file_name")
|
output_dir=$(dirname "$output_file_name")
|
||||||
mkdir -p "$output_dir"
|
mkdir -p "$output_dir"
|
||||||
|
|
||||||
gpu-screen-recorder -w "$window_id" -c mp4 -f "$fps" -a "$selected_audio_input" -o "$output_file_name"
|
gpu-screen-recorder -w "$window_id" -c mp4 -f "$fps" -a default_output -o "$output_file_name"
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
window=$(xdotool selectwindow)
|
window=$(xdotool selectwindow)
|
||||||
window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "Game")
|
window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "Game")
|
||||||
window_name="$(echo "$window_name" | tr '/\\' '_')"
|
window_name="$(echo "$window_name" | tr '/\\' '_')"
|
||||||
gpu-screen-recorder -w "$window" -f 60 -a "$(pactl get-default-sink).monitor" -o "$HOME/Videos/recording/$window_name/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
|
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")"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# This script should be passed to gpu-screen-recorder with the -sc option, for example:
|
# This script should be passed to gpu-screen-recorder with the -sc option, for example:
|
||||||
# gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -r 60 -sc scripts/record-save-application-name.sh -c mp4 -o "$HOME/Videos"
|
# 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=$(xdotool getwindowfocus)
|
||||||
window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "Game")
|
window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "Game")
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
window=$(xdotool selectwindow)
|
window=$(xdotool selectwindow)
|
||||||
window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "Game")
|
window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "Game")
|
||||||
window_name="$(echo "$window_name" | tr '/\\' '_')"
|
window_name="$(echo "$window_name" | tr '/\\' '_')"
|
||||||
gpu-screen-recorder -w "$window" -f 60 -c mkv -a "$(pactl get-default-sink).monitor" -r 60 -o "$HOME/Videos/Replays/$window_name"
|
gpu-screen-recorder -w "$window" -f 60 -c mkv -a default_output -r 60 -o "$HOME/Videos/Replays/$window_name"
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
pidof -q gpu-screen-recorder && exit 1
|
pidof -q gpu-screen-recorder && exit 1
|
||||||
video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
|
video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
|
||||||
gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -o "$video"
|
gpu-screen-recorder -w screen -f 60 -a default_output -o "$video"
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
pidof -q gpu-screen-recorder && exit 1
|
pidof -q gpu-screen-recorder && exit 1
|
||||||
video_path="$HOME/Videos"
|
video_path="$HOME/Videos"
|
||||||
mkdir -p "$video_path"
|
mkdir -p "$video_path"
|
||||||
gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -c mkv -r 30 -o "$video_path"
|
gpu-screen-recorder -w screen -f 60 -a default_output -c mkv -r 30 -o "$video_path"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
killall -SIGINT gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low 'GPU Screen Recorder' 'Stopped recording' && exit 0;
|
killall -SIGINT gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low 'GPU Screen Recorder' 'Stopped recording' && exit 0;
|
||||||
window=$(xdotool selectwindow)
|
window=$(xdotool selectwindow)
|
||||||
active_sink="$(pactl get-default-sink).monitor"
|
active_sink=default_output
|
||||||
mkdir -p "$HOME/Videos"
|
mkdir -p "$HOME/Videos"
|
||||||
video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
|
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"
|
notify-send -t 1500 -u low 'GPU Screen Recorder' "Started recording video to $video"
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
# Stream on twitch while also saving the video to disk locally
|
# 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
|
[ "$#" -ne 4 ] && echo "usage: twitch-stream-local-copy.sh <window_id> <fps> <livestream_key> <local_file>" && exit 1
|
||||||
active_sink="$(pactl get-default-sink).monitor"
|
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"
|
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"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ "$#" -ne 3 ] && echo "usage: twitch-stream.sh <window_id> <fps> <livestream_key>" && exit 1
|
[ "$#" -ne 3 ] && echo "usage: twitch-stream.sh <window_id> <fps> <livestream_key>" && exit 1
|
||||||
active_sink="$(pactl get-default-sink).monitor"
|
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"
|
gpu-screen-recorder -w "$1" -c flv -f "$2" -q high -a "$active_sink" -o "rtmp://live.twitch.tv/app/$3"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ "$#" -ne 3 ] && echo "usage: youtube-hls-stream.sh <window_id> <fps> <livestream_key>" && exit 1
|
[ "$#" -ne 3 ] && echo "usage: youtube-hls-stream.sh <window_id> <fps> <livestream_key>" && exit 1
|
||||||
active_sink="$(pactl get-default-sink).monitor"
|
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©=0&file=stream.m3u8"
|
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©=0&file=stream.m3u8"
|
||||||
10
src/main.cpp
10
src/main.cpp
@@ -1049,11 +1049,11 @@ static void usage_full() {
|
|||||||
fprintf(stderr, " Send signal SIGUSR2 to gpu-screen-recorder (killall -SIGUSR2 gpu-screen-recorder) to pause/unpause recording. Only applicable and useful when recording (not streaming nor replay).\n");
|
fprintf(stderr, " Send signal SIGUSR2 to gpu-screen-recorder (killall -SIGUSR2 gpu-screen-recorder) to pause/unpause recording. Only applicable and useful when recording (not streaming nor replay).\n");
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
fprintf(stderr, "EXAMPLES:\n");
|
fprintf(stderr, "EXAMPLES:\n");
|
||||||
fprintf(stderr, " %s -w screen -f 60 -a \"$(pactl get-default-sink).monitor\" -o \"$HOME/Videos/video.mp4\"\n", program_name);
|
fprintf(stderr, " %s -w screen -f 60 -a default_output -o \"$HOME/Videos/video.mp4\"\n", program_name);
|
||||||
fprintf(stderr, " %s -w screen -f 60 -a \"$(pactl get-default-sink).monitor|$(pactl get-default-source)\" -o \"$HOME/Videos/video.mp4\"\n", program_name);
|
fprintf(stderr, " %s -w screen -f 60 -a \"default_output|default_input\" -o \"$HOME/Videos/video.mp4\"\n", program_name);
|
||||||
fprintf(stderr, " %s -w screen -f 60 -a \"$(pactl get-default-sink).monitor\" -c mkv -r 60 -o \"$HOME/Videos\"\n", program_name);
|
fprintf(stderr, " %s -w screen -f 60 -a default_output -c mkv -r 60 -o \"$HOME/Videos\"\n", program_name);
|
||||||
fprintf(stderr, " %s -w screen -f 60 -a \"$(pactl get-default-sink).monitor\" -c mkv -sc script.sh -r 60 -o \"$HOME/Videos\"\n", program_name);
|
fprintf(stderr, " %s -w screen -f 60 -a default_output -c mkv -sc script.sh -r 60 -o \"$HOME/Videos\"\n", program_name);
|
||||||
fprintf(stderr, " %s -w portal -f 60 -a \"$(pactl get-default-sink).monitor\" -restore-portal-session yes -o \"$HOME/Videos/video.mp4\"\n", program_name);
|
fprintf(stderr, " %s -w portal -f 60 -a default_output -restore-portal-session yes -o \"$HOME/Videos/video.mp4\"\n", program_name);
|
||||||
//fprintf(stderr, " gpu-screen-recorder -w screen -f 60 -q ultra -pixfmt yuv444 -o video.mp4\n");
|
//fprintf(stderr, " gpu-screen-recorder -w screen -f 60 -q ultra -pixfmt yuv444 -o video.mp4\n");
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user