Question / Help Encode lag when recording, only source is capture card.

ENunn

Member
Hey it's me again, having usual issues that are probably not a huge deal.

My issue with capture cards duplicating frames in the preview/video file from 3+ years ago has been fixed somehow but now I'm having another problem. My only source is a capture card (Avermedia LG4K). I'm recording with new NVENC, but I'm getting encode lag. Sometimes I overload. What could cause that if there's only one source? My settings are fine, at least I think.

ASUS Prime Z390-A
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Zotac NVIDIA GeForce RTX 2060 6 GB
Corsair Vengeance LPX 16GB (2x8GB) DDR4 DRAM 3000MHz C15
Samsung 960 EVO 500GB M.2
Seagate BarraCuda 2TB + 4TB Internal Hard Drive

Hope this is the right log file: https://obsproject.com/logs/n_nd9DL9v3MGj5UE
 
Last edited:

FerretBomb

Active Member
Two potential problems.
One, you're still running disparate refresh rates between your primary monitor, and the other three. This IS going to continue being an issue until you run ALL of your monitors at the same refresh rate.
Two, you either have 2-pass enabled as an option in NVENC, or are using the Max Quality preset. Uncheck it, or switch to the Quality preset instead, as appropriate. 2-pass/MQ uses CUDA cores, and CUDA-enabled options can and will cause rendering and encoding lag even in not fully loaded situations.
 

ENunn

Member
This time I'm recording just consoles so I shouldn't be having any refresh mismatch issues. I don't even notice any in my recordings, I'm going frame by frame and all frames are unique (other than games with different framerates or the encode/render lag issues).

It doesn't matter if I use Lossless, Max Quality, Quality, it's still overloading.

For the hell of it I installed the latest Windows 10 Insider Preview build earlier today and it did fix the refresh rate bug, but it introduced audio problems with my capture card so I had to roll back.
 

FerretBomb

Active Member
Recording consoles or not, the compositor issue is still present. It isn't capture-specific. Turn the refresh rate down to match your other monitors.
Please provide a clean logfile after doing so with the Quality preset selected, 2-pass disabled, Psychovisual tuning disabled, and Lookahead disabled.

Again, I'm trying to assist in getting your issue fixed. If you tell me that something is not a problem that I am all too aware IS the root cause of many problems, I'm not going to be able to help. Maybe someone else will have another idea; best of luck to you.
 

ENunn

Member
Sorry about all that, I appreciate you trying to help :)

I just did what you said, all my monitors are at 60hz and its still doing encode lag. Using quality and no look ahead/pvt. Not sure what's doing it.

There's a couple recording tests in this log with Max Quality but the last one should be the one that was using Quality.
 

Attachments

  • 2020-04-09 23-00-26.txt
    20.4 KB · Views: 58

carlmmii

Active Member
For whatever reason, the program is defaulting back to the old Nvenc encoder. Could you post a screen cap of your output settings?

Normally I'd say just a few frames of encoding lag is barely anything to be worried about, but something is definitely going on here.


Something else about encoding lag... the storage device can also create a bottleneck. Have you tried using a higher CQP value, and outputting directly to your SSD?
 

ENunn

Member
Really? I don't see anything in my log (then again I don't even know what's going on in the log lmao)
Here's my output settings.
1586496336663.png

I've recorded stuff on this recording drive just fine. It's a 4TB 5400RPM drive that I've had for a little over a month now. I'm only using it for recording. I'm testing recording to my SSD right now, I'll get back to you when I can. Regardless though I'm not gonna be recording all the time on my SSD for its sake. I don't think its healthy for the drive.
 

carlmmii

Active Member
Code:
23:17:30.562: [NVENC encoder: 'recording_h264'] settings:
This is saying that it's using the old Nvenc encoder.

The new Nvenc encoder will say "jim-nvenc" instead of "NVENC encoder". Based on the screenshot, I'm honestly at a loss as to why it would be reverting back to the old encoder -- this usually only happens when you're using the rescale option.

As far as recording to SSD vs HDD, this is entirely for troubleshooting purposes. Testing until things change. If nothing changes, we can rule it out.
 

ENunn

Member
Interesting.

Alright I did a 20 minute recording on both my SSD and my recording drive, no encode lag on the SSD but there's two skipped on the HDD. It's still forcing the old NVENC on both drives. It's really odd too, Mediainfo says it's recording at 45mpbs (at least in the scene I'm recording since CQP is VBR which I don't mind) yet I can record hours of lossless 1080i/1080p video with Amarec (talking around 346 Mbps) with no dropped frames on the same drive. Log's attached.

I'll probably try reinstalling the GPU driver but I doubt it'll fix it.

I saved some old log files dating back to last month (March 1-2) because I was about to do a clean reinstall of Windows (I did a motherboard swap a couple months before because of RAM issues on the first motherboard hence why I did it), apparently this has been an ongoing issue. The log said that it was using the old NVENC. One of the logs said it was using the new NVENC though.
 

Attachments

  • 2020-04-09 23-59-21.txt
    19 KB · Views: 11
Last edited:

ENunn

Member
Double post since the editing window is up.

I switched my color space to NV12 and it's switching to new NVENC. Switching it to anything else falls back to the old one. I'm trying to record in 4:4:4 for better color accuracy and I'm pretty sure that the new NVENC supports 4:4:4. I wonder if any OBS devs can have a say on this.
 
Last edited:

ENunn

Member
Well there we go, thanks for confirming it. I wonder why it's like that?

I'm messing around with Xaymar's StreamFX plugin, NVENC H.264 and H.265, I haven't notice any encode lag but I'm still doing some tests with it.
 

ENunn

Member
I guess I'm SOL. Encode lag still happens with StreamFX. Wish there was a good way of recording 4:4:4 without any issues but I guess that's a long ways away. RECentral is 4:2:0 only, Amarec is lossless so it takes up a lot of space, OBS overloads because it's using old NVENC, what a shame. Hope 4:4:4 support gets added for the new NVENC. I've been really wanting to record 4:4:4 for a long time.
 

ENunn

Member
I FIXED MY ISSUE.

Get this, I had to use the ffmpeg custom output to get this working without any encode lag.
1586641603530.png


Crazy stuff. I don't know if the "-cqp 14" flag actually made it record at cqp 14 but doing some pixel peeping it seems to be still visually lossless.

Appreciate all the help fellas.
 

ENunn

Member
Sorry for bringing this up again, but I thought of something. Could an overclock cause encode lag? I overclocked it a little a long time ago and I wanted to know if that could be a cause.
 

ENunn

Member
Hmmm. It's so odd now since I'm having a similar dilemma with a similar issue. Only difference is that I'm using my normal streaming scenes (so Elgato Cam Link for my camera, browser sources for chat/streamlabs and some text) and it is indeed using new NVENC at NV12, CQP 20, Quality and no look ahead of psycho visual tuning. I'm having random spikes of encode lag on my webcam scene alone. I don't know if it's happening anywhere else since I haven't tried it yet.

I've already posted enough so I don't want to spam the forums of threads on similar issues.

Here's a log file: https://obsproject.com/logs/LMe51ad829MnXVDD

My HDD has plenty of space, are 5400RPM's just not enough? I remember testing recording on my other 7800RPM drive and I had the same problem so I doubt it. What could be causing random encode lags now? I don't have anything else running other than Chrome or Discord.
 

Xaymar

Active Member
I guess I'm SOL. Encode lag still happens with StreamFX. Wish there was a good way of recording 4:4:4 without any issues but I guess that's a long ways away. RECentral is 4:2:0 only, Amarec is lossless so it takes up a lot of space, OBS overloads because it's using old NVENC, what a shame. Hope 4:4:4 support gets added for the new NVENC. I've been really wanting to record 4:4:4 for a long time.

The NVENC integration in StreamFX is done via FFmpeg, which does not support zero-copy 4:4:4 encoding yet. This might be fixed in the future, or it might not - really just depends on the will of any developer to pick the keyboard and start hammering away at 4:4:4 support in FFmpeg.
 
Last edited:

ENunn

Member
The NVENC integration in StreamFX is done via FFmpeg, which does not support zero-copy 4:4:4 encoding yet. This might be fixed in the future, or it might not - really just depends on the will of any developer to pick the keyboard and start hammering away at 4:4:4 support in FFmpeg.

late but thanks for the clarification. now i'm just gonna focus on fixing my random encode overloads when RECORDING.

so my cpu/gpu temps are fine, cpu/gpu usage is low, everything's up to date, ran as admin, reinstalled gpu drivers, reinstalled obs, changed settings, nothing has really helped me. verified that there's no hardware issues or anything.

i usually record while i'm streaming, tried streaming only and there wasn't really any issue (in my limited testing). when i record though it starts having issues, it still happens when i ONLY record. i'm pretty stumped, is there anything i can do or do i have to just deal with unecessary encode overloads that shouldn't happen in the first place? i have a 2060 and I'm using the new nvenc encoder, there should be no issues. i wouldn't mind 1 or 2 every so often bit 20/30/60+? it kinda worries me, mainly because there's spikes of freezing in my streams/recordings. i'm pretty stumped so if anyone has any possible fixes i'd appreciate it. does it affect anything at the end of the day? probably not, it just makes no sense when my pc is more than capabale of streaming and recording with no issues. guess i'm just unlucky lol

here's a log if anyone's interested:
 
Top