ffmpeg includes support for Nvidia's libnpp, which enables various video transformations — particularly resizing — to be performed on the GPU. This is necessary for efficiently processing video streams decoded/encoded/transcoded on Nvidia GPUs.
libnpp support is enabled using --enable-libnpp in ffmpeg's ./configure . The Gentoo ffmpeg packages do not provide a way to enable this flag.
libnpp is provided by dev-util/nvidia-cuda-toolkit
I can see three possible ways to implement this, in increasing order of preference:
#1: Add an "npp" USE flag to ffmpeg that adds a dependency on dev-util/nvidia-cuda-toolkit
#2: Add the "cuda" USE flag to ffmpeg, and have it do the same as #1
#3: Modify how the existing video_cards_nvidia USE flag operates in the ffmpeg packages to require dev-util/nvidia-cuda-toolkit, and to add --enable-libnpp to the ./configure command
IMO, #3 is the sanest option, because I can't imagine a circumstance when someone would want to add nvidia hardware decode/encode/transcode support to ffmpeg, but not want hardware-accelerated video transform filters.
Created attachment 646416 [details]
Ebuild that enables NPP support for 4.2.3.
The added include and linking directives at lines 470 and 471 seem kind of ugly to me, but I couldn't get the configuration script to complete without them.
The ffmpeg build process has to be able to find the NPP headers and libraries, which aren't installed by default in a location that GCC looks for them. And of course CUDA doesn't use pkgconfig, and ffmpeg rolls its own configuration script instead of using autoconf. There's probably a better, more ebuild-ish way of determining where the headers and libraries are, and passing the appropriate directives on to the ffmpeg configuration script, but I don't know what it is.
At any rate, ffmpeg compiles and runs with the NPP filters using this ebuild.
What's the status on this? Are there things I can improve with the suggested ebuild changed to get the changes in the main repo?
We don't have the cuda scaler either; right now we need external ffmpeg to keep transcodes entirely in GPU on Gentoo.