linuxserver / docker-ffmpeg

GNU General Public License v3.0
154 stars 46 forks source link

[FEAT] Enable ffnvcodec to allow HEVC serde for NVIDIA GPUs #69

Closed cyrus01337 closed 6 months ago

cyrus01337 commented 6 months ago

Is this a new feature request?

Wanted change

Allow HEVC serde to benefit from NVIDIA GPU acceleration.

Reason for change

I am currently unable to quickly encode videos using HEVC, which can be remedied with GPU acceleration.

This is currently possible with AMD GPUs through some testing, so I would assume it would also be the case for NVIDIA. Unfortunately, that isn't the case.

The image already has the benefit of supporting GPU acceleration which I believe do not need to be named, however, I believe #60 may have missed this out or perhaps it was a new change on FFMPEG's part (I am quite new to the FFMPEG scene and am currently learning it).

Proposed code change

According to the docs (also linked on the Docker image's description), following the NVENC section should be enough in theory.

I am happy to test for x86_64.

github-actions[bot] commented 6 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 6 months ago

Allow HEVC serde to benefit from NVIDIA GPU acceleration.

What is hevc serde?

I'm afraid I don't follow what you're requesting or what exactly is not working.

According to the docs (also linked on the Docker image's description), following the NVENC section should be enough in theory.

We already do all that and nvdec/nvenc was well tested in this image.

cyrus01337 commented 6 months ago

Apologies for the confusion, serde is a term for serialisation and de-serialisation. I wrote this quite late and ended up using it as a replacement term for encoding/decoding.

I have been testing it and it appeared no devices were detected when testing with it, if it's already been well tested then I can rule this out as a user error and debug on my side rather than requesting on this side.

Thanks all the same!

aptalca commented 6 months ago

To use Nvidia in docker, you need to install Nvidia container toolkit and the nvidia drivers on the host. https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

I'm not sure if you did that or not because you didn't provide any info on what you tried and what error you got.

Assuming it's installed, the docker run sample provided in the readme for Nvidia should work.