From 7d358580a21061136919fec2b980daba3d05d741 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 7 Sep 2023 19:19:00 +0200 Subject: wip --- TODO | 8 +++++--- src/color_conversion.c | 5 ++--- src/egl.c | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 29dc126..6f1ce79 100644 --- a/TODO +++ b/TODO @@ -79,15 +79,17 @@ First video and audio frame should be posted immediately instead of waiting 1000 Support vulkan video encoding. That might workaround forced p2 state nvidia driver "bug". Ffmpeg supports vulkan video encoding if it's encoding with --enable-vulkan -Enable opus/flac again. It's broken right now when merging audio inputs. The audio gets a lot of static noise! - It may be possible to improve color conversion rgb->yuv shader for color edges by biasing colors to an edge, instead of letting color overlaying with bilinear filtering handle it. When webcam is supported mention that nvidia_drm.modeset=1 must be set on nvidia x11 (it's required on wayland so it's not needed there. Or does eglstream work without it??). Check if this really is the case. + Support green screen removal, cropping, shader effects in general (circle mask, rounded corners, etc). Use vfr on nvidia x11 as well, otherwise network data could slow it down to below target fps and mess it up. Preset is set to p5 for now but it should ideally be p6 or p7. This change is needed because for certain sizes of a window (or monitor?) such as 971x780 causes encoding to freeze when using h264 codec. This is a new(?) nvidia driver bug. - Maybe dont choose p6 or p7 again? it causes micro stutter for some users (?). \ No newline at end of file + Maybe dont choose p6 or p7 again? it causes micro stutter for some users (?). + +For low latency, see https://developer.download.nvidia.com/compute/nvenc/v4.0/NVENC_VideoEncoder_API_ProgGuide.pdf (section 7.1). +Remove follow focused option. diff --git a/src/color_conversion.c b/src/color_conversion.c index caf0488..e44b80a 100644 --- a/src/color_conversion.c +++ b/src/color_conversion.c @@ -136,7 +136,7 @@ static unsigned int load_shader_uv(gsr_shader *shader, gsr_egl *egl, int *rotati return 0; } -static int loader_framebuffers(gsr_color_conversion *self) { +static int load_framebuffers(gsr_color_conversion *self) { const unsigned int draw_buffer = GL_COLOR_ATTACHMENT0; self->params.egl->glGenFramebuffers(MAX_FRAMEBUFFERS, self->framebuffers); @@ -223,7 +223,7 @@ int gsr_color_conversion_init(gsr_color_conversion *self, const gsr_color_conver } } - if(loader_framebuffers(self) != 0) + if(load_framebuffers(self) != 0) goto err; if(create_vertices(self) != 0) @@ -232,7 +232,6 @@ int gsr_color_conversion_init(gsr_color_conversion *self, const gsr_color_conver return 0; err: - self->params.egl->glBindFramebuffer(GL_FRAMEBUFFER, 0); gsr_color_conversion_deinit(self); return -1; } diff --git a/src/egl.c b/src/egl.c index 00a5b22..9e1d54d 100644 --- a/src/egl.c +++ b/src/egl.c @@ -572,6 +572,9 @@ bool gsr_egl_start_capture(gsr_egl *self, const char *monitor_to_capture) { if(!gsr_egl_supports_wayland_capture(self)) return false; + if(self->wayland.frame_callback) + return false; + self->wayland.output_to_capture = get_wayland_output_by_name(self, monitor_to_capture); if(!self->wayland.output_to_capture) return false; -- cgit v1.2.3