SRT decoding has extremely high CPU usage

darq

New Member
Hey,
I have a Gentoo server and compiled vnc and obs,
and am of course running vncserver and obs in it.
Just running the vnc server load goes up by 1, no biggie.

I have added a Media Source and a srt://<ip>:<port>?mode=listener as the source,
and am connecting to it via a) laptop 1920x1080 or 1280x720 and b) IRL Pro on Android phone, 1920x1080 or 1280x720 in caller mode.

Load, which is usually around 0.10-0.20,, goes up to 13.xx on a Xeon E3-1245v2 (4c8t) CPU.
I'm not sure what alternatives there are. Or maybe I can tweak obs?
No I can't add a GPU or decoder card. It's a 14 years old dedicated server, which I though I could repurpose as a streaming gateway.

The interesting part is, even when I stop streaming from outside to vnc-obs and from vnc-obs to nginx/rtmp multistream, load stays quite high, around 8.
Only when I completely kill vnc-obs it recovers.

Are there better solutions than obs for srt to obs, or can I somehow limit resources or configure it better?
 

darq

New Member
The e3-1245v2 has an igpu. If you mean the preview that's shown on the vnc client.
Code:
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])
    DeviceName:  Onboard IGD
    Subsystem: ASUSTeK Computer Inc. P8B WS Motherboard
    Flags: bus master, fast devsel, latency 0, IRQ 41
    Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
    Memory at e0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at f000 [size=64]
    Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
    Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
    Capabilities: [d0] Power Management version 2
    Capabilities: [a4] PCI Advanced Features
    Kernel driver in use: i915
    Kernel modules: i915
That's not it.
Tried the same now at my home computer running arch.
Screenshot from 2025-01-02 09-53-07.png

Just from having the srt media source in the scene.
It's a
Code:
CPU: Intel(R) Core(TM) i9-14900K (32) @ 6.00 GHz
GPU: NVIDIA GeForce RTX 4070 [Discrete]
The 4070 has support for hevc 420 as well as h264.
Using nvidia drivers.
I'll try Windows now
 

darq

New Member
Windows doesn't have those issues.
In fact I can even select nvenc-AV1 and nvenc-h265 as recording options, that I'm not able to do under Linux.
Windows CPU usage is at 0.5% when adding the SRT media source in listener mode.
GPU usage is around 11% idle.
 

darq

New Member
It's not even SRT.
Starting OBS on Arch on the i9/4070 system has a base cpu usage of 32-24%
But when I start on xorg CPU usage is low.
That could mean that vnc is to blame.
However, each core has an obs worker running when under vnc.
But that isn't the case with xorg.

I'll now try adding the media source under xorg and see if I'll have different results.

I can't edit my previous post.
The line with "In fact" is not true. I do have nvenv-av1 & h265 when recording under Linux.
 

darq

New Member
There's nothing useful in the log, but see for yourself..
Btw, when I resize the preview window, CPU usage goes way down but is still very high, about 12% on each core, which obs displays as 5% CPU usage.
Turning off the preview has no effect.

Is there no way to run obs just headless with the websocket server enabled?

I have also tried virtualGL with no success.
 

Attachments

  • 2025-01-02 18-47-42.txt
    4.8 KB · Views: 7
Last edited:

Tuna

Member
18:47:42.198: Loading up OpenGL on adapter Mesa llvmpipe (LLVM 18.1.8, 256 bits)
As expected, you don't run OBS within a GPU OpenGL context. You would have to check with VNC or other Remote Desktop technology that lets you do this.
 

darq

New Member
True.
I did now get rid of turbovnc and installed tigervnc 1.14.1, which has support for hardware acceleration!
I built the binary on my Gentoo server with "-O3 -march=native -mtune=native", as well as ffmpeg.
CPU usage with running vncserver and obs is barely noticable, slightly higher with an incoming stream.

I'm so glad this worked. :)

Stupid me ordered a hosted rpi5 because I thought the missing hevc hardware decoding was the issue.

It's good to see that even old hardware can run obs, hosted in a vnc server, what a relief.

Thanks for the help
 

Attachments

  • 2025-01-02 21-54-18.txt
    6.9 KB · Views: 9

darq

New Member
My home system however, with the nvidia card and drivers is unable to use the card, which would be funny if it weren't.
See this tigervnc issue:

So right now if you want a hardware accelerated VNC server for obs, don't use nvidia with their proprietary drivers.
 

darq

New Member
Correction: This is not quite true.
TigerVNC hwaccel with Nvidia works with x0vncserver, but not with the libvnc module or the vncserver@:n.service,
but you won't have clipboard sharing.
There's always something...
 
Top