Question / Help NVENC Support For Linux

SolarLune

New Member
Hey, there.

I was trying to get NVENC support up and running for Linux, but wasn't able to do it, when I saw that some of the commits for OBS Studio included NVENC support (or the ability to select NVENC as the encoder). However, on updating to the latest version of OBS Studio, it doesn't seem like it's there; can anyone help me out with this?

For information, I'm running Ubuntu Gnome 16.04, and OBS Studio 0.14.1. I did compile a version of FFMPEG with NVENC support. When I run "ffmpeg" in a terminal, I get "configuration: --enable-non-free --enable-nvenc"; do I need to enable other things, as well? Or is OBS Studio maybe looking at a different version of FFMPEG?
 

Kithop

New Member
I've got the exact same issue. I managed to even build .debs (that no, I'm not allowed to redistribute because of the non-free - this is why we won't see PPAs)... 'ffmpeg --codecs' shows nvenc as an option, but OBS still mocks me with 'Software (x264)' as the only dropdown option. :( I'd understand if I built it into a weird location, but I went through the Debian way on my Ubuntu system using debuild in the stock paths, to replace my system ffmpeg with the latest clone from master. (v3.0.1).

I'm hoping we don't have to also build OBS from source once the ffmpeg install is in place before it will detect... because I have no idea how to get the requisite '-dev' bundles out of the build I just did... I'm not a developer or Debian packager, and it took long enough to get this far. ;/
 

Kithop

New Member
Figured it out! Quick-and-dirty build instructions from memory here:

Then, in a temporary folder:

$ sudo apt-get build-dep ffmpeg
$ git clone https://anonscm.debian.org/git/pkg-multimedia/ffmpeg.git
$ vim ffmpeg/debian/rules

Under the 'CONFIG' list with all the build options, add:

--enable-nonfree \
--enable-nvenc

(don't forget to add a \ to the end of --enable-x11grab to keep it all on one virtual line)

I also had to create a file here to work around a depenency bug later:
$ echo 'libva 1 libva1' > ffmpeg/debian/shlibs.local

Then you should be able to build ffmpeg:
$ cd ffmpeg
$ debuild -us -uc -b

Whole bunch of config & compile stuff later... we have everything we need, BUT, it seems that blindly installing *all* the .debs is bad, as there's a conflict if you do. So you should be fine to remove the one extra and install the rest:
$ cd ..
$ rm libavcodec57_3.0.1-3_amd64.deb
$ sudo dpkg -i *.deb

Hopefully, no conflicts there, so try running:

$ ffmpeg -codecs | grep nvenc

And you should see:
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_crystalhd h264_vdpau ) (encoders: libx264 libx264rgb nvenc nvenc_h264 )
DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (encoders: libx265 nvenc_hevc )

Get back up to your temp folder and now grab OBS:
$ cd ..
$ apt-get source obs-studio
$ sudo apt-get build-dep obs-studio
(don't worry that a bunch of stuff is missing - try to install what you can by hand, ignore all the '-ffmpeg-dev' stuff)

Note: If you can't seem to pull the source despite having added the OBS PPA, check /etc/apt/sources.list.d - there'll be an OBS related .list file in there. Uncomment the 'deb-src' line, re-run apt-get update, and try again!


$ cd obs-studio-0.14.1.1

Now, OBS is still depending on virtual packages from 15.10 and earlier that appear to have been removed in Xenial/16.04! - thankfully, our ffmpeg build + install does actually have those dependencies, but the packages are named:

libavformat-dev
libavcodec-dev
etc.

Instead of:

libavformat-ffmpeg-dev
libavcodec-ffmpeg-dev

All we have to do is tweak OBS' build rules:

$ vim debian/control
Then find-and-replace out all the '-ffmpeg' instances (e.g. :%s/-ffmpeg//g)

Time to build OBS:
$ debuild -us -uc -b
$ cd ..
$ dpkg -i obs-studio_0.14.1.1-358~wily_amd64.deb

If all went well, you should now see NVENC in the Output settings!

2016-04-25-OBS-NVENC-Linux-1.png


Note: You probably also want to run 'sudo apt-mark hold obs-studio' here to stop your newly-installed build from being clobbered by the binary package from the PPA. However, you'll need to keep an eye on the OBS site for updates manually, pull the sources when they do occur, and recompile as above!

One thing I've noticed: I did a quick test recording and then played it back with VLC: The first ~10 seconds or so tend to be mangled, until it hits a keyframe or something, and then it snaps back into focus. Could just be VLC, though, and it's relatively minor.

Also, I did this using the old v5.0.1 of the nVidia SDK I had installed from previous experiments. If someone wants to try this with their relatively newly released v6.0.1 instead and report back, it would be awesome! Best of luck! :)
 
Last edited:

dwightjl

New Member
I managed to get the encoder to show up in OBS using a combination of instructions including these ones here. However, I'm getting an error when I try to start streaming or recording in OBS.

[NVENC encoder: 'streaming_h264'] Failed to open NVENC codec: Invalid argument

I get the correct output when I run ffmpeg -codecs | grep nvenc. I'll keep digging around to see if I have something configured incorrectly. The OBS version is 0.14.1-8. I notced that the instructions above use 0.14.1.1. Slightly different.
 

Kithop

New Member
I managed to get the encoder to show up in OBS using a combination of instructions including these ones here. However, I'm getting an error when I try to start streaming or recording in OBS.

[NVENC encoder: 'streaming_h264'] Failed to open NVENC codec: Invalid argument

I get the correct output when I run ffmpeg -codecs | grep nvenc. I'll keep digging around to see if I have something configured incorrectly. The OBS version is 0.14.1-8. I notced that the instructions above use 0.14.1.1. Slightly different.

Hmmm. If you have a test file, are you able to re-encode it using your ffmpeg build manually using NVENC? That way you can at least narrow it down to it being either an issue with your ffmpeg build or OBS.
 

dwightjl

New Member
Hmmm. If you have a test file, are you able to re-encode it using your ffmpeg build manually using NVENC? That way you can at least narrow it down to it being either an issue with your ffmpeg build or OBS.

Yes I just tried this. It works really well. Not only does NVENC encode twice as fast, but it the encoded video is much cleaner as well.

This is weird. When I follow your encoding instructions for OBS, I don't get NVENC as an encoder option. If I use the OBS instructions for compiling source from GitHub, I get the option but it doesn't work.

Another weird thing is that my control file doesn't include libavformat-dev or libavcodec-dev at all. Not even named as libavformat-ffmpeg-dev or libavcodec-ffmpeg-dev. Adding those packages doesn't change things either way.

I'm going to keep troubleshooting the "[NVENC encoder: 'streaming_h264'] Failed to open NVENC codec: Invalid argument" error.
 

Kithop

New Member
Yes I just tried this. It works really well. Not only does NVENC encode twice as fast, but it the encoded video is much cleaner as well.

This is weird. When I follow your encoding instructions for OBS, I don't get NVENC as an encoder option. If I use the OBS instructions for compiling source from GitHub, I get the option but it doesn't work.

Another weird thing is that my control file doesn't include libavformat-dev or libavcodec-dev at all. Not even named as libavformat-ffmpeg-dev or libavcodec-ffmpeg-dev. Adding those packages doesn't change things either way.

I'm going to keep troubleshooting the "[NVENC encoder: 'streaming_h264'] Failed to open NVENC codec: Invalid argument" error.

I noticed I was still using a wily repo rather than xenial. Updated my sources - also note I'm using the unstable PPA:

Code:
$ cat /etc/apt/sources.list.d/obsproject-ubuntu-obs-studio-unstable.list
deb http://ppa.launchpad.net/obsproject/obs-studio-unstable/ubuntu xenial main
deb-src http://ppa.launchpad.net/obsproject/obs-studio-unstable/ubuntu xenial main

$ apt-get source obs-studio
Reading package lists... Done
Need to get 20.2 MB of source archives.
Get:1 http://ppa.launchpad.net/obsproject/obs-studio-unstable/ubuntu xenial/main obs-studio 0.14.1.14-368~xenial (tar) [20.2 MB]
Get:2 http://ppa.launchpad.net/obsproject/obs-studio-unstable/ubuntu xenial/main obs-studio 0.14.1.14-368~xenial (diff) [626 B]  
Get:3 http://ppa.launchpad.net/obsproject/obs-studio-unstable/ubuntu xenial/main obs-studio 0.14.1.14-368~xenial (dsc) [1,763 B]  
Fetched 20.2 MB in 1min 8s (293 kB/s)  
gpgv: Signature made Sun 01 May 2016 05:19:47 PM PDT using RSA key ID 1EB752D1
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./obs-studio_0.14.1.14-368~xenial.dsc
dpkg-source: info: extracting obs-studio in obs-studio-0.14.1.14
dpkg-source: info: unpacking obs-studio_0.14.1.14.orig.tar.gz
dpkg-source: info: applying obs-studio_0.14.1.14-368~xenial.diff.gz

Sure enough, they've fixed that issue with the names, no -ffmpeg or anything, but note it does still have e.g. libavformat-dev:

Code:
$ cat obs-studio-0.14.1.14/debian/control
Source: obs-studio
Section: video
Priority: optional
Maintainer: John Bradley <jrb@turrettech.com>
Build-Depends: debhelper (>= 9), cdbs, cmake, git, libx11-dev, libgl1-mesa-dev | libgl-dev, libpulse-dev, libxcomposite-dev, libxinerama-dev, libv4l-dev, libudev-dev, libfreetype6-dev, libfontconfig-dev, qtbase5-dev, libqt5x11extras5-dev, libx264-dev, libxcb-xinerama0-dev, libxcb-shm0-dev, libavformat-dev, libswscale-dev, libswresample-dev, libavdevice-dev, libavfilter-dev, libfdk-aac-dev, libjack-jackd2-dev, libcurl4-openssl-dev
Homepage: http://obsproject.org

Package: obs-studio
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: OBS Studio for Ubuntu

Alright, not changing a thing, just going to build! Note I have my custom ffmpeg build & -dev .debs installed to the stock paths, NVENC works there, etc. Obviously said headers need to be there as part of the build-depends and we want our compiled version so that the OBS build has a chance to detect it.

Code:
$ cd obs-studio-0.14.1.14 && debuild -us -uc -b
(tons of compile output)

$ sudo dpkg -i ../obs-studio_0.14.1.14-368~xenial_amd64.deb
(Reading database ... 249946 files and directories currently installed.)
Preparing to unpack .../obs-studio_0.14.1.14-368~xenial_amd64.deb ...
Unpacking obs-studio (0.14.1.14-368~xenial) over (0.14.1.2-359~wily) ...
Setting up obs-studio (0.14.1.14-368~xenial) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...

My new build still has the NVENC options in OBS:

2016-05-03-OBS-NVENC-Simple.png

2016-05-03-OBS-NVENC-Advanced.png
 

Kithop

New Member
Rebuilding ffmpeg again just in case, this time upgrading to the latest nVidia SDK:
Code:
$ unzip nvidia_video_sdk_6.0.1.zip
$ sudo cp nvidia_video_sdk_6.0.1/Samples/common/inc/nv*.h /usr/local/include
$ sudo cp nvidia_video_sdk_6.0.1/Samples/common/inc/Nv*.h /usr/local/include
$ ls /usr/local/include/nv* /usr/local/include/Nv*
/usr/local/include/nvCPUOPSys.h  /usr/local/include/nvFileIO.h  /usr/local/include/nvUtils.h
/usr/local/include/nvEncodeAPI.h  /usr/local/include/NvHWEncoder.h

Here's why I have the git clone instead of using apt for ffmpeg - they ask you to:
Code:
$ apt-get source ffmpeg
Reading package lists... Done
NOTICE: 'ffmpeg' packaging is maintained in the 'Git' version control system at:
https://anonscm.debian.org/git/pkg-multimedia/ffmpeg.git
Please use:
git clone https://anonscm.debian.org/git/pkg-multimedia/ffmpeg.git
to retrieve the latest (possibly unreleased) updates to the package.
^C
Code:
$ git clone https://anonscm.debian.org/git/pkg-multimedia/ffmpeg.git
Cloning into 'ffmpeg'...
remote: Counting objects: 18028, done.
remote: Compressing objects: 100% (8755/8755), done.
remote: Total 18028 (delta 12255), reused 14378 (delta 8954)
Receiving objects: 100% (18028/18028), 24.67 MiB | 3.62 MiB/s, done.
Resolving deltas: 100% (12255/12255), done.
Checking connectivity... done.
Code:
$ vim ffmpeg/debian/rules
...
  --enable-x11grab \
  --enable-nonfree \
  --enable-nvenc
...
Not going to put my earlier libva fix in, trying just to compile it as-is with the NVENC option:
Code:
$ cd ffmpeg && debuild -us -uc -b
(lots of compile output)
...
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libva.so.1 (used by debian/libavcodec57/usr/lib/x86_64-linux-gnu/libavcodec.so.57.24.102)
Hint: check if the library actually comes from a package.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/libavcodec57.substvars debian/libavcodec57/usr/lib/x86_64-linux-gnu/libavcodec.so.57.24.102 returned exit code 2
debian/rules:191: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -b failed
Oh no, am I missing it?
Code:
$ sudo apt-get install libva-dev
Reading package lists... Done
Building dependency tree   
Reading state information... Done
libva-dev is already the newest version (1.7.0-1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Don't ask me why, but I guess that one's not fixed? Let's apply the workaround and try again (and if someone knows why this is happening and has a better fix, let me know! Or better yet, figure out how to send this upstream to the Debian ffmpeg maintainers? Or Ubuntu's? Who knows...) :
Code:
$ echo 'libva 1 libva1' > debian/shlibs.local
$ debuild -us -uc -b
Build worked that time.
Code:
$ ls -1 ../*.deb
../ffmpeg_3.0.2-1_amd64.deb
../ffmpeg-doc_3.0.2-1_all.deb
../libavcodec57_3.0.2-1_amd64.deb
../libavcodec-dev_3.0.2-1_amd64.deb
../libavcodec-extra_3.0.2-1_all.deb
../libavcodec-extra57_3.0.2-1_amd64.deb
../libavdevice57_3.0.2-1_amd64.deb
../libavdevice-dev_3.0.2-1_amd64.deb
../libavfilter6_3.0.2-1_amd64.deb
../libavfilter-dev_3.0.2-1_amd64.deb
../libavformat57_3.0.2-1_amd64.deb
../libavformat-dev_3.0.2-1_amd64.deb
../libavresample3_3.0.2-1_amd64.deb
../libavresample-dev_3.0.2-1_amd64.deb
../libav-tools_3.0.2-1_all.deb
../libavutil55_3.0.2-1_amd64.deb
../libavutil-dev_3.0.2-1_amd64.deb
../libpostproc54_3.0.2-1_amd64.deb
../libpostproc-dev_3.0.2-1_amd64.deb
../libswresample2_3.0.2-1_amd64.deb
../libswresample-dev_3.0.2-1_amd64.deb
../libswscale4_3.0.2-1_amd64.deb
../libswscale-dev_3.0.2-1_amd64.deb
Let's install it all!
Code:
(bunch of installs)
dpkg: dependency problems prevent configuration of ffmpeg-doc:
 ffmpeg-doc depends on libjs-bootstrap; however:
  Package libjs-bootstrap is not installed.

dpkg: error processing package ffmpeg-doc (--install):
 dependency problems - leaving unconfigured
(whatever, don't care)
dpkg: regarding .../libavcodec57_3.0.2-1_amd64.deb containing libavcodec57:amd64:
 libavcodec-extra57:amd64 conflicts with libavcodec57
  libavcodec57:amd64 (version 7:3.0.2-1) is to be installed.

dpkg: error processing archive ../libavcodec57_3.0.2-1_amd64.deb (--install):
 conflicting packages - not installing libavcodec57:amd64
In my case, I wanted the extra, so that's fine. If the other one installed first, just force uninstall it and then re-install libavcodec-extra57 from the .debs we just built.
Since I don't care about ffmpeg-doc:
Code:
$ sudo apt-get remove ffmpeg-doc
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following packages will be REMOVED:
  ffmpeg-doc
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 26.7 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 250921 files and directories currently installed.)
Removing ffmpeg-doc (7:3.0.2-1) ...
Processing triggers for doc-base (0.10.7) ...
Processing 1 removed doc-base file...
Processing triggers for man-db (2.7.5-1) ...
Did we get what we wanted?
Code:
$ ffmpeg -codecs | grep nvenc
ffmpeg version 3.0.2-1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
  configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-nonfree --enable-nvenc --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-chromaprint --enable-libx264
  WARNING: library configuration mismatch
  avcodec  configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-nonfree --enable-nvenc --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-chromaprint --enable-libx264 --enable-version3 --disable-doc --disable-programs --disable-avdevice --disable-avfilter --disable-avformat --disable-avresample --disable-postproc --disable-swscale --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libvo_amrwbenc
  libavutil  55. 17.103 / 55. 17.103
  libavcodec  57. 24.102 / 57. 24.102
  libavformat  57. 25.100 / 57. 25.100
  libavdevice  57.  0.101 / 57.  0.101
  libavfilter  6. 31.100 /  6. 31.100
  libavresample  3.  0.  0 /  3.  0.  0
  libswscale  4.  0.100 /  4.  0.100
  libswresample  2.  0.101 /  2.  0.101
  libpostproc  54.  0.100 / 54.  0.100
 DEV.LS h264  H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_crystalhd h264_vdpau ) (encoders: libx264 libx264rgb nvenc_h264 )
 DEV.L. hevc  H.265 / HEVC (High Efficiency Video Coding) (encoders: libx265 nvenc_hevc )
Awesome!

So, just to be extra-extra sure, I then went up and rebuilt OBS one more time from scratch as per my previous post, now with the nVidia SDK 6.0.1 headers and a brand new, freshly synced & compiled copy of ffmpeg with NVENC support. Still shows the options in both Simple & Advanced modes!

Oh, and don't forget:
Code:
$ sudo apt-mark hold obs-studio
obs-studio set on hold.

Hopefully all the details help!
 

SolarLune

New Member
Yo, thanks for all the details!

I was able to build FFMPEG again with NVENC support (I think?), but I'm still having some trouble actually building OBS Studio. I've never been able to build it successfully, and I don't really have the time or patience to work with this for a lot of time. I think I'm just gonna wait until something changes, I guess? Hopefully some solution will arise that will make this a ton simpler.
 

Kithop

New Member
Yo, thanks for all the details!

I was able to build FFMPEG again with NVENC support (I think?), but I'm still having some trouble actually building OBS Studio. I've never been able to build it successfully, and I don't really have the time or patience to work with this for a lot of time. I think I'm just gonna wait until something changes, I guess? Hopefully some solution will arise that will make this a ton simpler.

Hmmm. Did you grab all the build-dependencies for OBS?

Code:
$ sudo apt-get build-dep obs-studio

Other than that, if you want to post a log or something of your build, might be able to see what's going on.
 

OneHOM

New Member
Hello everyone! I'm trying to compile ffmpeg with nvenc - working fine

Code:
onehom@onehom-mint1 ~ $ ffmpeg -codecs | grep nvenc
ffmpeg version 3.0.2-5 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2.1) 20160413
  configuration: --prefix=/usr --extra-version=5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-nonfree --enable-nvenc --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-chromaprint --enable-libopencv --enable-libx264
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_crystalhd h264_vdpau ) (encoders: libx264 libx264rgb nvenc nvenc_h264 )
DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (encoders: libx265 nvenc_hevc )

but after compiling and installing obs 0.14.2 i see only x264 encoder without nvenc. Log file in the attachments.
 

Attachments

  • buildlog.zip
    20.5 KB · Views: 71

Kithop

New Member
I'm using slightly newer builds of both ffmpeg and obs-studio, it seems - I've attached my buildlog for comparison; I actually get warnings re: nvenc, but it still seems to work, while I can see in your buildlog you have a couple nvenc-related files being compiled... so it's strange it's not showing up?

Have you tried compiling both the latest ffmpeg via:
Code:
git clone https://anonscm.debian.org/git/pkg-multimedia/ffmpeg.git

and obs-studio sources (looks like you're on a Debian-based machine too?) via:
Code:
apt-get source obs-studio
 

Attachments

  • obs-studio_0.14.2.67-411~xenial_amd64.build.zip
    22 KB · Views: 90
  • obs-studio_0.14.2.67-411~xenial_amd64.build.zip
    22 KB · Views: 78

Ohlmann

New Member
Big Thx to Kithop got it working after few trials & errors..
cgGnw5i.png
 

Attachments

  • Sans titre.png
    Sans titre.png
    121.6 KB · Views: 100

dj--alex

New Member
Why for linux not exist OBS 0.18 with NVENC support
Only 0.16 version exist. maybe donate too low? PPA is outdated!!! 2016 year !!

I install FFmpeg 3.2.4. from PPA it tells NVENC is released
No NVENC in OBS
why&&&:????
se -h to get full help or, even better, run 'man ffmpeg'
user@PC1 ~ $ 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)

someone tell me check - I have nvidia-uvm. - No NVENC in OBS
from recomendations i install CUDA 8.0 (2Gb) from Nvidia - No NVENC in OBS
i intall nvidia-toolkit-cuda (its downloaded 500mb CRAP outdated Cuda 7.5) - Still No NVENC in OBS
I tries automated script installing with recompilation FFmpeg + OBS from source.s
http://linuxoidblog.blogspot.ru/2017/01/obs-studio-ffmpeg-nvidia-nvenc.html

but installed copy of OBS - Still No NVENC in OBS

Maybe my PC is very old and no good for NVENC???? All other people CAN use NVENC
Why i not?
AMD FX8100 8 cores, 4.1Ghz, 16Gb RAM, Nvidia 1060 GTX, SSD 128Gb

For 2 years this is only problem which i cannot removel..

I WASTE many days to tries run NVENC
and use OBS for linux and in ANY video i have 15-20 FPS on any game , EVEN Doom2 (!!!!!!)
if i just play any game i can get 60 FPS even in DEUS EX MD.

It's really disappoint be.

I just want to found how to download or create .DEB file with OBS + NVENCsupport
in ONE file .
without problems or downloading 2.5 gb crap content.

unfortunately author edited script autocompiling and NOW it alway FAILS
on every ssystem
user@PC1 ~/ffmpeg3/ffmpeg-nvenc $ ./build.sh -d /home/user/ffmpeg-nvenc-obs -o
Building FFmpeg in /home/user/ffmpeg-nvenc-obs
./build.sh: строка 263: Syntax error: Unexpected end of file.



Please help anybody.
 
Last edited:

KGB1st

New Member
can somebody tell me why this all not works on latest software version? On cuda9.1, nvidia390 and latest ffmpeg?
I mounthly can't build my local obs-studuio :\ Why its so hard?!
 

KGB1st

New Member
Code:
obs

Attempted path: share/obs/obs-studio/locale/en-US.ini

Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini

Attempted path: share/obs/obs-studio/locale.ini

Attempted path: /usr/share/obs/obs-studio/locale.ini

Attempted path: share/obs/obs-studio/themes/Default.qss

Attempted path: /usr/share/obs/obs-studio/themes/Default.qss

Attempted path: share/obs/obs-studio/license/gplv2.txt

Attempted path: /usr/share/obs/obs-studio/license/gplv2.txt

info: CPU Name: AMD FX(tm)-9590 Eight-Core Processor

info: CPU Speed: 4715.522MHz

info: Physical Cores: 4, Logical Cores: 8

info: Physical Memory: 16019MB Total, 2959MB Free

info: Kernel Version: Linux 4.13.0-39-generic

info: Distribution: "Ubuntu" "16.04"

info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.19.5

info: Portable mode: false

QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()

QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()

QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)

info: OBS 21.1.1-86-g5712147 (linux)

info: ---------------------------------

info: ---------------------------------

info: audio settings reset:

    samples per sec: 44100

    speakers:        2

info: ---------------------------------

info: Initializing OpenGL...

info: Loading up OpenGL on adapter NVIDIA Corporation GeForce GTX 1080 Ti/PCIe/SSE2

info: OpenGL loaded successfully, version 3.2.0 NVIDIA 390.30, shading language 1.50 NVIDIA via Cg compiler

info: ---------------------------------

info: video settings reset:

    base resolution:   1920x1080

    output resolution: 1280x720

    downscale filter:  Bicubic

    fps:               30/1

    format:            NV12

    YUV mode:          601/Partial

info: Audio monitoring device:

    name: Default

    id: default

info: ---------------------------------

libDeckLinkAPI.so: cannot open shared object file: No such file or directory

info: No blackmagic support

info: NVENC supported

info: VLC found, VLC video source enabled

info: ---------------------------------

info:   Loaded Modules:

info:     vlc-video.so

info:     text-freetype2.so

info:     rtmp-services.so

info:     obs-x264.so

info:     obs-transitions.so

info:     obs-outputs.so

info:     obs-libfdk.so

info:     obs-filters.so

info:     obs-ffmpeg.so

info:     linux-v4l2.so

info:     linux-pulseaudio.so

info:     linux-jack.so

info:     linux-decklink.so

info:     linux-capture.so

info:     linux-alsa.so

info:     image-source.so

info:     frontend-tools.so

info: ---------------------------------

info: ==== Startup complete ===============================================

info: All scene data cleared

info: ------------------------------------------------

info: xcompcap: [window-capture: 'Window Capture (Xcomposite)'] update settings:

    title: Desktop

    class: desktop_window

info: Switched to scene 'Scene 2'

info: ------------------------------------------------

info: Loaded scenes:

info: - scene 'Scene 2':

info:     - source: 'Window Capture (Xcomposite)' (xcomposite_input)

info: ------------------------------------------------

info: ---------------------------------

Segmentation fault (core dumped)

Code:
kgb1st@sabertooth-lnx:~/ffmpeg$ ffmpeg -encoders | grep NVIDIA
ffmpeg version git-2018-05-08-8007a86 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
  configuration: --enable-shared --prefix=/usr
  libavutil      56. 18.100 / 56. 18.100
  libavcodec     58. 19.101 / 58. 19.101
  libavformat    58. 13.102 / 58. 13.102
  libavdevice    58.  4.100 / 58.  4.100
  libavfilter     7. 21.100 /  7. 21.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
 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)
 
Last edited:
Top