Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

Can't get NVENC installed correctly

Troubleshooting compilation problems on all platforms.

Can't get NVENC installed correctly

Postby evilarceus » Sat Sep 17, 2016 3:01 am

Hi, first time here, trying to compile ffmpeg with NVENC support to use with OBS. I'm a complete beginner for this kind of stuff, so please bear with me :D

Currently, I have:
-Installed the NVIDIA Video Codec SDK and Graphics Driver 361.42
-Compiled ffmpeg with the console output:
Code: Select all
ffmpeg version N-81676-g8433d95 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: prefix=/home/evilarceus/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/evilarceus/ffmpeg_build/include --extra-ldflags=-L/home/evilarceus/ffmpeg_build/lib bindir=/home/evilarceus/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-nvenc
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 56.100 / 57. 56.100
  libavformat    57. 49.100 / 57. 49.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 62.100 /  6. 62.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'


My next guess to what would be going wrong is CUDA not being installed, but I'd like to double check here if that's what's causing it (had to install CUDA SDK previously on my previous Ubuntu install, it was a pain :L)
Also, my ffmpeg is in "/home/evilarceus/bin/", if that helps at all :P

Not exactly sure what is wrong though, help would be appreciated!
evilarceus
 
Posts: 3
Joined: Sat Sep 17, 2016 2:39 am

Re: Can't get NVENC installed correctly

Postby llogan » Sat Sep 17, 2016 6:38 am

You didn't show any errors. What is your command that you used? Please also show the resulting complete console output.

Which video card are you using?
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2339
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska

Re: Can't get NVENC installed correctly

Postby evilarceus » Sun Sep 18, 2016 2:14 am

My GPU is NVIDIA GTX 950.
I use the command:
Code: Select all
ffmpeg  -i input.mp4 -vcodec h264_nvenc output.mp4


and get this output:
Code: Select all
evilarceus@evilarceus-HOME:~/Videos$ ffmpeg -y -i input.mp4 -vcodec h264_nvenc -b:v 5M -acodec copy output.mp4
ffmpeg version git-2016-09-16-3ea28f3 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --enable-shared --prefix=/usr --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-nvenc
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 56.100 / 57. 56.100
  libavformat    57. 49.100 / 57. 49.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 62.100 /  6. 62.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp41isom
    creation_time   : 2016-06-07T03:02:33.000000Z
    date            : 2016
  Duration: 00:01:47.55, start: 0.000000, bitrate: 2441 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt470m), 1920x1080 [SAR 1:1 DAR 16:9], 2237 kb/s, 58.76 fps, 59.94 tbr, 60k tbn, 120 tbc (default)
    Metadata:
      creation_time   : 2016-06-07T03:02:33.000000Z
      handler_name    : VideoHandler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
    Metadata:
      creation_time   : 2016-06-07T03:02:33.000000Z
      handler_name    : SoundHandler
[h264_nvenc @ 0x1a486a0] Cannot load NvEncodeAPIGetMaxSupportedVersion
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp41isom
    date            : 2016
    Stream #0:0(und): Unknown: none, SAR 1:1 DAR 0:0 (default)
    Metadata:
      creation_time   : 2016-06-07T03:02:33.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.56.100 h264_nvenc
    Stream #0:1(und): Unknown: none (default)
    Metadata:
      creation_time   : 2016-06-07T03:02:33.000000Z
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (copy)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height


I do notice this in the output:
Code: Select all
[h264_nvenc @ 0x1a486a0] Cannot load NvEncodeAPIGetMaxSupportedVersion


However, I can verify that "NvEncodeAPI.h" is in my "/usr/local/include/" folder
Using the command "ls /usr/local/include":
Code: Select all
evilarceus@evilarceus-HOME:~/Videos$ ls /usr/local/include
cudaModuleMgr.h          dynlink_cudaGL.h      helper_timer.h
drvapi_error_string.h    dynlink_cuda.h        nvCPUOPSys.h
dynlink_builtin_types.h  dynlink_cuviddec.h    nvEncodeAPI.h
dynlink_cuda_cuda.h      dynlink_nvcuvid.h     NvEncoder.h
dynlink_cudaD3D10.h      exception.h           nvFileIO.h
dynlink_cudaD3D11.h      helper_cuda_drvapi.h  NvHWEncoder.h
dynlink_cudaD3D9.h       helper_cuda.h         nvUtils.h
dynlink_cuda_d3d.h       helper_functions.h    x264_config.h
dynlink_cuda_gl.h        helper_string.h       x264.h


EDIT: I installed NVIDIA Video SDK 7.0.1.
EDIT 2: Installed CUDA SDK, didn't help.
evilarceus
 
Posts: 3
Joined: Sat Sep 17, 2016 2:39 am

Re: Can't get NVENC installed correctly

Postby evilarceus » Mon Sep 19, 2016 12:01 am

Ok, fixed it. Turns out you had to install Nvidia driver 367.44. I had 361.72 instead. Whoops :P
evilarceus
 
Posts: 3
Joined: Sat Sep 17, 2016 2:39 am

Re: Can't get NVENC installed correctly

Postby llogan » Mon Sep 19, 2016 1:24 am

Thanks for the follow-up.
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2339
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska


Return to Compiling FFmpeg

Who is online

Users browsing this forum: Google [Bot] and 4 guests