How to install / compile NVENC in ubuntu?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







10















I see support for nvidia NVENC in this document, but it seems confusing, some step by step? or PPA with ffmpeg-nvenc for ubuntu?



http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/FFMPEG-with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf










share|improve this question































    10















    I see support for nvidia NVENC in this document, but it seems confusing, some step by step? or PPA with ffmpeg-nvenc for ubuntu?



    http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/FFMPEG-with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf










    share|improve this question



























      10












      10








      10


      3






      I see support for nvidia NVENC in this document, but it seems confusing, some step by step? or PPA with ffmpeg-nvenc for ubuntu?



      http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/FFMPEG-with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf










      share|improve this question
















      I see support for nvidia NVENC in this document, but it seems confusing, some step by step? or PPA with ffmpeg-nvenc for ubuntu?



      http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/FFMPEG-with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf







      nvidia software-installation compiling ffmpeg codecs






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 15 '16 at 4:20









      andrew.46

      22.3k1470150




      22.3k1470150










      asked May 27 '16 at 6:32









      Fast OSFast OS

      51114




      51114






















          1 Answer
          1






          active

          oldest

          votes


















          14














          As always with FFmpeg continuing development shifts the goal posts many times and this is certainly true of nvenc and FFmpeg. There have been 3 phases:





          1. Roll your own: Pre August 27th 2016 it was necessary to track down your own headers to build nvenc. Arduous and more than a little confusing.


          2. Built into the source: August 27th 2016 saw the required headers incorporated as part of the FFmpeg source, nothing required but the ability to compile the FFmpeg source from git, or use a 'release' version cut from git at this time.


          3. Use nv-codec-headers: On February 26th 2018 the NVidia headers were removed from the FFmpeg source. A separate git repository was created to hold continuing work with these headers. At the moment these headers must be installed as well as FFmpeg from git to get access to nvenc and friends.


          Two steps are required:



          1. Install the nv-codec-headers package:



          Something like the following Terminal commands should suffice:



          sudo apt-get install make git
          mkdir $HOME/nv-codec-headers_build && cd $HOME/nv-codec-headers_build
          git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
          cd nv-codec-headers
          make && sudo make install


          If for some reason you change your mind and wish to completely remove the installed files as well as the build directory simply run the following two Terminal commands:



          sudo rm -v /usr/local/{lib/pkgconfig/ffnvcodec.pc,include/ffnvcodec/*.h}
          rm -rfv $HOME/nv-codec-headers_build


          And your system has been cleaned. If however you wish to continue use the following step:



          2. Compile FFmpeg:



          Use this very well tested guide:




          • Compile FFmpeg on Ubuntu, Debian, or Mint
            https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu


          The nv-codec-headers will be automagically recognised (no extra ./configure options are needed) and nvenc will be successfully built.



          Testing:



          I have tested this on Bionic Beaver LTS and the results are:



          andrew@ilium:~$ 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)
          andrew@ilium:~$


          And if you see a similar picture as above, and you have a supported graphics card, you are right to go :)



          Notes:




          • There is no difference between hevc_nvenc and nvenc_hevc: the nvenc_* variants are the old legacy names.

          • You can view options specific to each encoder. For example, ffmpeg -h encoder=h264_nvenc.


          • Hardware Acceleration Guide for FFmpeg: FFmpeg Wiki guide for hardware acceleration in general with FFmpeg, a canonical section for compiling and using nvenc...

          • The latest version corresponds to Video Codec SDK version 9.0.18 and requires NVidia drivers version 418.30 or newer.






          share|improve this answer


























          • Thanks so much for this detailed guide. I got similar output from your testing section, which is great. Aside from the nVidia drivers, do we also need to install the Cuda SDK to get FFMPEG to use the installed GPU?

            – Kimberly W
            yesterday











          • @KimberlyW Not required on my system, I have just now tested...

            – andrew.46
            yesterday












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f778100%2fhow-to-install-compile-nvenc-in-ubuntu%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          14














          As always with FFmpeg continuing development shifts the goal posts many times and this is certainly true of nvenc and FFmpeg. There have been 3 phases:





          1. Roll your own: Pre August 27th 2016 it was necessary to track down your own headers to build nvenc. Arduous and more than a little confusing.


          2. Built into the source: August 27th 2016 saw the required headers incorporated as part of the FFmpeg source, nothing required but the ability to compile the FFmpeg source from git, or use a 'release' version cut from git at this time.


          3. Use nv-codec-headers: On February 26th 2018 the NVidia headers were removed from the FFmpeg source. A separate git repository was created to hold continuing work with these headers. At the moment these headers must be installed as well as FFmpeg from git to get access to nvenc and friends.


          Two steps are required:



          1. Install the nv-codec-headers package:



          Something like the following Terminal commands should suffice:



          sudo apt-get install make git
          mkdir $HOME/nv-codec-headers_build && cd $HOME/nv-codec-headers_build
          git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
          cd nv-codec-headers
          make && sudo make install


          If for some reason you change your mind and wish to completely remove the installed files as well as the build directory simply run the following two Terminal commands:



          sudo rm -v /usr/local/{lib/pkgconfig/ffnvcodec.pc,include/ffnvcodec/*.h}
          rm -rfv $HOME/nv-codec-headers_build


          And your system has been cleaned. If however you wish to continue use the following step:



          2. Compile FFmpeg:



          Use this very well tested guide:




          • Compile FFmpeg on Ubuntu, Debian, or Mint
            https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu


          The nv-codec-headers will be automagically recognised (no extra ./configure options are needed) and nvenc will be successfully built.



          Testing:



          I have tested this on Bionic Beaver LTS and the results are:



          andrew@ilium:~$ 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)
          andrew@ilium:~$


          And if you see a similar picture as above, and you have a supported graphics card, you are right to go :)



          Notes:




          • There is no difference between hevc_nvenc and nvenc_hevc: the nvenc_* variants are the old legacy names.

          • You can view options specific to each encoder. For example, ffmpeg -h encoder=h264_nvenc.


          • Hardware Acceleration Guide for FFmpeg: FFmpeg Wiki guide for hardware acceleration in general with FFmpeg, a canonical section for compiling and using nvenc...

          • The latest version corresponds to Video Codec SDK version 9.0.18 and requires NVidia drivers version 418.30 or newer.






          share|improve this answer


























          • Thanks so much for this detailed guide. I got similar output from your testing section, which is great. Aside from the nVidia drivers, do we also need to install the Cuda SDK to get FFMPEG to use the installed GPU?

            – Kimberly W
            yesterday











          • @KimberlyW Not required on my system, I have just now tested...

            – andrew.46
            yesterday
















          14














          As always with FFmpeg continuing development shifts the goal posts many times and this is certainly true of nvenc and FFmpeg. There have been 3 phases:





          1. Roll your own: Pre August 27th 2016 it was necessary to track down your own headers to build nvenc. Arduous and more than a little confusing.


          2. Built into the source: August 27th 2016 saw the required headers incorporated as part of the FFmpeg source, nothing required but the ability to compile the FFmpeg source from git, or use a 'release' version cut from git at this time.


          3. Use nv-codec-headers: On February 26th 2018 the NVidia headers were removed from the FFmpeg source. A separate git repository was created to hold continuing work with these headers. At the moment these headers must be installed as well as FFmpeg from git to get access to nvenc and friends.


          Two steps are required:



          1. Install the nv-codec-headers package:



          Something like the following Terminal commands should suffice:



          sudo apt-get install make git
          mkdir $HOME/nv-codec-headers_build && cd $HOME/nv-codec-headers_build
          git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
          cd nv-codec-headers
          make && sudo make install


          If for some reason you change your mind and wish to completely remove the installed files as well as the build directory simply run the following two Terminal commands:



          sudo rm -v /usr/local/{lib/pkgconfig/ffnvcodec.pc,include/ffnvcodec/*.h}
          rm -rfv $HOME/nv-codec-headers_build


          And your system has been cleaned. If however you wish to continue use the following step:



          2. Compile FFmpeg:



          Use this very well tested guide:




          • Compile FFmpeg on Ubuntu, Debian, or Mint
            https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu


          The nv-codec-headers will be automagically recognised (no extra ./configure options are needed) and nvenc will be successfully built.



          Testing:



          I have tested this on Bionic Beaver LTS and the results are:



          andrew@ilium:~$ 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)
          andrew@ilium:~$


          And if you see a similar picture as above, and you have a supported graphics card, you are right to go :)



          Notes:




          • There is no difference between hevc_nvenc and nvenc_hevc: the nvenc_* variants are the old legacy names.

          • You can view options specific to each encoder. For example, ffmpeg -h encoder=h264_nvenc.


          • Hardware Acceleration Guide for FFmpeg: FFmpeg Wiki guide for hardware acceleration in general with FFmpeg, a canonical section for compiling and using nvenc...

          • The latest version corresponds to Video Codec SDK version 9.0.18 and requires NVidia drivers version 418.30 or newer.






          share|improve this answer


























          • Thanks so much for this detailed guide. I got similar output from your testing section, which is great. Aside from the nVidia drivers, do we also need to install the Cuda SDK to get FFMPEG to use the installed GPU?

            – Kimberly W
            yesterday











          • @KimberlyW Not required on my system, I have just now tested...

            – andrew.46
            yesterday














          14












          14








          14







          As always with FFmpeg continuing development shifts the goal posts many times and this is certainly true of nvenc and FFmpeg. There have been 3 phases:





          1. Roll your own: Pre August 27th 2016 it was necessary to track down your own headers to build nvenc. Arduous and more than a little confusing.


          2. Built into the source: August 27th 2016 saw the required headers incorporated as part of the FFmpeg source, nothing required but the ability to compile the FFmpeg source from git, or use a 'release' version cut from git at this time.


          3. Use nv-codec-headers: On February 26th 2018 the NVidia headers were removed from the FFmpeg source. A separate git repository was created to hold continuing work with these headers. At the moment these headers must be installed as well as FFmpeg from git to get access to nvenc and friends.


          Two steps are required:



          1. Install the nv-codec-headers package:



          Something like the following Terminal commands should suffice:



          sudo apt-get install make git
          mkdir $HOME/nv-codec-headers_build && cd $HOME/nv-codec-headers_build
          git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
          cd nv-codec-headers
          make && sudo make install


          If for some reason you change your mind and wish to completely remove the installed files as well as the build directory simply run the following two Terminal commands:



          sudo rm -v /usr/local/{lib/pkgconfig/ffnvcodec.pc,include/ffnvcodec/*.h}
          rm -rfv $HOME/nv-codec-headers_build


          And your system has been cleaned. If however you wish to continue use the following step:



          2. Compile FFmpeg:



          Use this very well tested guide:




          • Compile FFmpeg on Ubuntu, Debian, or Mint
            https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu


          The nv-codec-headers will be automagically recognised (no extra ./configure options are needed) and nvenc will be successfully built.



          Testing:



          I have tested this on Bionic Beaver LTS and the results are:



          andrew@ilium:~$ 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)
          andrew@ilium:~$


          And if you see a similar picture as above, and you have a supported graphics card, you are right to go :)



          Notes:




          • There is no difference between hevc_nvenc and nvenc_hevc: the nvenc_* variants are the old legacy names.

          • You can view options specific to each encoder. For example, ffmpeg -h encoder=h264_nvenc.


          • Hardware Acceleration Guide for FFmpeg: FFmpeg Wiki guide for hardware acceleration in general with FFmpeg, a canonical section for compiling and using nvenc...

          • The latest version corresponds to Video Codec SDK version 9.0.18 and requires NVidia drivers version 418.30 or newer.






          share|improve this answer















          As always with FFmpeg continuing development shifts the goal posts many times and this is certainly true of nvenc and FFmpeg. There have been 3 phases:





          1. Roll your own: Pre August 27th 2016 it was necessary to track down your own headers to build nvenc. Arduous and more than a little confusing.


          2. Built into the source: August 27th 2016 saw the required headers incorporated as part of the FFmpeg source, nothing required but the ability to compile the FFmpeg source from git, or use a 'release' version cut from git at this time.


          3. Use nv-codec-headers: On February 26th 2018 the NVidia headers were removed from the FFmpeg source. A separate git repository was created to hold continuing work with these headers. At the moment these headers must be installed as well as FFmpeg from git to get access to nvenc and friends.


          Two steps are required:



          1. Install the nv-codec-headers package:



          Something like the following Terminal commands should suffice:



          sudo apt-get install make git
          mkdir $HOME/nv-codec-headers_build && cd $HOME/nv-codec-headers_build
          git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
          cd nv-codec-headers
          make && sudo make install


          If for some reason you change your mind and wish to completely remove the installed files as well as the build directory simply run the following two Terminal commands:



          sudo rm -v /usr/local/{lib/pkgconfig/ffnvcodec.pc,include/ffnvcodec/*.h}
          rm -rfv $HOME/nv-codec-headers_build


          And your system has been cleaned. If however you wish to continue use the following step:



          2. Compile FFmpeg:



          Use this very well tested guide:




          • Compile FFmpeg on Ubuntu, Debian, or Mint
            https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu


          The nv-codec-headers will be automagically recognised (no extra ./configure options are needed) and nvenc will be successfully built.



          Testing:



          I have tested this on Bionic Beaver LTS and the results are:



          andrew@ilium:~$ 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)
          andrew@ilium:~$


          And if you see a similar picture as above, and you have a supported graphics card, you are right to go :)



          Notes:




          • There is no difference between hevc_nvenc and nvenc_hevc: the nvenc_* variants are the old legacy names.

          • You can view options specific to each encoder. For example, ffmpeg -h encoder=h264_nvenc.


          • Hardware Acceleration Guide for FFmpeg: FFmpeg Wiki guide for hardware acceleration in general with FFmpeg, a canonical section for compiling and using nvenc...

          • The latest version corresponds to Video Codec SDK version 9.0.18 and requires NVidia drivers version 418.30 or newer.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 1 hour ago

























          answered Oct 15 '16 at 4:20









          andrew.46andrew.46

          22.3k1470150




          22.3k1470150













          • Thanks so much for this detailed guide. I got similar output from your testing section, which is great. Aside from the nVidia drivers, do we also need to install the Cuda SDK to get FFMPEG to use the installed GPU?

            – Kimberly W
            yesterday











          • @KimberlyW Not required on my system, I have just now tested...

            – andrew.46
            yesterday



















          • Thanks so much for this detailed guide. I got similar output from your testing section, which is great. Aside from the nVidia drivers, do we also need to install the Cuda SDK to get FFMPEG to use the installed GPU?

            – Kimberly W
            yesterday











          • @KimberlyW Not required on my system, I have just now tested...

            – andrew.46
            yesterday

















          Thanks so much for this detailed guide. I got similar output from your testing section, which is great. Aside from the nVidia drivers, do we also need to install the Cuda SDK to get FFMPEG to use the installed GPU?

          – Kimberly W
          yesterday





          Thanks so much for this detailed guide. I got similar output from your testing section, which is great. Aside from the nVidia drivers, do we also need to install the Cuda SDK to get FFMPEG to use the installed GPU?

          – Kimberly W
          yesterday













          @KimberlyW Not required on my system, I have just now tested...

          – andrew.46
          yesterday





          @KimberlyW Not required on my system, I have just now tested...

          – andrew.46
          yesterday


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f778100%2fhow-to-install-compile-nvenc-in-ubuntu%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          GameSpot

          日野市

          Tu-95轟炸機