Announcement

Collapse
No announcement yet.

Using NVIDIA's NVENC On Linux With FFmpeg

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by Nille View Post
    Yes, and now you can troll somewhere else.
    Well, further decoding API's are irrelevant on Windows anyway because everyone uses DirectX Video Acceleration. I don't know what the situation there is wrt encoding.

    Comment


    • #22
      Originally posted by nanonyme View Post
      I don't know what the situation there is wrt encoding.
      The way to go should a Media Foundation/DirectShow encoder that support the Hardware Encoder. Unfortunately not all applications support this codecs or the vendor ship those codecs. As Example, AMD has installed a Encoder and some filters but Intel doesn't do that.

      Comment


      • #23
        can't compile ffmpeg w/ libnvenc enabled

        I'm trying to get ffmpeg to compile with libnvenc enabled but i'm failing miserably. as per instructions i found on the dark net (joke) i downloaded the "windows" NVENC SDK which was available at https://developer.nvidia.com/nvidia-video-codec-sdk. (note i read that i needed the windows version of the sdk for whatever reason) I extract the nvEncodeAPI.h header file and make my PKGBUILD see it but ffmpeg is choking on opencl portion of the ffmpeg libraries. It probably doesn't help that I am very new to Arch linux, this is the first PKGBUILD I've ever created and the fact that I don't know C+ makes this all very complex. I was getting some help from someone over IRC but basically we think that the person here https://github.com/Brainiarc7/ffmpeg_libnvenc got it to work in Ubuntu 14.04 because his opencl libraries are out of date so it works. I'm trying to build it in Arch which has mostly up to date packages. If anyone is able to assist me in getting my PKGBUILD to work I would great appreciate it. Thanks..

        here's my makepkg -L log: https://clbin.com/bIeUI

        and here's the PKGBUILD: https://clbin.com/NNno7

        NOTE: the end goal is to use ffmpeg w/ libnvenc enabled to encode video for either local recordings and or livestreaming to a rtmp server using simplescreenrecorder or even make obs-studio use libnvenc as well. Not sure about kdenlive using it since melt is involved there and as I said I'm not a programmer

        Comment


        • #24
          Originally posted by ubuntuaddicted View Post
          I'm trying to get ffmpeg to compile with libnvenc enabled but i'm failing miserably. as per instructions i found on the dark net (joke) i downloaded the "windows" NVENC SDK which was available at https://developer.nvidia.com/nvidia-video-codec-sdk. (note i read that i needed the windows version of the sdk for whatever reason) I extract the nvEncodeAPI.h header file and make my PKGBUILD see it but ffmpeg is choking on opencl portion of the ffmpeg libraries. It probably doesn't help that I am very new to Arch linux, this is the first PKGBUILD I've ever created and the fact that I don't know C+ makes this all very complex. I was getting some help from someone over IRC but basically we think that the person here https://github.com/Brainiarc7/ffmpeg_libnvenc got it to work in Ubuntu 14.04 because his opencl libraries are out of date so it works. I'm trying to build it in Arch which has mostly up to date packages. If anyone is able to assist me in getting my PKGBUILD to work I would great appreciate it. Thanks..

          here's my makepkg -L log: https://clbin.com/bIeUI

          and here's the PKGBUILD: https://clbin.com/NNno7

          NOTE: the end goal is to use ffmpeg w/ libnvenc enabled to encode video for either local recordings and or livestreaming to a rtmp server using simplescreenrecorder or even make obs-studio use libnvenc as well. Not sure about kdenlive using it since melt is involved there and as I said I'm not a programmer
          stupid i couldn't edit my previous post but I did end up getting it working with some voodoo magic. Here's the final PKGBUILD if anyone is interested but there's a lot of notes to read at the top. https://clbin.com/ITbKg

          Comment


          • #25
            Notes

            Originally posted by ubuntuaddicted View Post
            I'm trying to get ffmpeg to compile with libnvenc enabled but i'm failing miserably. as per instructions i found on the dark net (joke) i downloaded the "windows" NVENC SDK which was available at https://developer.nvidia.com/nvidia-video-codec-sdk. (note i read that i needed the windows version of the sdk for whatever reason) I extract the nvEncodeAPI.h header file and make my PKGBUILD see it but ffmpeg is choking on opencl portion of the ffmpeg libraries. It probably doesn't help that I am very new to Arch linux, this is the first PKGBUILD I've ever created and the fact that I don't know C+ makes this all very complex. I was getting some help from someone over IRC but basically we think that the person here https://github.com/Brainiarc7/ffmpeg_libnvenc got it to work in Ubuntu 14.04 because his opencl libraries are out of date so it works. I'm trying to build it in Arch which has mostly up to date packages. If anyone is able to assist me in getting my PKGBUILD to work I would great appreciate it. Thanks..

            here's my makepkg -L log: https://clbin.com/bIeUI

            and here's the PKGBUILD: https://clbin.com/NNno7

            NOTE: the end goal is to use ffmpeg w/ libnvenc enabled to encode video for either local recordings and or livestreaming to a rtmp server using simplescreenrecorder or even make obs-studio use libnvenc as well. Not sure about kdenlive using it since melt is involved there and as I said I'm not a programmer
            Hey dude,

            It worked out of the box because I installed NVIDIA CUDA 6.5 toolkit which comes with OpenCL headers that are installed globally -)

            Secondly, you'll need to install OpenCL-1.2 headers from the AUR. Search for the package and you'll see that ffmpeg-full (On AUR, comes with --enable-opencl turned on by default) lists it as a build dependency.

            Good luck, man.

            Comment


            • #26
              Originally posted by stqn View Post
              Too bad that NVENC, at least on a GTX 680, seems to produce extremely low quality encodes…
              (Based on this article in French: http://www.hardware.fr/focus/67/enco...quicksync.html and more specifically this comparison: http://www.hardware.fr/marc/h264nven...?inception720a (you can click on the buttons at the bottom to compare NVENC with x264 veryfast for example))
              Wow, the only one of the non source outputs that looked like anywhere near an acceptable loss in quality was the 2 pass x264 veryfast. Everything else just looked atrocious. Looks like all these hardware based encoding API's still fall flat which is the same verdict I remember the tech sites came to when I read up on the results a few years ago.

              Comment


              • #27
                Hmh there's seems to be new nvenc encoder on ffmeg github:
                http://ffmpeg.org/doxygen/trunk/nvenc_8c.html
                https://github.com/FFmpeg/FFmpeg/blo...vcodec/nvenc.c

                Is this somewhat different than libnvenc?

                Comment


                • #28
                  Originally posted by tuke81 View Post
                  Hmh there's seems to be new nvenc encoder on ffmeg github:
                  http://ffmpeg.org/doxygen/trunk/nvenc_8c.html
                  https://github.com/FFmpeg/FFmpeg/blo...vcodec/nvenc.c

                  Is this somewhat different than libnvenc?
                  Hi i tested FFMPEG master and nvenc works similar to libnvenc with some diferences


                  For example before use this command

                  ffmpeg -f x11grab -r 60 -s 1024x768 -i :0.0 -vcodec libnvenc -b:v 5750k /media/linuxdesktopx86/CA98D46898D45513/Por-Encodificar/mmfxt5750k.mkv

                  and now

                  ffmpeg -f x11grab -r 60 -s 1024x768 -i :0.0 -vcodec nvenc -b:v 5750k /media/linuxdesktopx86/CA98D46898D45513/Por-Encodificar/mmfxt5750k.mkv


                  In tests with libnvenc at 30fps normally use NVENC unit around 12% in 64bit Mint

                  https://www.youtube.com/watch?v=Uw8CHnByxs8


                  With ffmpeg nvenc, NVENC unit up use to 15 to 18% (depend game) in 64bit Mint




                  But main change in my tests is this, when use libnvenc on 32bit Mint appears slowdown error related swscaler but now with ffmpeg nvenc this error gone and have better performance in 32bit Mint

                  https://www.youtube.com/watch?v=ytnIzVet8Y4

                  In my youtube channel appears more test with this FFMPEG nvenc (actually used for screencasting)

                  All videos uploaded after FFMPEG 2.5 nvenc test stay recorded with this FFMPEG 2.5 nvenc

                  Comment


                  • #29
                    Something more when record in 60fps with ffmpeg libnvenc, NVENC unit stay around 22 to 28% of use in 64bit Mint

                    https://www.youtube.com/watch?v=Cpy3uEeoPTE

                    And with ffmpeg 2.5 nvenc, NVENC unit stay around 27 to 34% (depend game) of use in 64bit



                    Also have specific NVENC videos on my theme on gamersonlinux

                    Comment


                    • #30
                      Have you tried different presets? i.e. -c:v nvenc -preset llhq. Presets are
                      hq = high quality (I think libnvenc uses this)
                      hp = high performance
                      bd = Bluray Disk
                      ll = low latency
                      llhq = low latency high quality
                      llhp = low latency high performance
                      default = between llhq and llhp, I suppose it's same as ll

                      You can also use 2 pass with low latency presets too, with option -2pass 1. I'm not sure are all presets supported by kepler cards though.

                      Comment

                      Working...
                      X