nowrep / obs-vkcapture

OBS Linux Vulkan/OpenGL game capture
GNU General Public License v2.0
519 stars 25 forks source link

Game Capture streaming red/blue inverted. #86

Closed Haelikor closed 2 years ago

Haelikor commented 2 years ago

Fedora 36, seeing this in Retroarch. Transparency option not enabled.

What I see: image

What streams when using Game Capture: image

NV12 8-bit color format, Rec.601 color space, limited color range.

If I do Window capture instead of Game capture: image

Colors all seem normal. Any advice, I appreciate it.

nowrep commented 2 years ago

Can you please post logs from the game?

Haelikor commented 2 years ago

Sure.

Here's Retroarch's log: retroarch2022_08_1809_02_00.log

nowrep commented 2 years ago

It should also contain obs-vkcapture lines, that means standard terminal output.

Haelikor commented 2 years ago

For that, I see:

ERROR: ld.so: object '/usr/lib/libVkLayer_obs_vkcapture.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ERROR: ld.so: object '/usr/lib/libobs_glcapture.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. [obs-vkcapture] Init Vulkan 1.1.5 [obs-vkcapture] Injecting VK_KHR_bind_memory2 extension [obs-vkcapture] Injecting VK_KHR_get_memory_requirements2 extension [obs-vkcapture] Injecting VK_KHR_external_memory_fd extension [obs-vkcapture] Injecting VK_EXT_image_drm_format_modifier extension [obs-vkcapture] DRM format modifier support not available [obs-vkcapture] Texture VK_FORMAT_R8G8B8A8_UNORM 1920x1080 [obs-vkcapture] ------------------ vulkan capture started ------------------ [obs-vkcapture] ------------------- vulkan capture freed -------------------

nowrep commented 2 years ago

Thanks.

Just a note: you shouldn't have libVkLayer_obs_vkcapture.so in LD_PRELOAD, only the GL library needs to be preloaded.

GloriousEggroll commented 2 years ago

Thanks.

Just a note: you shouldn't have libVkLayer_obs_vkcapture.so in LD_PRELOAD, only the GL library needs to be preloaded.

This is likely due to the way I handled vkcapture's capture script in my copr repo for the plugin. I merged them so that only 'obs-gamecapture' is needed for both vulkan and ogl. It will of course spit out some library load failures which are not significant, but it's easier for people than using two separate commands:

https://copr-dist-git.fedorainfracloud.org/cgit/gloriouseggroll/obs-studio-gamecapture/obs-studio-gamecapture.git/tree/0001-use-one-script-for-both-glcapture-and-vkcapture-and-.patch?h=f36

I have this documented on the Nobara page (see point 2.): https://nobaraproject.org/docs/obs-studio/using-game-capture/

nowrep commented 2 years ago
exec env \
        LD_PRELOAD="${LD_PRELOAD}:/usr/lib64/libobs_glcapture.so:/usr/lib/libobs_glcapture.so" \
        OBS_VKCAPTURE=1 \
        "$@"

This is enough, preloading the Vulkan layer library does nothing. OBS_VKCAPTURE=1 will make the Vulkan loader load it when needed, and it won't be loaded at all in GL apps.

GloriousEggroll commented 2 years ago
exec env \
        LD_PRELOAD="${LD_PRELOAD}:/usr/lib64/libobs_glcapture.so:/usr/lib/libobs_glcapture.so" \
        OBS_VKCAPTURE=1 \
        "$@"

This is enough, preloading the Vulkan layer library does nothing. OBS_VKCAPTURE=1 will make the Vulkan loader load it when needed, and it won't be loaded at all in GL apps.

thanks for the insight, I'll get the script corrected shortly so the vulkan layer preload errors don't pop up in future.

nowrep commented 2 years ago

Also it probably makes sense to just add obs-gamecapture script here, so you don't need to patch it yourself.

GloriousEggroll commented 2 years ago

Also it probably makes sense to just add obs-gamecapture script here, so you don't need to patch it yourself.

Yeah I wanted to do it but I hardcoded the library paths for Fedora specifically, it needs that cleaned up before I can make a PR