Dont use jpeg color range (fixes too dark image on amd/intel in flatpak)
This commit is contained in:
parent
44f84748f8
commit
bee99a69e3
12
TODO
12
TODO
@ -51,7 +51,6 @@ Window capture performance on steam deck isn't good when playing the witcher 3 f
|
|||||||
Monitor capture on steam deck is slightly below the game fps, but only when capturing on the steam deck screen. If capturing on another monitor, there is no issue.
|
Monitor capture on steam deck is slightly below the game fps, but only when capturing on the steam deck screen. If capturing on another monitor, there is no issue.
|
||||||
Is this related to the dma buf rotation issue? different modifier being slow? does this always happen?
|
Is this related to the dma buf rotation issue? different modifier being slow? does this always happen?
|
||||||
|
|
||||||
Make sure rgb to yuv color conversion is 100% correct.
|
|
||||||
Fallback to vaapi copy in kms if opengl version fails. This can happen on steam deck for some reason (driver bug?). Also vaapi copy uses less gpu since it uses video codec unit to copy.
|
Fallback to vaapi copy in kms if opengl version fails. This can happen on steam deck for some reason (driver bug?). Also vaapi copy uses less gpu since it uses video codec unit to copy.
|
||||||
Test if vaapi copy version uses less memory than opengl version.
|
Test if vaapi copy version uses less memory than opengl version.
|
||||||
|
|
||||||
@ -60,7 +59,6 @@ Intel is a bit weird with monitor capture and multiple monitors. If one of the m
|
|||||||
How about if multiple monitors are rotated?
|
How about if multiple monitors are rotated?
|
||||||
|
|
||||||
When using multiple monitors kms grab the target monitor instead of the whole screen.
|
When using multiple monitors kms grab the target monitor instead of the whole screen.
|
||||||
Enable opus/flac again. It's broken right now when merging audio inputs. The audio gets a lot of static noise!
|
|
||||||
|
|
||||||
Support vp8/vp9/av1. This is especially important on amd which on some distros (such as Manjaro) where hardware accelerated h264/hevc is disabled in the mesa package.
|
Support vp8/vp9/av1. This is especially important on amd which on some distros (such as Manjaro) where hardware accelerated h264/hevc is disabled in the mesa package.
|
||||||
|
|
||||||
@ -81,4 +79,12 @@ Support screen rotation.
|
|||||||
When nvidia supports hardware cursor then capture the cursor. Right now the cursor is captured because it's a software cursor so it's composed on the dma buf.
|
When nvidia supports hardware cursor then capture the cursor. Right now the cursor is captured because it's a software cursor so it's composed on the dma buf.
|
||||||
CPU usage is pretty high on AMD/Intel/(Nvidia(wayland)), why? opening and closing fds, creating egl, cuda association, is slow when done every frame. Test if desktop portal screencast has better performance.
|
CPU usage is pretty high on AMD/Intel/(Nvidia(wayland)), why? opening and closing fds, creating egl, cuda association, is slow when done every frame. Test if desktop portal screencast has better performance.
|
||||||
|
|
||||||
Capture is broken on amd on wlroots. It's disabled at the moment and instead uses kms capture. Find out why we get a black screen in wlroots.
|
Capture is broken on amd on wlroots. It's disabled at the moment and instead uses kms capture. Find out why we get a black screen in wlroots.
|
||||||
|
|
||||||
|
First video and audio frame should be posted immediately instead of waiting 1000/fps milliseconds, to improve latency for remote desktop future functionality.
|
||||||
|
|
||||||
|
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.
|
@ -10,7 +10,7 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GSR_DESTINATION_COLOR_RGB,
|
GSR_DESTINATION_COLOR_RGB,
|
||||||
GSR_DESTINATION_COLOR_NV12
|
GSR_DESTINATION_COLOR_NV12 /* YUV420, BT709, limited */
|
||||||
} gsr_destination_color;
|
} gsr_destination_color;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -18,10 +18,11 @@ static float abs_f(float v) {
|
|||||||
" 0.0, 0.0, 0.0, 1.0);\n" \
|
" 0.0, 0.0, 0.0, 1.0);\n" \
|
||||||
"}\n"
|
"}\n"
|
||||||
|
|
||||||
#define RGB_TO_YUV "const mat4 RGBtoYUV = mat4(0.2126, 0.5000, -0.1146, 0.0,\n" \
|
/* BT709 limited */
|
||||||
" 0.7152, -0.4542, -0.3854, 0.0,\n" \
|
#define RGB_TO_YUV "const mat4 RGBtoYUV = mat4(0.1826, -0.1006, 0.4392, 0.0,\n" \
|
||||||
" 0.0722, -0.0468, 0.5000, 0.0,\n" \
|
" 0.6142, -0.3386, -0.3989, 0.0,\n" \
|
||||||
" 0.0000, 0.5000, 0.5000, 1.0);"
|
" 0.0620, 0.4392, -0.0403, 0.0,\n" \
|
||||||
|
" 0.0625, 0.5000, 0.5000, 1.0);"
|
||||||
|
|
||||||
static int load_shader_rgb(gsr_shader *shader, gsr_egl *egl, int *rotation_uniform) {
|
static int load_shader_rgb(gsr_shader *shader, gsr_egl *egl, int *rotation_uniform) {
|
||||||
char vertex_shader[2048];
|
char vertex_shader[2048];
|
||||||
@ -122,7 +123,7 @@ static unsigned int load_shader_uv(gsr_shader *shader, gsr_egl *egl, int *rotati
|
|||||||
"void main() \n"
|
"void main() \n"
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" vec4 pixel = texture(tex1, texcoords_out); \n"
|
" vec4 pixel = texture(tex1, texcoords_out); \n"
|
||||||
" FragColor.xy = (RGBtoYUV * vec4(pixel.rgb, 1.0)).zy; \n"
|
" FragColor.xy = (RGBtoYUV * vec4(pixel.rgb, 1.0)).yz; \n"
|
||||||
" FragColor.w = pixel.a; \n"
|
" FragColor.w = pixel.a; \n"
|
||||||
"} \n";
|
"} \n";
|
||||||
|
|
||||||
|
16
src/main.cpp
16
src/main.cpp
@ -301,10 +301,10 @@ static AVCodecContext *create_video_codec_context(AVPixelFormat pix_fmt,
|
|||||||
}
|
}
|
||||||
codec_context->max_b_frames = 0;
|
codec_context->max_b_frames = 0;
|
||||||
codec_context->pix_fmt = pix_fmt;
|
codec_context->pix_fmt = pix_fmt;
|
||||||
codec_context->color_range = AVCOL_RANGE_JPEG; // TODO: Amd/nvidia?
|
//codec_context->color_range = AVCOL_RANGE_JPEG; // TODO: Amd/nvidia?
|
||||||
codec_context->color_primaries = AVCOL_PRI_BT709;
|
//codec_context->color_primaries = AVCOL_PRI_BT709;
|
||||||
codec_context->color_trc = AVCOL_TRC_BT709;
|
//codec_context->color_trc = AVCOL_TRC_BT709;
|
||||||
codec_context->colorspace = AVCOL_SPC_BT709;
|
//codec_context->colorspace = AVCOL_SPC_BT709;
|
||||||
//codec_context->chroma_sample_location = AVCHROMA_LOC_CENTER;
|
//codec_context->chroma_sample_location = AVCHROMA_LOC_CENTER;
|
||||||
if(codec->id == AV_CODEC_ID_HEVC)
|
if(codec->id == AV_CODEC_ID_HEVC)
|
||||||
codec_context->codec_tag = MKTAG('h', 'v', 'c', '1');
|
codec_context->codec_tag = MKTAG('h', 'v', 'c', '1');
|
||||||
@ -682,7 +682,7 @@ static void usage_full() {
|
|||||||
fprintf(stderr, " -ac Audio codec to use. Should be either 'aac', 'opus' or 'flac'. Defaults to 'opus' for .mp4/.mkv files, otherwise defaults to 'aac'.\n");
|
fprintf(stderr, " -ac Audio codec to use. Should be either 'aac', 'opus' or 'flac'. Defaults to 'opus' for .mp4/.mkv files, otherwise defaults to 'aac'.\n");
|
||||||
fprintf(stderr, " 'opus' and 'flac' is only supported by .mp4/.mkv files. 'opus' is recommended for best performance and smallest audio size.\n");
|
fprintf(stderr, " 'opus' and 'flac' is only supported by .mp4/.mkv files. 'opus' is recommended for best performance and smallest audio size.\n");
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
fprintf(stderr, " -oc Overclock memory transfer rate to the maximum performance level. This only applies to NVIDIA and exists to overcome a bug in NVIDIA driver where performance level\n");
|
fprintf(stderr, " -oc Overclock memory transfer rate to the maximum performance level. This only applies to NVIDIA on X11 and exists to overcome a bug in NVIDIA driver where performance level. The same issue exists on Wayland but overclocking is not possible on Wayland.\n");
|
||||||
fprintf(stderr, " is dropped when you record a game. Only needed if you are recording a game that is bottlenecked by GPU.\n");
|
fprintf(stderr, " is dropped when you record a game. Only needed if you are recording a game that is bottlenecked by GPU.\n");
|
||||||
fprintf(stderr, " Works only if your have \"Coolbits\" set to \"12\" in NVIDIA X settings, see README for more information. Note! use at your own risk! Optional, disabled by default.\n");
|
fprintf(stderr, " Works only if your have \"Coolbits\" set to \"12\" in NVIDIA X settings, see README for more information. Note! use at your own risk! Optional, disabled by default.\n");
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@ -1323,7 +1323,11 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(gpu_inf.vendor != GSR_GPU_VENDOR_NVIDIA && overclock) {
|
if(gpu_inf.vendor != GSR_GPU_VENDOR_NVIDIA && overclock) {
|
||||||
fprintf(stderr, "Info: overclock option has no effect on amd/intel, ignoring option...\n");
|
fprintf(stderr, "Info: overclock option has no effect on amd/intel, ignoring option\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(gpu_inf.vendor == GSR_GPU_VENDOR_NVIDIA && overclock && wayland) {
|
||||||
|
fprintf(stderr, "Info: overclocking is not possible on nvidia on wayland, ignoring option\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
char card_path[128];
|
char card_path[128];
|
||||||
|
Loading…
Reference in New Issue
Block a user