mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-07 23:20:25 +09:00
RGB8 -> RGB
This commit is contained in:
@@ -166,7 +166,7 @@ Note that for best performance you should close other screen recorders such as O
|
||||
## Note about optimal performance on NVIDIA
|
||||
NVIDIA driver has a "feature" (read: bug) where it will downclock memory transfer rate when a program uses cuda (or nvenc, which uses cuda), such as GPU Screen Recorder. This can affect game performance.
|
||||
GPU Screen Recorder installs an NVIDIA profile on the system (`~/.nv/nvidia-application-profiles-rc.d/10-gsr-cuda-no-stable-perf-limit`) to get around this issue but this requires a relatively
|
||||
new NVIDIA driver version (~580). If you have an older NVIDIA driver then you can choose to record with vulkan video encoding instead as it doesn't have this issue.
|
||||
new NVIDIA driver version (580+). If you have an older NVIDIA driver then you can choose to record with vulkan video encoding instead as it doesn't have this issue.
|
||||
|
||||
You can use vulkan video encoding by adding `_vulkan` at the end of the video codec option, for example: `-k h264_vulkan` or a full command example: `gpu-screen-recorder -w screen -k h264_vulkan -o video.mp4`.
|
||||
Vulkan video encoding in GPU Screen Recorder supports `h264`, `hevc` and `av1` (along with `hdr` and `10bit` options), assuming your gpu drivers, ffmpeg and vulkan is up to date.
|
||||
|
||||
@@ -18,7 +18,7 @@ typedef enum {
|
||||
typedef enum {
|
||||
GSR_DESTINATION_COLOR_NV12, /* YUV420, BT709, 8-bit */
|
||||
GSR_DESTINATION_COLOR_P010, /* YUV420, BT2020, 10-bit */
|
||||
GSR_DESTINATION_COLOR_RGB8
|
||||
GSR_DESTINATION_COLOR_RGB
|
||||
} gsr_destination_color;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -65,7 +65,7 @@ static const char* color_format_range_get_transform_matrix(gsr_destination_color
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GSR_DESTINATION_COLOR_RGB8:
|
||||
case GSR_DESTINATION_COLOR_RGB:
|
||||
return "";
|
||||
default:
|
||||
return NULL;
|
||||
@@ -534,7 +534,7 @@ static bool gsr_color_conversion_load_graphics_shaders(gsr_color_conversion *sel
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GSR_DESTINATION_COLOR_RGB8: {
|
||||
case GSR_DESTINATION_COLOR_RGB: {
|
||||
if(load_graphics_shader_rgb(&self->graphics_shaders[GRAPHICS_SHADER_INDEX_RGB], self->params.egl, &self->graphics_uniforms[GRAPHICS_SHADER_INDEX_RGB], false) != 0) {
|
||||
fprintf(stderr, "gsr error: gsr_color_conversion_init: failed to load RGB graphics shader\n");
|
||||
return false;
|
||||
@@ -575,7 +575,7 @@ static bool gsr_color_conversion_load_external_graphics_shaders(gsr_color_conver
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GSR_DESTINATION_COLOR_RGB8: {
|
||||
case GSR_DESTINATION_COLOR_RGB: {
|
||||
if(load_graphics_shader_rgb(&self->graphics_shaders[GRAPHICS_SHADER_INDEX_RGB_EXTERNAL], self->params.egl, &self->graphics_uniforms[GRAPHICS_SHADER_INDEX_RGB_EXTERNAL], true) != 0) {
|
||||
fprintf(stderr, "gsr error: gsr_color_conversion_init: failed to load RGB graphics shader (external)\n");
|
||||
return false;
|
||||
@@ -607,7 +607,7 @@ int gsr_color_conversion_init(gsr_color_conversion *self, const gsr_color_conver
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GSR_DESTINATION_COLOR_RGB8: {
|
||||
case GSR_DESTINATION_COLOR_RGB: {
|
||||
if(self->params.num_destination_textures != 1) {
|
||||
fprintf(stderr, "gsr error: gsr_color_conversion_init: expected 1 destination textures for destination color RGB8, got %d destination texture(s)\n", self->params.num_destination_textures);
|
||||
goto err;
|
||||
@@ -808,7 +808,7 @@ static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsig
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GSR_DESTINATION_COLOR_RGB8: {
|
||||
case GSR_DESTINATION_COLOR_RGB: {
|
||||
self->params.egl->glBindFramebuffer(GL_FRAMEBUFFER, self->framebuffers[0]);
|
||||
//cap_xcomp->params.egl->glClear(GL_COLOR_BUFFER_BIT); // TODO: Do this in a separate clear_ function. We want to do that when using multiple drm to create the final image (multiple monitors for example)
|
||||
|
||||
@@ -847,7 +847,7 @@ static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsig
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GSR_DESTINATION_COLOR_RGB8: {
|
||||
case GSR_DESTINATION_COLOR_RGB: {
|
||||
self->params.egl->glBindFramebuffer(GL_FRAMEBUFFER, self->framebuffers[0]);
|
||||
//cap_xcomp->params.egl->glClear(GL_COLOR_BUFFER_BIT); // TODO: Do this in a separate clear_ function. We want to do that when using multiple drm to create the final image (multiple monitors for example)
|
||||
|
||||
@@ -913,7 +913,7 @@ void gsr_color_conversion_clear(gsr_color_conversion *self) {
|
||||
color2[3] = 1.0f;
|
||||
break;
|
||||
}
|
||||
case GSR_DESTINATION_COLOR_RGB8: {
|
||||
case GSR_DESTINATION_COLOR_RGB: {
|
||||
color2[0] = 0.0f;
|
||||
color2[1] = 0.0f;
|
||||
color2[2] = 0.0f;
|
||||
|
||||
@@ -2446,7 +2446,7 @@ static void capture_image_to_file(args_parser &arg_parser, gsr_egl *egl, gsr_win
|
||||
color_conversion_params.destination_textures[0] = image_writer.texture;
|
||||
color_conversion_params.destination_textures_size[0] = video_size;
|
||||
color_conversion_params.num_destination_textures = 1;
|
||||
color_conversion_params.destination_color = GSR_DESTINATION_COLOR_RGB8;
|
||||
color_conversion_params.destination_color = GSR_DESTINATION_COLOR_RGB;
|
||||
|
||||
gsr_color_conversion color_conversion;
|
||||
if(gsr_color_conversion_init(&color_conversion, &color_conversion_params) != 0) {
|
||||
|
||||
@@ -21,7 +21,6 @@ bool gsr_plugins_init(gsr_plugins *self, gsr_plugin_init_params init_params, gsr
|
||||
self->init_params = init_params;
|
||||
self->egl = egl;
|
||||
|
||||
/* TODO: GL_RGB8? */
|
||||
const unsigned int texture = gl_create_texture(egl, init_params.width, init_params.height, color_depth_to_gl_internal_format(init_params.color_depth), GL_RGBA, GL_LINEAR);
|
||||
if(texture == 0) {
|
||||
fprintf(stderr, "gsr error: gsr_plugins_init failed to create texture\n");
|
||||
@@ -31,7 +30,7 @@ bool gsr_plugins_init(gsr_plugins *self, gsr_plugin_init_params init_params, gsr
|
||||
|
||||
gsr_color_conversion_params color_conversion_params = {
|
||||
.egl = egl,
|
||||
.destination_color = GSR_DESTINATION_COLOR_RGB8, /* TODO: Support 10-bits, use init_params.color_depth */
|
||||
.destination_color = GSR_DESTINATION_COLOR_RGB,
|
||||
.destination_textures[0] = self->texture,
|
||||
.destination_textures_size[0] = (vec2i){ init_params.width, init_params.height },
|
||||
.num_destination_textures = 1,
|
||||
|
||||
Reference in New Issue
Block a user