Open ninbura opened 3 months ago
Please run the test again in a portable build or with no third-party plugins installed. I am wondering if scaling disables parts of those plugins and causes the drop in rendering time. As it stands in vanilla OBS, this shouldn't be happening, and does not happen for me. Render times are identical regardless if scaling is enabled or not.
Just ran the same test in portable mode and got the same results.
https://github.com/user-attachments/assets/7f914f54-81f9-46f3-ae44-d1ff3a001bbf
This is probably just due to the GPU switching to a higher clock speed once you're scaling, resulting in the average time to render going down. Use a tool like GPU-Z to monitor the clock speed (the nvidia overlay is broken with the latest drivers): https://www.techpowerup.com/download/techpowerup-gpu-z/
This is probably just due to the GPU switching to a higher clock speed once you're scaling, resulting in the average time to render going down.
This seemed plausible. A few years back I noticed I would get higher render times in OBS when my GPU clock was lower, so I started making sure that "Prefer maximum performance" was enabled in Nvidia control panel. This seemed to keep my GPU at the highest possible clock regardless of workload, and that still appears to be the case.
Typically I use HWiNFO for monitoring, but I installed GPU-Z just to have a second a opinion. My clocks look rock solid regardless of OBS being open or closed, and/or if I'm streaming, scaling, etc.
https://github.com/user-attachments/assets/d8e9d535-cedb-4dd6-a3e2-43a9b26fc28f
I think the most noteworthy thing here is that render times are only high when I'm streaming without scaling & with Virtual Camera running. If I turn off Virtual Camera or if I enable output scaling; render time returns to what you'd expect.
Output scaling must be meaningfully changing some process internally.
More relevant info - can't replicate issue on OBS v29.1.3
.
I remembered complaining on Discord about my render time increasing when I updated OBS a while ago. Dug through my Discord message history and sure enough... found the message. It was when I updated from OBS v29.1.3
to v30.0
.
I just ran the same test on v29.1.3
and render time does not double when streaming to YouTube at 2560x1440 without scaling & with Virtual Camera running. I did a test back to back with v29.1.3
& v30.2.2
, both in portable mode, same machine, identical settings, and the same source.
1.2ms
2.7ms
https://github.com/user-attachments/assets/e5c7c2da-692f-4460-a9a3-9f6c8b4a2c4f
Tested on an alternate PC and observed the same result.
v29.1.3
& lower.0.8ms
1.5ms
https://github.com/user-attachments/assets/bcf5f7ba-3978-4005-90a3-17996f29363c
Obviously, with these tests the average render time would be considered low regardless of the differing results. But the average render time is only that low because of the extremely simple configurations. Single scene, single source, etc.
However, in a real-world scenario on my capture system with complex scenes composed of many AV sources; I get peak average render times over 16ms
, resulting in dropped frames. This occurs with a 4K canvas when streaming to YouTube & Discord, while also recording locally. If I rescale my output, or if I run OBS v29.1.3
, my average render time drops by around 4ms
. Giving me the headroom I need to avoid "Frames missed due to rendering lag".
Same behavior on my work laptop, running Windows 11, connected to a RTX 3050 via Thunderbolt enclosure. However, I'm not streaming with this one, just recording.
With Virtual Camera enabled, if I scale my recording output from 1080p to 1440p my average time to render frame is cut in half.
I tested on my MacBook and did not witness the same issue. Render time does not decrease with scaling on the output.
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
30.2.2
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://drive.proton.me/urls/4FCVACQ1KC#wisNreIefBOl
OBS Studio Crash Log URL
No response
Expected Behavior
OBS should have the lowest average frame rendering time when streaming at the same resolution as your canvas. Regardless of whether Virtual Camera is running.
Current Behavior
OBS reports less than 1/2 the average frame rendering time when output is scaled vs non-scaled while Virtual Camera is running. This is true even when upscaling the output. One would assume that performance would decrease, not increase, when upscaling the output.
Steps to Reproduce
Anything else we should know?
I would like access to whatever pipeline grants this performance uplift without the need to scale. I want a base canvas of 3840x2160, and to stream at 3840x2160 without my average frame rendering time doubling. Unfortunately, this "hack" doesn't work when trying to "re-scale" your output to the same resolution as your canvas. I need to keep Virtual Camera enabled as this is how I stream to Discord & Microsoft Teams. I consistently stream to YouTube & one of the aforementioned applications simultaneously.
video demonstration
https://github.com/user-attachments/assets/d62a5ca5-063d-43fa-95a8-75980c88dd6c
test stream links