Ubuntu 22.04.3 Failed to open NVENC codec

eiger3970

New Member
Hello, I'm trying to Start Recording.
OBS 30.0.1 (64 bit) plays the camcorder, but when I select Start Recording, the prompt shows:
Failed to start recording. Failed to open NVENC codec: Generic error in an external library. Try installing the latest NVIDIA driver and closing other recording software that might be using NVENC such as NVIDIA ShadowPlay or Windows Game DVR.

My Desktop Ubuntu 22.04.3 has NVIDIA X Server and GeForce NOW installed.
My graphics card is:
Bash:
ubuntu@ubuntu:/usr/NX$ inxi -Gxx
Graphics:
  Device-1: NVIDIA GK208B [GeForce GT 710] vendor: ASUSTeK driver: nvidia
    v: 470.223.02 pcie: speed: 5 GT/s lanes: 8 bus-ID: 01:00.0
    chip-ID: 10de:128b
  Device-2: Arkmicro USB2.0 PC CAMERA type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-3:4 chip-ID: 18ec:5555
  Display: x11 server: X.Org v: 1.21.1.4 compositor: gnome-shell v: 42.9
    driver: X: loaded: nvidia unloaded: fbdev,modesetting,nouveau,vesa
    gpu: nvidia display-ID: :1 screens: 1
  Screen-1: 0 s-res: 3072x768 s-dpi: 96
  Monitor-1: DVI-D-0 pos: primary,left res: 1024x768 dpi: 54
    diag: 551mm (21.7")
  Monitor-2: HDMI-0 pos: primary,center res: 1024x768 dpi: 54
    diag: 551mm (21.7")
  Monitor-3: VGA-0 pos: right res: 1024x768 size: N/A
  OpenGL: renderer: NVIDIA GeForce GT 710/PCIe/SSE2
    v: 4.6.0 NVIDIA 470.223.02 direct render: Yes

I also downloaded from the NVIDIA website NVIDIA-Linux-x86_64-470.223.02.run, but didn't install it.
 

AaronD

Active Member
I don't think driver version 470 supports the NVENC version that is being used by OBS.
That might explain the GPU crash mid-recording that I had a few months ago. 470 is the latest that supports my Quadro K5100M from 2015. The rest of this Dell Precision M6800 mobile workstation is still going strong, and the GPU probably would too if it still had a decent driver.

I'm using the VAAPI encoder now, which I guess is a hardware section of the Intel i7-4940MX CPU? At any rate, that works just fine, with two simultaneous instances of OBS, kept up-to-date from the official PPA, both running 1920x1080p30 in Studio Mode, plus a DAW for audio, plus a remote meeting.
Only one of those instances actually encodes though. The other just feeds the virtual camera.

Ubuntu Studio 22.04 LTS
 

eiger3970

New Member
That might explain the GPU crash mid-recording that I had a few months ago. 470 is the latest that supports my Quadro K5100M from 2015. The rest of this Dell Precision M6800 mobile workstation is still going strong, and the GPU probably would too if it still had a decent driver.

I'm using the VAAPI encoder now, which I guess is a hardware section of the Intel i7-4940MX CPU? At any rate, that works just fine, with two simultaneous instances of OBS, kept up-to-date from the official PPA, both running 1920x1080p30 in Studio Mode, plus a DAW for audio, plus a remote meeting.
Only one of those instances actually encodes though. The other just feeds the virtual camera.

Ubuntu Studio 22.04 LTS
How did you/can I change this encoder to VAAPI to make OBS record?
 

eiger3970

New Member
Thanks, that fixed the video. I simply select a non NVIDIA option.
However, the audio is confusing? It's a bit hard to figure out what is managing the audio? The Desktop Audio is muted, however the Mic/Aux shows audio, but my Desktop has no mic?
 

AaronD

Active Member
Yeah, OBS's audio is a mess. It was originally designed for a stereotypical bedroom streamer, that has one mic and one game and nothing else. That original design, for that specific purpose, is good, but everything else is a poorly thought-out add-on.

There are enough of those band-aids on top of the original good design, that it's almost impossible to maintain too, in addition to the usability problems, and so the devs are in the process of figuring out what to replace it with. I wouldn't expect any changes at all until that replacement comes out, and I would expect it to be completely incompatible with what's there now, so that everyone has to rebuild from scratch what they actually want, instead of the hacks that they use to get there now.

If you're doing much beyond the original stereotypical bedroom streamer, I usually recommend moving ALL of the audio work out of OBS and into a DAW or physical console. OBS, then, has only one audio source at all, which is the final finished soundtrack to pass through completely unchanged. All of its other audio sources (scenes, Settings -> Audio, etc.) are either removed or disabled.

---

In the original design, Mic/Aux is the mic, and Desktop is the game. Desktop uses the operating system's loopback of *everything* that goes out of the selected device, so that's an easy way to catch the game...and everything else that the device does: system sounds, other apps including OBS's own Monitor, OS-passthrough of inputs that it's set to do that for, etc.

Lots of people have fallen into that trap, not realizing how late in the chain the Desktop source really is, and wondering why it echoes or sounds weird. In most of those cases, they had a Desktop source set to the same device that they sent the Monitor to, and it was picking that up.

Another common problem is that they use the Default device selection because it "just worked"...and then it "just didn't" without them changing anything. The reason for *that*, is that the Default selection defers the choice of device to the OS, which can and does change it without warning, usually in response to a change in hardware, but not always. So their OBS rig suddenly doesn't work, because the same Default selection is looking at a different device now. If you choose a specific device in OBS, never Default, *then* it won't change on you.
 

eiger3970

New Member
Ok, somehow video and audio now plays and records. This is all I did:
Ensure Camcorder has audio/video plug firmly connected into camcorder port-RCA male-RCA female-capture card-USB port on computer.
OBS 30.0.1 -> Sources -> select + sign -> select Video Capture Device (V4L2) -> Device: USB2.0 PC CAMERA (usb-0000:00:14.0-3).

The audio is terrible with massive white noise over the original audio. Not sure if it's the physical wire connection to the computer, or if there's some better audio settings on OBS?
 

AaronD

Active Member
If we're solidly on a different topic now, a new thread is probably better. Post a recording too. Different problems often sound different.
 
Top