OBS - Recorded Footage is laggy but stream quality is fine (2080ti + 3950x)

PointGrabba

New Member
Whilst streaming at a decent quality (https://www.twitch.tv/videos/641440239) to twitch at 720p 30fps on a bitrate of 2500kbps my recorded footage at 720p 30fps appears laggy. This isn't ideal as I want to edit the raw recorded footage to edit and upload to youtube.

Log File: https://obsproject.com/logs/hvWJiYAx7NV6o1cm

System Specs:
Processor - AMD Ryzen 9 3950x @4.1GHz,
GPU - RTX 2080Ti ROG Strix OC,
RAM - Corsair 32Gb DDR4 3600MHz,
MOBO - ASUS ROG Crosshair VIII Hero,

Some context:
Running OBS as an administrator, windows game mode is turned off.
C Drive (2tb nvme m.2) - OS and OBS
E Drive (2tb nvme m.2) - Games
Z Drive (12Tb HHD) - Footage

Monitors are 1440p 144hz panels set in-game to 1440p capped at 60fps (this is way under what the system can handle but I'm trying to pinpoint the recording issue).

I've tried both software encoding and Nvidia encoding for recording on different occasions with similar results.

I have also tried saving the recorded footage straight to the C drive, E drive and Z drive with the same results as I thought there may be a read issue.
Internet connection 30mb/s download and 3.5-4.3mb/s upload.


Although the biggest bottleneck to streaming for me is my upload speed its currently fine on 720p like the example given earlier. I just can't figure out why the recordings arent up to scratch.

Task Manager screenshot whilst in-game, streaming and recording:
Record issue.JPG


Any help is greatly appreciated as I've spent the better part of 7 hours troubleshooting, reading forums and adjusting settings.

Cheers.
 

carlmmii

Active Member
Code:
19:22:25.261: Running as administrator: false
Apparently you aren't running as administrator. Actually running as admin should help with nearly all the rendering lag you're experiencing.

Past that, for your nvenc settings, make sure you do not use "Max Quality", Lookahead, or Psychovisual tuning -- these use CUDA in addition to the standard nvenc encoder, which can cause issues.

The one test that stood out to me though was the x264 veryfast CRF 14 test:
Code:
23:02:21.197: [x264 encoder: 'simple_h264_recording'] preset: veryfast
23:02:21.197: [x264 encoder: 'simple_h264_recording'] profile: high
23:02:21.197: [x264 encoder: 'simple_h264_recording'] settings:
23:02:21.197:     rate_control: CRF
23:02:21.197:     bitrate:      0
23:02:21.197:     buffer size:  0
23:02:21.197:     crf:          14
23:02:21.197:     fps_num:      30
23:02:21.197:     fps_den:      1
23:02:21.197:     width:        1280
23:02:21.197:     height:       720
23:02:21.197:     keyint:       250

23:02:21.206: ==== Recording Start ===============================================
23:02:21.206: [ffmpeg muxer: 'simple_file_output'] Writing file 'C:/Users/Jamie/Videos/2020-06-04 23-02-21.mp4'...

23:04:00.236: Output 'simple_file_output': stopping
23:04:00.236: Output 'simple_file_output': Total frames output: 2924
23:04:00.236: Output 'simple_file_output': Total drawn frames: 2870 (2971 attempted)
23:04:00.236: Output 'simple_file_output': Number of lagged frames due to rendering lag/stalls: 101 (3.4%)
23:04:00.236: ==== Recording Stop ================================================
23:04:00.236: Video stopped, number of skipped frames due to encoding lag: 103/5859 (1.8%)
That's actual encoding lag... which either means you're overloading your CPU, or the bitrate you're trying to save is too high for your storage device. Both of these seem unlikely based on your hardware, which is why this is a bit confusing... I would suggest that you set your OBS priority to High in advanced settings, just to be sure.


As a side note, do not record directly to .mp4. This container format requires closing metadata written at the end of recording, so if anything happens to interrupt the recording abruptly (such as a crash), then the entire recording will be corrupted. Record directly to .mkv or .flv instead. If you need .mp4 for editing purposes, then you can remux the recording afterward (either automatically via the advanced settings, or manually through the file menu).
 

PointGrabba

New Member
Code:
19:22:25.261: Running as administrator: false
Apparently you aren't running as administrator. Actually running as admin should help with nearly all the rendering lag you're experiencing.

Past that, for your nvenc settings, make sure you do not use "Max Quality", Lookahead, or Psychovisual tuning -- these use CUDA in addition to the standard nvenc encoder, which can cause issues.

The one test that stood out to me though was the x264 veryfast CRF 14 test:
Code:
23:02:21.197: [x264 encoder: 'simple_h264_recording'] preset: veryfast
23:02:21.197: [x264 encoder: 'simple_h264_recording'] profile: high
23:02:21.197: [x264 encoder: 'simple_h264_recording'] settings:
23:02:21.197:     rate_control: CRF
23:02:21.197:     bitrate:      0
23:02:21.197:     buffer size:  0
23:02:21.197:     crf:          14
23:02:21.197:     fps_num:      30
23:02:21.197:     fps_den:      1
23:02:21.197:     width:        1280
23:02:21.197:     height:       720
23:02:21.197:     keyint:       250

23:02:21.206: ==== Recording Start ===============================================
23:02:21.206: [ffmpeg muxer: 'simple_file_output'] Writing file 'C:/Users/Jamie/Videos/2020-06-04 23-02-21.mp4'...

23:04:00.236: Output 'simple_file_output': stopping
23:04:00.236: Output 'simple_file_output': Total frames output: 2924
23:04:00.236: Output 'simple_file_output': Total drawn frames: 2870 (2971 attempted)
23:04:00.236: Output 'simple_file_output': Number of lagged frames due to rendering lag/stalls: 101 (3.4%)
23:04:00.236: ==== Recording Stop ================================================
23:04:00.236: Video stopped, number of skipped frames due to encoding lag: 103/5859 (1.8%)
That's actual encoding lag... which either means you're overloading your CPU, or the bitrate you're trying to save is too high for your storage device. Both of these seem unlikely based on your hardware, which is why this is a bit confusing... I would suggest that you set your OBS priority to High in advanced settings, just to be sure.


As a side note, do not record directly to .mp4. This container format requires closing metadata written at the end of recording, so if anything happens to interrupt the recording abruptly (such as a crash), then the entire recording will be corrupted. Record directly to .mkv or .flv instead. If you need .mp4 for editing purposes, then you can remux the recording afterward (either automatically via the advanced settings, or manually through the file menu).
Thanks for this!

Yeah the overloading or bitrate being too high is unlikely and why Im so confused this is happening haha, especially when CPU, GPU and RAM usage are barely tickling 50% overall in those tests.

Im doing some tests now:
-Running as admin
-Stream and recording preset to quality rather than max quality
- OBS process priority set to High
-mp4 changed back to mkv as I can just use remix later

Will update soon and provide log files/screenshots.

As a side note, is there any way for me to monitor disk read speeds during my test that you know of? Currently, the recorded footage is going straight to that HDD but its a Seagate 12 TB BarraCuda Pro 3.5 Inch Internal Hard Drive + 2 year Rescue Data Recovery (7200 RPM, 256 MB Cache, SATA 6 Gb/s, Up to 250 MB/s, Model: ST12000DMZ007/DM0007) if that context helps at all.


Thanks again.
 

PointGrabba

New Member
Thanks! Ill try that in the next test.

Ive just run a quick test and I'm still getting lag on the recording.

log file: https://obsproject.com/logs/z2BMGzr59LFQ9jS1

I have noticed a very slight improvement in the stream quality though.

I decided to overlay task manager for my current tests so you can see the usage in real-time: https://www.twitch.tv/videos/641841365

Running a second test now with the disk read/performance overlay. After this ill try a third test recording on a different game, could just be this game maybe.
 

carlmmii

Active Member
Something else you may consider doing is jumping onto the 2004 windows update. Since you're running multiple monitors at different refresh rates, your current version of windows may be having issues with proper framerate handling. The 2004 update is supposed to fix a lot of the issues associated with mismatched refresh rates.

Also, make sure to deselect "Rescale Output" in the output settings. This forces OBS to revert to the old NVenc method.
 

PointGrabba

New Member
Second Test with disk performance overlay: https://obsproject.com/logs/KJcnDVPGWT1C5q7P

There Doesn't appear to be any read/write errors or speed issues.

Recording still laggy. In this instance, my stream quality wasn't great either with noticeable lag and my bitrate was tanking (on red).
https://www.twitch.tv/videos/641847463
Prior to this my bitrate and stream have been great quality at 720p on a bitrate of 2500-2600kbps.

Is it possible that there is an encoding error due to the game being run at 60 fps on a 144hz panel being streamed and recorded at 30 fps? Or does the fact that the stream quality is decent with no lag prove this isn't the issue?

My biggest worry at this point is that the issue may partly be due to my low upload speed but im not sure how that would affect recording a game from the same PC. Also from various forums, I could find my settings should only max at about 3mb/s bitrate on the stream anyway to give myself some wriggle room:

Speed test 05062020.JPG
 

PointGrabba

New Member
Strange. After closing both the game and OBS and showing my partner the footage on both the stream and my video files the later recordings seem to be decent quality with no lag.

Is there any reason why trying to watch the recordings with the game still on (not streaming or recording) you might expect lag when watching a video on a HDD that doesn't have any games or programs on it?
 

PointGrabba

New Member
There is still a very slight lag, but no way near as bad as when trying to watch the recordings with the game / obs on.

It may even be the case that when I process these recordings and upload that there is essentially no lag?
 

carlmmii

Active Member
What program are you using to play back your recordings?

Also, you're probably running into the issue of running multiple monitors at different refresh rates. If you have a game running, that requires hardware acceleration for whichever monitor it's running on, which is the specific issue. If only one monitor has hardware accelerated content on it, then there is usually no issue.

Again, the 2004 update should fix this.
 

PointGrabba

New Member
Playback for the recordings look fine now in my editing software (DaVinci resolved 16) with no lag now. At least the last three clips I have taken after making some changes to obs settings that we discussed. Both the preview of mkv in windows media player and when remuxed to mp4 look fine. The mp4 looks fine in Davinci resolve 16 too!

I haven't implemented the 2004 update yet, but this will be the first thing I try if playback recordings look laggy in future.

Thank you so much for your help! :)
 
Top