Bug 264027 - multimedia/ffmpeg: add NVENC option
Summary: multimedia/ffmpeg: add NVENC option
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on: 264025
Blocks:
  Show dependency treegraph
 
Reported: 2022-05-16 21:08 UTC by Alex S
Modified: 2022-10-29 13:23 UTC (History)
3 users (show)

See Also:


Attachments
nvenc support (2.08 KB, patch)
2022-05-16 21:08 UTC, Alex S
no flags Details | Diff
nvenc support (2.07 KB, patch)
2022-08-31 19:47 UTC, Alex S
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex S 2022-05-16 21:08:57 UTC
Created attachment 233972 [details]
nvenc support

1. Mostly taken from https://github.com/scfarley/ports/commit/42b8875ea435c0fb4ff8a1d9db8797f6fa25be37.

2. Would be nice to make this a default setting as well.

3. At the moment there are no native FreeBSD versions of libcuda.so/libnvidia-encode.so/libnvcuvid.so, so to actually use NVENC we need to load the Linux binaries for those libs with the help of emulators/libc6-shim and the `nv-sglrun` script from that port. Something like this:

% sudo pkg install nvidia-driver linux-nvidia-libs libc6-shim obs-studio
% nv-sglrun obs

4. nvidia-driver version should be >= 495.
Comment 1 Alex S 2022-08-31 00:59:24 UTC
Hello?
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2022-08-31 07:09:59 UTC
Moin moin 

Could you please rebase the patch against the current tree?


mfg Tobias
Comment 3 Alex S 2022-08-31 19:47:29 UTC
Created attachment 236269 [details]
nvenc support
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-10-19 17:44:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2b8c1c0c04209a7630d53df0b6c5a07c6ebe4c10

commit 2b8c1c0c04209a7630d53df0b6c5a07c6ebe4c10
Author:     Alex S <iwtcex@gmail.com>
AuthorDate: 2022-05-16 21:08:57 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-10-19 17:43:35 +0000

    multimedia/ffmpeg: add NVENC option

    On FreeBSD requires nvidia-driver >= 495 for CUDA initialization fix
    and linux-nvidia-libs + libc6-shim until nvidia-driver provides native
    libcuda.so, libnvidia-encode.so, libnvcuvid.so.

    PR:             264027

 multimedia/ffmpeg/Makefile              | 7 ++++++-
 multimedia/ffmpeg/files/patch-configure | 9 +++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-10-19 17:44:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9db4ec99380561d3538e8caa2a6bf8368ad02b8f

commit 9db4ec99380561d3538e8caa2a6bf8368ad02b8f
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-10-19 17:12:28 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-10-19 17:43:40 +0000

    multimedia/ffmpeg: enable NVENC by default

    - NVIDIA GPUs are popular on FreeBSD (due to direct vendor support)
    - No extra dependencies for package-only users
    - No changes at runtime unless explicitly requested

    PR:             264027

 multimedia/ffmpeg/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-10-29 13:23:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=38d34d4542e0af8cd2be6fbe3dc365e06db0bdc3

commit 38d34d4542e0af8cd2be6fbe3dc365e06db0bdc3
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-10-29 13:08:13 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-10-29 13:22:22 +0000

    multimedia/mpv: enable NVDEC by default after 9db4ec993805

    $ man mpv
    [...]
    NOTE:
       Most non-copy methods only work with the OpenGL GPU backend.
       Currently, only the vaapi, nvdec and cuda methods work with
       Vulkan.

    PR:             264027

 multimedia/mpv/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)