Missing frames and rendering lag with barely used GPU/CPU

NioZero

New Member
Hi OBS team.

I hope you can help me, because I tried a lot of things but I keep having issues. I have a dedicated capture/streaming desktop and for some reason is missing a lot frames and have rendering lag. If I reduce the resolution, the framerate or the bitrate, the results doesn't change. I am using NVENC encoding but I have also tried the x264 encoding with the same results. I have upload the log to the analyzer but the suggestions doesn't work for me because this is a dedicated PC and it seems like the suggestion are from a traditional setup. My PC has plenty of resources to render a more complex scene and it's rarely used for other purpose. The framerate is always in the range of 55~56fps, but when I reduce the framerate, like for example 30, is now at 27~28 fps.

Things I tried
- reducing resolution
- reducing framerate
- reduced bitrate or recording local only
- changed from NVENC to x264 with different profiles
- created a more simple scene with fewer elements

The hardware is the following
CPU: AMD Ryzen 7 3700X
GPU NVIDIA GTX 1660 super
RAM: 16 GB
Capture Card: elgato 4K60 Pro MK.2

This is some screenshot with my latest stream (here's the VOD with the notorious lag)
I
Capture_2021-12-08_020144.png


The GPU is always lower thant 50% and the CPU is barely in the 10%...
Capture_2021-12-07_210743.png


I don't know what is causing the issue, maybe some specific element or something else. Is there a way to know what is causing the lag? I have uploaded the log and here is the analyzer results

 

Attachments

  • 2021-12-07 21-02-34.txt
    108.8 KB · Views: 24

qhobbes

Active Member
AFAIK the replay buffer uses the recording settings. Change preset to quality and uncheck lookahead and psycho.

21:04:41.460: [jim-nvenc: 'recording_h264'] settings:
21:04:41.460: rate_control: CQP
21:04:41.460: bitrate: 0
21:04:41.460: cqp: 18
21:04:41.460: keyint: 120
21:04:41.460: preset: mq
21:04:41.460: profile: high
21:04:41.460: width: 1920
21:04:41.460: height: 1080
21:04:41.460: 2-pass: true
21:04:41.460: b-frames: 2
21:04:41.460: lookahead: true
21:04:41.460: psycho_aq: true
 
Last edited:

koala

Active Member
Is this a custom built PC? The Graphics card might not be operating in full x16 pci-express speed. Use GPU-Z and verify that in the "Bus Interface" field the x16 is displayed on both sides of the @, i. e. something like "PCIe x16 3.0 @ x16 3.0".
If it is lower, verify the seating of the card. It must be in a x16 capable slot. If there are multiple wide slots, it's usually the slot nearest to the CPU that has to be used.
 

NioZero

New Member
AFAIK the replay buffer uses the recording settings. Change preset to quality and uncheck lookahead and psycho.

21:04:41.460: [jim-nvenc: 'recording_h264'] settings:
21:04:41.460: rate_control: CQP
21:04:41.460: bitrate: 0
21:04:41.460: cqp: 18
21:04:41.460: keyint: 120
21:04:41.460: preset: mq
21:04:41.460: profile: high
21:04:41.460: width: 1920
21:04:41.460: height: 1080
21:04:41.460: 2-pass: true
21:04:41.460: b-frames: 2
21:04:41.460: lookahead: true
21:04:41.460: psycho_aq: true

This makes a lot of sense. I will try lowering the quality of the recording and/or disabling replay buffer just in case is that. I have a question about that option though.

Capture_2021-12-09_154044.png


"Maximum Memory" is related to GPU VRAM? RAM? or hard disk space?



Is this a custom built PC? The Graphics card might not be operating in full x16 pci-express speed. Use GPU-Z and verify that in the "Bus Interface" field the x16 is displayed on both sides of the @, i. e. something like "PCIe x16 3.0 @ x16 3.0".
If it is lower, verify the seating of the card. It must be in a x16 capable slot. If there are multiple wide slots, it's usually the slot nearest to the CPU that has to be used.

I checked GPU-Z and is fine. The GPU is in the main PCIe Slot and I always keep the drivers up-to-date.

This is the GPU-Z info if you're interested..
Capture_2021-12-09_153658.png


The current video drivers installed...
Capture_2021-12-09_153859.png
 

NioZero

New Member
So...

I did the following
- Reduced resolution to 720p
- Disabled Replay Buffer
- Change Recording to (use stream settings)

The results were practically the same. The GPU usage was obviously a little lower (30% at most) and the lag was the same.
Capture_2021-12-10_232742.png


I really don't know why is happening this. I hope you can help me.



Log Analyzer: https://obsproject.com/tools/analyzer?log_url=https://obsproject.com/logs/MYYdd4DMcOuvYnXZ

I have attached also de log
 

Attachments

  • 2021-12-10 21-02-48.txt
    89.2 KB · Views: 20

FerretBomb

Active Member
Most commonly (as you are not using any CUDA-enabled encoding options) this is caused by either a capture conflict (but you aren't using any Monitor Captures), or a slow browser source which is unable to update in a timely fashion for each frame. Especially-so in cases where there are bandwidth stability issues (as appears to be the case from your logfile, during the streaming session).

If you run a test-stream with a fresh Scene Collection, does the frame delay issue still occur?

If you create a test log (as you did above) then exit out of OBS, restart OBS, go to Help->Log Files-> Upload Last Logfile, it will include a timing tree which is generated on exit which we can look over for more detailed analysis and hints on what's gumming up the works.
 
Top