diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-07-05 18:57:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-07-05 18:57:06 +0200 |
commit | 48cd80f24ef24a41fd5d461e0e4356ecfd239bef (patch) | |
tree | 4ef4d8ea800b79d93f8e84a76067488d65edcc01 | |
parent | d53fcfcf6ef5a026c66f21b6b48e7420451f2a4d (diff) |
Add encoder option to systemd service file
-rw-r--r-- | extra/gpu-screen-recorder.env | 1 | ||||
-rw-r--r-- | extra/gpu-screen-recorder.service | 3 | ||||
-rw-r--r-- | src/encoder/video/software.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/extra/gpu-screen-recorder.env b/extra/gpu-screen-recorder.env index ce9f223..57dd424 100644 --- a/extra/gpu-screen-recorder.env +++ b/extra/gpu-screen-recorder.env @@ -9,3 +9,4 @@ FRAMERATE=60 REPLAYDURATION=60 OUTPUTDIR=/run/media/dec05eba/SSD1TB/Videos/aaaa KEYINT=2 +ENCODER=gpu
\ No newline at end of file diff --git a/extra/gpu-screen-recorder.service b/extra/gpu-screen-recorder.service index 6933f66..68c8ab1 100644 --- a/extra/gpu-screen-recorder.service +++ b/extra/gpu-screen-recorder.service @@ -16,7 +16,8 @@ Environment=OUTPUTDIR=%h/Videos Environment=MAKEFOLDERS=no Environment=COLOR_RANGE=limited Environment=KEYINT=2 -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" -mf $MAKEFOLDERS $ADDITIONAL_ARGS -cr $COLOR_RANGE -keyint $KEYINT' +Environment=ENCODER=gpu +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" -mf $MAKEFOLDERS $ADDITIONAL_ARGS -cr $COLOR_RANGE -keyint $KEYINT -encoder $ENCODER' KillSignal=SIGINT Restart=on-failure RestartSec=5s diff --git a/src/encoder/video/software.c b/src/encoder/video/software.c index 4666ffd..f3b311e 100644 --- a/src/encoder/video/software.c +++ b/src/encoder/video/software.c @@ -90,6 +90,8 @@ static void gsr_video_encoder_software_copy_textures_to_frame(gsr_video_encoder const unsigned int formats[2] = { GL_RED, GL_RG }; for(int i = 0; i < 2; ++i) { encoder_software->params.egl->glBindTexture(GL_TEXTURE_2D, encoder_software->target_textures[i]); + // We could use glGetTexSubImage and then we wouldn't have to use a specific linesize (LINESIZE_ALIGNMENT) that adds padding, + // but glGetTexSubImage is only available starting from opengl 4.5. encoder_software->params.egl->glGetTexImage(GL_TEXTURE_2D, 0, formats[i], GL_UNSIGNED_BYTE, frame->data[i]); } encoder_software->params.egl->glBindTexture(GL_TEXTURE_2D, 0); |