Question / Help No "Game Capture" source, very slow capture

Karai17

New Member
I switched to Linux about two months ago. On Windows, when I'd set up OBS, I had the option to use the "Game Capture" source to capture frames directly from the frame buffer, allowing me to stream to Twitch without any noticeable hiccups in my game, or stream's performance.

However, I don't seem to have the same luxury on Linux. When playing Minecraft for instance, I have my game limited to 60fps, though when I turn the limit off it runs at around 90fps. When I try to capture the window, I get a red screen (as others have noted). When I try to capture the display, my game slows down to about 15fps, consistent to display capture on Windows. There seems to be no source in the Linux version of OBS Studio to capture directly from the game's frame buffer, so I get unplayable performance and a janky stream.

OS: Fedora 23 x86_64
CPU: AMD FX 8350 4.0 GHz Oct Core
GPU: NVIDIA GTX 550 Ti
RAM: 12.0 GBs
 

goofybud16

New Member
Have you tried changing the encoding settings?

From my experience with OBS Multiplatform on Linux, you have two choices: Low CPU load and large files, or large CPU load and small files. If you are recording, you can transcode this after recording to reduce file size, but while recording you are limited by CPU power, as AFAIK there is no GPU Video encoding on Linux.
 

Karai17

New Member
Why the heck not?! I would expect that a strive for multi-platform support would include things like Recording using OpenGL on the GPU (what with OBS already having an OpenGL renderer...)

I generally don't record, only stream, so what would be the best option in that sense? Is there any plans to add GPU rendering in the (near) future? It's kind of an important feature... The whole reason OBS works great is because it pulls the frame right out of the frame buffer without needing to do much processing. If OBS won't be supporting that feature on Linux, then it's almost entirely useless as a program. :\
 

c3r1c3

Member
GPU Rendering != GPU Video compression engine.

As to VCE or QSV or NVENC being available on Linux (in general, not just OBS) I can't say. Looking around it seems that VCE isn't ready in Linux land, QSV might be available to you (if so you should be able to expose it via the additional parameters), and NVENC is possible in theory, but you might need to compile ffmpeg/libx264 yourself.

I can say that OBS does use your GPU for compositing regardless of platform.

Also x264 (i.e. 'small') files do take a good amount of CPU power to encode. That true regardless of platform. Linux is just as good/bad/needy as the other OSes.

Some links:
http://developer.download.nvidia.co...with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf
https://trac.ffmpeg.org/ticket/2591
https://en.wikipedia.org/wiki/Video_Coding_Engine
 

Karai17

New Member
GPU compression is a non issue. The issue is that OBS is not able to pull frames from the game's frame buffer, it has to recreate the frame which is incredibly slow (hence my fps being cut to a sixth of what it usually is but not at all on windows)
 

Karai17

New Member
While that is true (on both accounts), I feel like there ought to be an actual solution to this. I wonder if Wayland has better support for such things? Or is this perhaps an issue tying in with the graphics driver? I don't really know. All I know is I am sad that I can't stream any more because I got so fed up with Windows trying to own me, instead of the other way around.
 

WayZHC

Member
[OFFTOPIC] Currently it looks like Wayland won't get huge mainstream attention before RHEL/CentOS gets it (RHEL/CentOS 8 please please please). Yeah, drivers and DEs are slowly getting experimental support for Wayland, but X11 will be the default for now. RHEL/CentOS is the most important Linux release for companies such as Nvidia and they focus heavily on the features that are available on those releases. That's where the money comes in (enterprise market).

And then there is another problem. Canonical (Ubuntu) and Mir.

So were are stuck with X11 for now. [/OFFTOPIC]
 

Karai17

New Member
I suspect Fedora will be shipping with Wayland before RHEL or CentOS, and I doubt we'll be seeing Wayland before Fedora 25 at the earliest. And yeah, Canonical is a thorn in everyone's backside these days. However, I notice your signature...
 

WayZHC

Member
Yeah Fedora tries to run the login manager on Wayland. But the main desktop will still use X11. But yeah, hopefully Fedora 25 brings something.

And i use Manjaro as my main distro. But i've been using Ubuntu 16.04 for last few weeks because of a big school project (my school thinks Debian and Ubuntu = Linux. So it was a requirement -_-). One great thing about Linux is that you can change the dirsto in a half an hour without touching your home partition and configs.
 

goofybud16

New Member
From what I have seen with Wayland, there is no easy way to record things. That is why you always see people recording the screen when demo-ing Wayland.

The performance impact I have seen from OBS has mostly been encoding. Since OBS takes so much CPU to encode 1080p@60FPS, it maxes out my CPU and that is what kills my FPS.

Are you sure what you were using on Windows wasn't something like Shadowplay? Where the GPU itself is grabbing the frame, encoding it, and sending it to the CPU pre-encoded. This greatly reduces FPS loss, as the GPU isn't using the video encoding normally during gameplay, and the CPU only has 1-2% usage to just transfer the stream of frames somewhere else (writing to disk, memory, network, whatever).
 

Karai17

New Member
On Windows, OBS has a plugin called "Game Capture" that grabs the frame from the game directly and does whatever it needs to with it. Linux doesn't have that, so OBS needs to essentially take screenshots every frame, which is extremely slow.
 

Teh Freek

New Member
There was a fix about a week and a half ago that should fix the red window on capture, but no package has been built for it yet. I could put one together but I don't want to duplicate jbrouhard's work, but if I don't hear from him soonish then I will probably go ahead regardless.
 

Karai17

New Member
That will probably be an improvement, but it doesn't really fix the underlying issue here. Linux really needs a Game Capture mode. I don't know enough about Linux to be able to say if X or drivers or whatever are a real issue blocking this feature, but without this feature, streaming games on Linux is basically not possible.
 

Teh Freek

New Member
It's as hardware-accelerated as the driver lets it be. XSHM capture, on the other hand, is awful and should be avoided when possible.
 

Karai17

New Member
If it's HWA then maybe fixing the red screen issue would solve this problem entirely. We'll have to wait and see I guess.
 
Top