Question / Help OBS NVENC Issues

patomack

New Member
Hello all,

I have been through quite a few threads on this issue and decided to reach out for some help.

Problem:

When trying to use nvenc in obs to record local video, I get the following error:

Starting the output failed. Please check the log for details.
Note: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date.

The logs show:

10:30:12 PM.112: [NVENC encoder: 'recording_h264'] Failed to open NVENC codec: Generic error in an external library

Nothing really new here, many posts have had similar issues.

I have followed some direction from different posts, and compiled ffmpeg from source. Here is some useful outputs:

ffmpeg -encoders 2>/dev/null | grep nvenc
V..... h264_nvenc NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc_h264 NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc_hevc NVIDIA NVENC hevc encoder (codec hevc)
V..... hevc_nvenc NVIDIA NVENC hevc encoder (codec hevc)

ffmpeg
ffmpeg version N-93543-gbb5efd1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
configuration: --prefix=/home/patrick/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/patrick/ffmpeg_build/include --extra-ldflags=-L/home/patrick/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/patrick/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc
libavutil 56. 26.100 / 56. 26.100
libavcodec 58. 48.101 / 58. 48.101
libavformat 58. 27.100 / 58. 27.100
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 48.100 / 7. 48.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

From everything I can see, it looks like my system should support nvenc.

Thank you for any direction/advice.

Details:

OS: Linux Mint 19.1 Tessa x86_64
CPU: Intel i7-6700HQ (8) @ 3.500GHz
GPU: NVIDIA GeForce GTX 1060 Mobile 6GB
NVIDIA Driver Version: 418.56

I have attempted two OBS installations: one from obs website (version 23.0.0) and one from flatpak (23.0.2).
 

Attachments

  • 2019-04-08 22-21-51.txt
    6.4 KB · Views: 76
Last edited:

patomack

New Member
Please note that I have resolved this issue. I had selected the GPU setting to "8", thinking it was using 8 cores on the GPU or something along those lines. I have since realized that it was trying to select GPU card 8, which didn't exist. Changed value to 0 and all is well.
 

agtra

New Member
Please note that I have resolved this issue. I had selected the GPU setting to "8", thinking it was using 8 cores on the GPU or something along those lines. I have since realized that it was trying to select GPU card 8, which didn't exist. Changed value to 0 and all is well.
i also have the same problem and from what i've seen my GPU setting is 0 yet the problem still persist
 
D

Deleted member 192032

i also have the same problem and from what i've seen my GPU setting is 0 yet the problem still persist

The last time i encountered this problem it was because all 2 nvenc sessions were used up. I don't know if i'm explaining this correctly, but i'm almost sure you can have up to 2 things recording via nvenc at the same time. What i did was play an oculus rift game (which uses 1 nvenc session), try to stream with nvenc to twitch AND record a local file with nvenc all at the same time. Once i changed my streaming settings to x264 and the problem was solved.
 

obs_size

New Member
I was able to fix my issue by re-running the auto configuration wizard and selecting 1920x1080 as the canvas resolution. I got the idea from this thread https://obsproject.com/forum/threads/nvenc-invalid-parameters-with-output-resolution-w-4096.105570/

It looks like, perhaps, the original width and height params were being rejected.

Bad settings:
[NVENC encoder: 'simple_h264_recording'] settings:
rate_control: CQP
bitrate: 0
cqp: 23
keyint: 250
preset: hq
profile: high
width: 5312
height: 2988
2-pass: false
b-frames: 2
GPU: 0

[NVENC encoder: 'simple_h264_recording'] Failed to open NVENC codec: Generic error in an external library

Good Settings:

14:42:28.736: [jim-nvenc: 'simple_h264_stream'] settings:
rate_control: CBR
bitrate: 3841
cqp: 20
keyint: 120
preset: hq
profile: high
width: 1280
height: 720
2-pass: false
b-frames: 2
lookahead: false
psycho_aq: true

Hope this is helpful to someone.
 
Top