st1905

FreeBSD NVIDIA Nvenc Hardware Encoding using ffmpeg or Handbrake

Nov 14th, 2020 (edited)
953
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.42 KB | None | 0 0
  1. Here is how to enable nvenc for ffmpeg and handbrake on FreeBSD (This is possible by the work of shkhln (Alex))
  2.  
  3. What you will need ?
  4.  
  5. https://github.com/shkhln/libc6-shim
  6.  
  7. This repository contains a shim library providing limited glibc ABI compatibility on top of FreeBSD libc.
  8.  
  9. The library is intended to allow loading shared objects compiled on Linux and dynamically linked to glibc into native FreeBSD processes for a few use cases that warrant such a hack. Although FreeBSD already has a very useful Linux compatibility feature, this kind of ad hoc ABI mixing is out of scope for it.
  10.  
  11. https://github.com/shkhln/revird-aidivn
  12.  
  13. The above repo contains updated and patched libs for Nvidia. It also contains handbrake and ffmpeg along with FFmpeg version of Nvidia Codec SDK headers.
  14.  
  15. Install nvidia-driver and linux-nvidia-libs.
  16.  
  17. then nv-codec-headers
  18.  
  19. ffmpeg (if you need nvenc support with it)
  20.  
  21. handbrake (it adds h264_nvenc and h265_nvenc which allows hardware encoding using nvidia cuda device).
  22.  
  23. Now there is no libnvidia-encode.so.1 for FreeBSD and you can`t run nvenc with handbrake without it.
  24.  
  25. you will use nv-sglrun from libc6-shim
  26.  
  27. nv-sglrun ghb
  28.  
  29. This will activate h264_nvenc and h265_nvenc to the enconding options on handbrake. libnvidia-encode.so.1 (linux library) is loaded using nv-sglrun.
  30.  
  31. From now on when you use h264_nvenc or h265_nvenc, you will see Video Engine Utilization go up in nvidia settings.
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment