Persistent Rendering Lag Issue

TheAexer

New Member
Coming to this forum because I've exhausted every internet fix that I've tried over the last two months and still scratching my head over this one.

I run a dual PC setup, and the issue is happening on the Recording/Stream PC side of things. From what I've seen, I shouldn't really be running into rendering issues, and hadn't had any until a few months ago.

The issue that I have is an intermittent rendering lag, accompanied by a drop in FPS on stream. I launched OBS using the administrative mode dialogue and set the program to high priority and CPU and GPU utilization remain consistently below 40% when monitoring on Task Manager.

I have tried every solution on from the OBS Log Analyzer, and several forums and have not had any success. Issue persists when even when offloading encoding to nvenc.

Hoping to pull suggestions from the community who are more knowledgeable on the subject.

Any ideas of what is causing the render lag and how to mitigate it?

Sample OBS log with the rendering issue:

PC Specs:
OS: Windows 10 Build 19045
CPU: AMD Ryzen 9 5900HS
GPU: NVIDIA 3060 mobile
RAM: 40 GB 3200 MHz
Disc: 1TB SSD Samsung MZVLQT)HBLB-00B00
 

rockbottom

Active Member
You're going to need to address all of these errors....

23:15:34.014: [obs-browser: 'Overlay GameCapture'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:869)
23:15:35.289: [win_spout] [Vtuber-Model01] Getting info for sender veadotube mini (launched at 11:15:34 PM)
23:15:35.289: [win_spout] [Vtuber-Model01] Sender veadotube mini (launched at 11:15:34 PM) is of dimensions 1280 x 720
23:15:35.291: [win_spout] [Vtuber-Model01] rendering context->texture
23:15:35.623: [win_spout] [Vtuber-Model01] Sender veadotube mini (launched at 11:15:34 PM) has changed / gone away. Resetting
23:15:36.289: [win_spout] [Vtuber-Model01] Getting info for sender veadotube mini (launched at 11:15:34 PM)
23:15:36.289: [win_spout] [Vtuber-Model01] Sender veadotube mini (launched at 11:15:34 PM) is of dimensions 1916 x 1046
23:15:36.290: [win_spout] [Vtuber-Model01] rendering context->texture
23:16:13.261: User switched to scene 'Start'
23:16:14.356: [win_spout] [Vtuber-Model01] Getting info for sender veadotube mini (launched at 11:15:34 PM)
23:16:14.356: [win_spout] [Vtuber-Model01] Sender veadotube mini (launched at 11:15:34 PM) is of dimensions 1916 x 1046
23:16:14.532: [obs-browser: 'Starting Overlay'] Error: Uncaught (in promise) AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22 (https://streamelements.com/overlay/scripts/vendor.js:25125)
23:16:14.586: [obs-browser: 'Starting Overlay'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

23:28:08.444: [obs-browser: 'Overlay GameCapture'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:869)
23:28:22.934: User switched to scene 'Start'
23:28:24.123: [win_spout] [Vtuber-Model01] Getting info for sender veadotube mini (launched at 11:15:34 PM)
23:28:24.123: [win_spout] [Vtuber-Model01] Sender veadotube mini (launched at 11:15:34 PM) is of dimensions 1916 x 1046
23:28:24.415: [obs-browser: 'Starting Overlay'] Error: Uncaught (in promise) AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22 (https://streamelements.com/overlay/scripts/vendor.js:25125)
23:28:24.503: [obs-browser: 'Starting Overlay'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:869)
23:28:29.142: User switched to scene 'BRB'
23:28:30.228: [obs-browser: 'BRB Overlay'] Error: Uncaught (in promise) AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22 (https://streamelements.com/overlay/scripts/vendor.js:25125)
23:28:30.326: [obs-browser: 'BRB Overlay'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:869)
23:28:33.175: User switched to scene 'End'
23:28:34.267: [obs-browser: 'End Overlay'] Error: Uncaught (in promise) AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22 (https://streamelements.com/overlay/scripts/vendor.js:25125)
23:28:34.367: [obs-browser: 'End Overlay'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:3)
23:28:34.407: [obs-browser: 'End Overlay'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:869)
23:28:40.719: User switched to scene 'Start'
23:28:41.783: [obs-browser: 'Starting Overlay'] Error: Uncaught (in promise) AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22 (https://streamelements.com/overlay/scripts/vendor.js:25125)
23:28:41.890: [obs-browser: 'Starting Overlay'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:3)
23:28:41.942: [obs-browser: 'Starting Overlay'] Error: Refused to apply style from 'https://unpkg.com/animal-crossing@8.2.0/lib/index.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (about:srcdoc:869)
 

Suslik V

Active Member
Full log-file has profile data. It is better to post full log-files (logs that were finalized after OBS closed). From performance profiler you can guess that the lag was caused by slow source or, for example, by wrongly configured hardware.
 

TheAexer

New Member
Full log-file has profile data. It is better to post full log-files (logs that were finalized after OBS closed). From performance profiler you can guess that the lag was caused by slow source or, for example, by wrongly configured hardware.
I can do that, where are the full logs stored by default?
 

TheAexer

New Member
The Elgato is at 44k.

Fairly certain your rendering lag is being caused by the SE/overlay failures above.
Thanks, I'll try cutting out the browser sources to see if that helps.

Let me run another test without the browser sources to see if render lag persists. I'll upload the log new log file after running a stream test.

It seems weird to me that the Elgato audio sample rate is at 44 kHz, since in control panel it is listed at 48 kHz. I'll try seeing if it is being resampled somewhere.

Thank you everyone for helping track this down. I really appreciate it.
 

TheAexer

New Member
Thanks everyone, the issue is noticeably better after removing the SE browser sources that were producing errors, although still dropping FPS and having slight render lag occasionally. (I'll take 0.6% over 4% any day of the week).

I looked into the Elgato sampling rate showing as 44.1 kHz and that appears to it's own issue that requires some janky workarounds.

If anyone has any suggestions for trying to minimize that last 0.6% render lag I would be grateful. Both log files are listed below.

Current log:
 

Attachments

  • 2024-03-17 05-58-46.txt
    18.8 KB · Views: 15

rockbottom

Active Member
Some improvement but the attached log is still ugly, SE errors. The uploaded log doesn't contain an encoding session or any additional info.

Looks like SE has been previously installed. If so, it needs to be removed along with OBS. Re-install just OBS.

Have you tried a new Profile using just (1) Scene/Source?
 

TheAexer

New Member
Some improvement but the attached log is still ugly, SE errors. The uploaded log doesn't contain an encoding session or any additional info.

Looks like SE has been previously installed. If so, it needs to be removed along with OBS. Re-install just OBS.

Have you tried a new Profile using just (1) Scene/Source?
When I checked the current log link, that I posted, it looked nothing like the log that I read. This must be from a different OBS instance sometime before I started removing browser sources. Thanks for staying patient with me through that snafu.

I just ran another stream test with the SE browser source removed and double checked the log file.

SE should not be installed, unless it somehow managed to survive a factory reset of the OS (removing all files) and a fresh OBS install.

I recently rebuilt my scene collection one piece at a time while testing, but was not looking at the log file.
 

TheAexer

New Member
When I checked the current log link, that I posted, it looked nothing like the log that I read. This must be from a different OBS instance sometime before I started removing browser sources. Thanks for staying patient with me through that snafu.

I just ran another stream test with the SE browser source removed and double checked the log file.

SE should not be installed, unless it somehow managed to survive a factory reset of the OS (removing all files) and a fresh OBS install.

I recently rebuilt my scene collection one piece at a time while testing, but was not looking at the log file.
The most recent log file without the Streamelements browser sources doesn't seem to have any errors other than one related to loading AMF, but I think that this is just an initial startup error and shouldn't carry over into any recording/streaming since I have not told OBS to use the integrated AMD graphics for anything and my global settings should prioritize the discrete NVIDIA GPU for rendering. (Unless it does then please correct me, I am new to reading through OBS logs)
 

rockbottom

Active Member
The log looks good now, rendering lag is gone.

You are running on the 3060, any reason you're not encoding with it too? Record @ 60FPS...

If you're not going to do any encoding with the iGPU, I recommend going into BIOS & disabling it.
 

Suslik V

Active Member
So what Suslik V was asking for was an upload of the .txt log file rather than the link generated by the upload current log file?
as you wish. If you restart OBS you can upload Previous log-file (this option in OBS Help menu was made exactly for this purpose - to upload right log-file if something wrong happened to OBS and program was terminated in an unusual way). Or you can find right log-file manually by time and date.
 

TheAexer

New Member
The log looks good now, rendering lag is gone.

You are running on the 3060, any reason you're not encoding with it too? Record @ 60FPS...

If you're not going to do any encoding with the iGPU, I recommend going into BIOS & disabling it.
I had run into encoding lag when using nvenc and I experienced zero encoding lag on x264 . Since This is the Stream PC and I run programs on the dedicated workhorse there isn't much reason for me to use nvenc. If I try to iron that issue out, I'll make a separate thread.

Running at 30 FPS is for my viewers since alot of them have issues running 60 FPS on Twitch. I tick it up to 60 FPS and drop down to 720p for high motion content, but this might change if NVIDIA transcoding comes out.

All of this might change when NVIDIA transcoding officially comes out.

All that is left is the question as to why StreamElements overlays started throwing error codes this bad when it had not before, but let's be honest, it's StreamElements and that might be an exercise in insanity. (unless there are any SE devs in the community)

Again, thanks for all your help rockbottom, also for the info on the reason for the AMF error.
 

rockbottom

Active Member
Gotcha! There shouldn't be any encoding lag with NVENC going forward. Use Preset P5 or lower & set multipass to qres or Single Pass when you try it again.

No idea, never used it, just know that it causes nothing but trouble when it goes sideways.
 

TheAexer

New Member
Unfortunately, I was still getting intermittent rendering lag after more than 20 minutes.

Fortunately, I figured out where it was coming from, but not before dissecting every scene and source in OBS for days. I am leaving what solved the issue for anyone else in this position.

My rendering issue was coming from two sources.
  1. Elgato Capture through Video Capture Device source together with the microphone through audio input capture
  2. Using any VST audio plugin filters.
Here is my theory as to why this happens (just a theory, kind of impossible to prove)

I believe that the first issue is due to a bug in OBS regarding capture cards that I have seen documented by a couple of people without any solution and that rockbottom pointed out. OBS initializes the Elgato capture at 48 kHz sample rate but then switches it to 44.1 kHz, but Elgato cards do not support 44.1 kHz sample rates. When you add other audio sources that are truly 48 kHz sample rates, it causes issues with the timing that result in dropped samples which cannot always be resolved in the 33 ms window for rendering a frame (at 30 FPS)

The second issue has to do with the amount of latency that certain sound filters add. We have about 33 seconds to render a frame, but the Equalizer and Noise reduction plugins that I was using add ~40 ms of latency. I can't be sure of this since I have not delved into the code, but OBS seems to be trying to wait for the filters to compute instead of letting the audio sync with later frames.

I solved this by capturing the Elgato video in the Elgato 4K Capture Utility with the Window Capture source, and running all audio through Voicemeeter, where I applied all audio filters, and then routed the audio into OBS.

The only audio filters that I used in OBS was the native Limiter filter to avoid peaking on browser sources.

It seemed very silly, but in this setup, all render lag has been eliminated other than a single dip whenever switching to the scene with the Window Capture scene, which isn't perfect, but is not actually noticeable in recordings.

To be clear, this causes a non-negligible increase in CPU and GPU resource usage, but in my case, I was not CPU or GPU limited since I was using a dual PC setup and still do not use more than 40% CPU or GPU load.

I have tested and added back in some browser sources. Even though they throw errors in OBS logs, they do not appear to be contributing to the render lag.

Here is the most recent OBS log to showcase this. I would say that only 3 missed frames in 50 minutes is enough for me to consider the problem solved.

 

rockbottom

Active Member
I suggested a new Profile 5 days ago, it would have saved some time....

Log does look better but the iGPU is still active. Since it doesn't encode & the 3060 is in there, you should disable it.
 

TheAexer

New Member
I suggested a new Profile 5 days ago, it would have saved some time....

Log does look better but the iGPU is still active. Since it doesn't encode & the 3060 is in there, you should disable it.
Thanks for suggesting that. I had already tried rebuilding the scenes multiple times before, but your comments helped me to go back and check for issues with certain combinations of filters and sources that I would not have thought to check otherwise. It still took several days and guesswork to narrow everything down, but your pointers literally saved my sanity. Thanks!

The iGPU is used for other tasks on the computer. Disabling the iGPU causes issues with other programs since this is a laptop so that will need to stay on.
 
Top