diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-01-30 23:24:20 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-01-30 23:24:20 +0100 |
commit | 4162e9b2720d58df5d19a29f91d5c26034fa7aa0 (patch) | |
tree | 6cfe02f7781686fc908820a11d07dd895d5c5f63 | |
parent | 33ed64355f0e1147aece724bee2be07616ebddff (diff) |
Remove dependency on sibs for building
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | build.sh | 8 | ||||
-rwxr-xr-x | interactive.sh | 2 | ||||
-rwxr-xr-x | replay.sh | 2 | ||||
-rwxr-xr-x | twitch-stream-local-copy.sh | 2 | ||||
-rwxr-xr-x | twitch-stream.sh | 2 |
7 files changed, 18 insertions, 5 deletions
@@ -3,4 +3,9 @@ sibs-build/ compile_commands.json tests/sibs-build/ tests/compile_commands.json + .clangd/ + +main.o +sound.o +gpu-screen-recorder @@ -15,7 +15,7 @@ When recording a 4k game, fps drops from 30 to 7 when using OBS Studio, however the fps remains at 30. # Installation -gpu screen recorder can be built using [sibs](https://git.dec05eba.com/sibs) or if you are running Arch Linux, then you can find it on aur under the name gpu-screen-recorder-git (`yay -S gpu-screen-recorder-git`).\ +Run `./build.sh` or if you are running Arch Linux, then you can find gpu screen recorder on aur under the name gpu-screen-recorder-git (`yay -S gpu-screen-recorder-git`).\ Recording monitors requires a gpu with NvFBC support (note: this is not required when recording a single window!). Normally only tesla and quadro gpus support this, but by using [nvidia-patch](https://github.com/keylase/nvidia-patch) or [nvlax](https://github.com/illnyang/nvlax) you can do this on all gpus that support nvenc as well (gpus as old as the nvidia 600 series), provided you are not using outdated gpu drivers. # How to use diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..ee1e9b3 --- /dev/null +++ b/build.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e + +dependencies="glew libavcodec libavformat libavutil x11 xcomposite glfw3 libpulse-simple libswresample" +includes="$(pkg-config --cflags $dependencies) -I/opt/cuda/targets/x86_64-linux/include" +libs="$(pkg-config --libs $dependencies) /usr/lib/libcuda.so -ldl -pthread -lm" +g++ -c src/sound.cpp -O2 $includes -DPULSEAUDIO=1 +g++ -c src/main.cpp -O2 $includes -DPULSEAUDIO=1 +g++ -o gpu-screen-recorder -O2 sound.o main.o -s $libs diff --git a/interactive.sh b/interactive.sh index 425cd25..91ae9f7 100755 --- a/interactive.sh +++ b/interactive.sh @@ -29,4 +29,4 @@ read output_file_name output_dir=$(dirname "$output_file_name") mkdir -p "$output_dir" -./sibs-build/linux_x86_64/release/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 "$selected_audio_input" -o "$output_file_name" @@ -1,4 +1,4 @@ #!/bin/sh [ "$#" -ne 5 ] && echo "usage: replay.sh <window_id> <fps> <audio_input> <replay_time_sec> <output_file>" && exit 1 -./sibs-build/linux_x86_64/release/gpu-screen-recorder -w "$1" -c mp4 -f "$2" -a "$3" -r "$4" -o "$5" +./gpu-screen-recorder -w "$1" -c mp4 -f "$2" -a "$3" -r "$4" -o "$5" diff --git a/twitch-stream-local-copy.sh b/twitch-stream-local-copy.sh index 8101bbc..fb7dfbb 100755 --- a/twitch-stream-local-copy.sh +++ b/twitch-stream-local-copy.sh @@ -3,4 +3,4 @@ # Stream on twitch while also saving the video to disk locally [ "$#" -ne 5 ] && echo "usage: twitch-stream-local-copy.sh <window_id> <fps> <audio_input> <livestream_key> <local_file>" && exit 1 -./sibs-build/linux_x86_64/release/gpu-screen-recorder -w "$1" -c flv -f "$2" -a "$3" | tee -- "$5" | ffmpeg -i pipe:0 -c:v copy -f flv -- "rtmp://live.twitch.tv/app/$4" +./gpu-screen-recorder -w "$1" -c flv -f "$2" -a "$3" | tee -- "$5" | ffmpeg -i pipe:0 -c:v copy -f flv -- "rtmp://live.twitch.tv/app/$4" diff --git a/twitch-stream.sh b/twitch-stream.sh index 325fd23..fac052b 100755 --- a/twitch-stream.sh +++ b/twitch-stream.sh @@ -1,4 +1,4 @@ #!/bin/sh [ "$#" -ne 4 ] && echo "usage: twitch-stream.sh <window_id> <fps> <audio_input> <livestream_key>" && exit 1 -./sibs-build/linux_x86_64/release/gpu-screen-recorder -w "$1" -c flv -f "$2" -a "$3" | ffmpeg -i pipe:0 -c:v copy -f flv -- "rtmp://live.twitch.tv/app/$4" +./gpu-screen-recorder -w "$1" -c flv -f "$2" -a "$3" | ffmpeg -i pipe:0 -c:v copy -f flv -- "rtmp://live.twitch.tv/app/$4" |