obs-vkcapture icon indicating copy to clipboard operation
obs-vkcapture copied to clipboard

Captures at 30fps.

Open somewhatfrog opened this issue 2 years ago • 16 comments

OBS is set to record at 60fps, both the preview of source and recording itself looks like 30fps. There is no such issue with any other method of capturing window or entire screen. As if plugin is just set to capture at 30fps.

i3wm archlinux zen nvidia proprietary all up to date

Thanks.

somewhatfrog avatar Jun 11 '22 19:06 somewhatfrog

There's no throttling, it captures every single frame from the game. Even if OBS is set to record at lower framerate, the plugin will still capture each game's frame.

nowrep avatar Jun 11 '22 20:06 nowrep

It is what it is, I tested Elden RIng, Dark Souls III and Mortal Shell (I don't have any other games) Log has no errors.

info: [linux-vkcapture] Creating texture from dmabuf 1920x1064 modifier:216172782120099860
info: [linux-vkcapture]  [0] fd:81 stride:7680 offset:0

somewhatfrog avatar Jun 12 '22 07:06 somewhatfrog

Can you upload sample recording?

nowrep avatar Jun 12 '22 07:06 nowrep

Sure. here is vkcube: https://cdn.discordapp.com/attachments/822138635155013712/985445706527572028/Replay_2022-06-12_10-28-38.mp4

somewhatfrog avatar Jun 12 '22 07:06 somewhatfrog

Does enabling/disabling cursor make any difference?

nowrep avatar Jun 12 '22 07:06 nowrep

:D ye that fixes it. But what to do if I don't want the cursor?

Added: It seems like it goes back to 30fps the moment i enable windowed preview.

somewhatfrog avatar Jun 12 '22 07:06 somewhatfrog

So enabling cursor fixed it? That's strange, I would certainly expect it the other way around.

Added: It seems like it goes back to 30fps the moment i enable windowed preview.

What's windowed preview? Also, do you have multiple screens?

nowrep avatar Jun 12 '22 07:06 nowrep

Cursor seems to have no effect on it anymore, it stays at 60fps if there is no "Windowed Projector (preview)". I have single 4k@60hz monitor. It also goes to 30fps the moment you open "Game Capture" source settings.

Added: could it be that plugin intentionally lowers the capturing framerate when settings are opened and also treats additional preview window the same way? Or thinks that settings are opened?

somewhatfrog avatar Jun 12 '22 07:06 somewhatfrog

No, there's nothing like that in the plugin. The plugin code is actually very simple.

What's to blame here is most likely nvidia+xorg. What I don't understand is why it can only be reproduced with game capture. You are only setting OBS_USE_EGL when using game capture, right? It could be bug in nvidia egl.

Crazy idea, maybe it halves the framerate for each copy of the scene? So if you open game capture preferences AND the windowed preview, would it bring it down to 15fps?

nowrep avatar Jun 12 '22 08:06 nowrep

LOL yes it does drop it to 15fps

Added: the normal preview in obs window itself doesn't cause it. Yes, I have OBS_USE_EGL only to make this plugin to work. It also seems that you can't capture with it in two instances of OBS at the same time, it just shows black window in second instance.

somewhatfrog avatar Jun 12 '22 08:06 somewhatfrog

It does seem like nvidia EGL bug then.

Can you try to add "Media Source" to the scene with some video file and reproduce the same frame halving behavior (with OBS running with OBS_USE_EGL)?

nowrep avatar Jun 12 '22 08:06 nowrep

Yes it is absolutely the same with "Media Source".

somewhatfrog avatar Jun 12 '22 08:06 somewhatfrog

In that case, you can try reporting it to nvidia.

It also seems that you can't capture with it in two instances of OBS at the same time, it just shows black window in second instance.

The plugin doesn't support running multiple instances of OBS. Is that actually valid usecase? You can add multiple game capture sources into scene, and they can show the same game. You can also have showing multiple games in multiple game capture sources, but all of this has to be running inside single OBS instance.

nowrep avatar Jun 12 '22 08:06 nowrep

Well, it is kinda valid but I'd say it is very specific use case, no need to worry about it. So vkcapture is more efficient than regular window capture right?

Added: I will try to report to nvidia, should I tell them that framerate halves with each new copy of the same scene, right?

somewhatfrog avatar Jun 12 '22 08:06 somewhatfrog

So vkcapture is more efficient than regular window capture right?

It generally should be yes, but you should benchmark it for yourself on your setup.

Added: I will try to report to nvidia, should I tell them that framerate halves with each new copy of the same scene, right?

It should be enough to tell them how to reproduce it (Xorg + OBS_USE_EGL + media source). You can also link this issue.

nowrep avatar Jun 12 '22 08:06 nowrep

K, thanks for the help and plugin!

somewhatfrog avatar Jun 12 '22 08:06 somewhatfrog