Question / Help High % of skipped frames due to encoding lag Fedora, Nvidia, NVENC

dzintars

New Member
Hi. I'm pretty new in all this screen recording thing and in Linux overall as well.
I managed to install Nvidia 440 signed drivers and OBS 24.0.3 (64 bit) on Fedora 31. In Advanced output mode I have options NVIDIA NVENC H.264, FFMPEG VAAPI and x264 available in Streaming and Recording sections. I managed to get audio to wok as well. Everything works and i can record video.
But issue is with Skipped frames due to encoding lag 3929 / 4034 (97.4%).
While picture quality and colors is really perfect, video itself looses most of the frames. Like... it records fine for first 3-5 seconds and them drastically drops frames like fame per second or so.
My PC is not the newest one, but it is as it is.
i7-4960X Processor Extreme Edition
64GB RAM
SSD Raid10
GTX 760 (For recording and daily tasks)
RX 580 8GB (Secondary, not incorporated in any recording activities)

Anyway, IMO i should be able to get decent screen recording performance out of this old boy.

I am not sure what logs or errors i should look for to have any hints about my encoding frame drop issue.

I am using i3wm and compton (with glx).
I tried to turn off "Allow Flipping" in nvidia-settings. Don't see any improvements.
Removed and re-installed obs-studio.
Installed `sudo dnf install xorg-x11-drv-nvidia-cuda` (and fixed Plymouth issue which came along with this command).
Noveau is disabled.

I tried to record by using CPU and x264. It records perfectly super great, but it eats up like 8-9% of CPU, which is important to me as i need to run several virtual machines while recording and i need that CPU power.

`ffmpeg -codecs | grep nvenc` - shows that i have `h264_nvenc nvenc nvenc_h264 nvenc_hevc` and `hevc_nvenc`.

For sure i tried to change Bitrate as low as 2500 Kbps and as high as 50000 Kbps. No any noticeable differences. I tried to change Rate Control as well with no any luck.

In Simple Output Mode i have option Hardware (NVENC) option and 2 x264 Software options. Hardware (NVENC) does not work as well. I assume, that the same as in Advanced mode. Not sure why naming is different for the same encoder.

Recording Format also has no any effect on final result.

I don't see any noticeable errors or lags while doing those recording tests.

I added one of my log files.

I would be grateful for any hints.
 

Attachments

  • 2019-12-05 21-47-35.txt
    13 KB · Views: 37

Narcogen

Active Member
If you're doing local recordings with NVENC and not live streams, use CQP rate control with a value between 15 (high quality) and 23 (good quality) rather than CBR.

You're got a canvas and output resolution of 2560x1080 on a 7xx series card, and using NVENC on that you're getting encoding lag:

09:48:15 PM.255: Video stopped, number of skipped frames due to encoding lag: 1491/1703 (87.6%)
10:07:26 PM.711: Video stopped, number of skipped frames due to encoding lag: 6173/6259 (98.6%)
10:41:55 PM.070: Video stopped, number of skipped frames due to encoding lag: 1607/2003 (80.2%)
10:50:21 PM.004: Video stopped, number of skipped frames due to encoding lag: 1028/1386 (74.2%)


The best way to reduce that would be to reduce your canvas resolution and require your GPU to encode fewer pixels, or reduce your framerate. This amount of dropped frames means you are not close to being able to do what you want-- you're not a small adjustment or two from being able to do it, you're asking significantly more of your GPU than what it is able to do.

10:11:29 PM.777: YUV mode: 709/Full

This also increases load for no good reason, as most displays do not support this color space, and the result will actually look worse in most circumstances. Consider changing to the default which is 709/Partial.

https://obsproject.com/forum/resour...t-color-range-settings-guide-test-charts.442/
 
Top