Which Encoder should I use?

Shaggy

New Member
I'd imagine this question comes through several times a day, but I couldn't find one similar to my scenario.

So I'm trying to record and/or stream DCS World in VR. I've got the OpenVR Plugin, as it is to my understanding that having the DCS application mirror set to a smaller resolution will be less taxing on the system, and simply using OpenVR to capture that VR output would be more beneficial. I'm trying to go for a 4:3 output for best visibility in the cockpit (and viewers can simply stretch the view to 16:9 if they wish), so the current resolution is set to 2560x1920. This gives full 1080p support for those who wish to view in full 16:9. Streaming bitrate is set to 5000Kbps, nothing too extravagant, I know that it won't be the highest quality but it does the job. Recorder bitrate is set to 10000Kbps.

As for encoders.. I'm at a loss. DCS is a VERY heavy program to run. When recording or streaming, there's periods where it's doing fine, but it often gets choppy and I lose frames on both the recording and the stream - and I like to go back over my flight to analyze it. I've got Tacview for the global map view so I can run down tactical errors, however it doesn't help with the smaller errors. Nonetheless, the recording/stream being choppy isn't beneficial.

The way I'm set up right now is with two graphics cards. The headset and monitor is set up on an RTX2080S, and I've still got my old GTX1080 in the rig, which I was hoping to use as the encoding GPU for streaming and recording. It's set up as NVENC 264 for both recording and streaming, both under CBR.

I really can't figure out why it's stuttering so much. It's set to record to an NVME drive (different than OS and game install location). If it also helps, I'm running an AMD Ryzen 3700x processor, but I really don't think I should be using the processor for encoding with DCS. DCS likes hardware, I'd rather not take away from some of it's resources.

I'm really at a loss. I've attached the current settings I've got configured, let me know if you guys think I should be making any changes.
Recap:

Stuttering issues while recording/streaming DCS World
Recording Setup: See attached file
CPU: Ryzen 3700x
GPU 0: RTX 2080S (Primary)
GPU 1: GTX 1080 (Encoder GPU)
RAM: 32GB 3200MHz
Recording to: m.2 NVME Drive (separate from OS/Game Install locations)

Let me know if there's anything else I can provide that may help with diagnosing this, or if there's something wrong with my thought process on how I should record gameplay.
 

Attachments

  • stream.png
    stream.png
    141.5 KB · Views: 94
  • 2021-07-11 14-22-48.txt
    13.7 KB · Views: 13

FerretBomb

Active Member
16:38:21.766: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 4834 (2.0%)
16:38:21.766: Output 'adv_stream': Number of dropped frames due to insufficient bandwidth/connection stalls: 296 (0.1%)
Your recordings are stuttering because your GPU is over-taxed. OBS requires a SMALL slice of GPU time to handle color conversion, scaling, and other housekeeping tasks. If your game eats it all, OBS can't render the frames to send to the encoder.
Fix: Run OBS as Administrator. This should allow OBS to take priority over the game.

Running two GPUs will HARM performance, NOT help. Uninstall and remove the 1080 if possible, and ensure the 2080S is running at full PCIe x16 speeds.
NVENC is a separate part of the GPU core, and DOES NOT IMPACT GAMING PERFORMANCE (so long as you are not using the Max Quality preset, Lookahead, or Psychovisual Tuning; those use CUDA cores. Use Quality instead and turn those two off). There is ZERO reason to have two GPUs in one machine, to have an 'encoder card'. In fact, it splits your PCIe speeds in half. Even if it worked, all that data from the main gaming card would have to be jammed across the PCIe bus for each frame, causing even more overhead on a cut-down bus.
Yes, people have thought of this before. No, it does not work.

Don't record using CBR. CBR is the worst encoding target method. It's used for streaming only because the infrastructure NEEDS it.
Record using CQP/CRF. This is a quality-target based encode method that uses as much or little bitrate as needed to maintain a given image quality level. 22 is a good place to start. 16 is visually lossless. 12 is only used if you plan to edit and re-encode it later, to cut down on reencoding artifacts. Below 12 should not be used unless you know exactly why you need it. The lower the number, the closer it gets to uncompressed, perfect image quality... but the bigger the files get, insanely fast.
 

koala

Active Member
There are 2 reasons to not use 2 GPUs in the same machine.
The first reason is explained by FerretBomb: If there are 2 GPU cards, the mainboard splits its bandwidth between those 2. 1 GPU alone gets 16x pci-express speed, 2 GPUs gets 8x pci-express speed for each.

The second reason is how the nvenc encoder works in OBS. If the encoder runs on the same GPU where the frames are created (the GPU where your monitor is connected to), the encoder just takes the frame buffer of that GPU and encodes this. OBS only needs to copy the small encoded frames from the GPU to write them to disk or to stream.
If the encoder runs on a different GPU, the raw video data needs to be copied from one GPU where it is created through the pci-express bus to the other GPU with the encoder. The raw video data is huge and a huge burden to the pcie-bus, and its bandwidth has even been halved because of the 2 GPUs.

So physically remove the GTX 1080 from your PC. It will improve your performance.
 

Shaggy

New Member
Very interesting, and good to know. It's a shame that I can't use the 1080 for something useful like that. In the off-hours when I'm not gaming the cards are set to mine (don't hate), but the 1080 has the worst performance by far. I may build a new rig and throw it in there as a server for media or something like that.

This has been very helpful. I'll give this a try the next time I boot it up, it sounds very promising. Thank you guys for your in-depth responses.
 

FerretBomb

Active Member
Very interesting, and good to know. It's a shame that I can't use the 1080 for something useful like that. In the off-hours when I'm not gaming the cards are set to mine (don't hate), but the 1080 has the worst performance by far. I may build a new rig and throw it in there as a server for media or something like that.

This has been very helpful. I'll give this a try the next time I boot it up, it sounds very promising. Thank you guys for your in-depth responses.
As an added bonus, the Turing NVENC core on your 2080S will deliver encoding on-par with x264 Slow. The older Pascal core on the 1080 only gets to around the Fast preset.
 
Top