h265ize
h265ize copied to clipboard
Add support for Nvidia gpu encoding
This requires the user to have a self compiled ffmpeg with nvenc enabled.
[https://ffmpeg.zeranoe.com/builds/](Zeranoe builds) for Windows are compiled with NVENC support.
I got it working on Windows. Add the following line into processVideo:
command.videoCodec('hevc_nvenc');. Incidentally, there's also hevc_qsv for Intel iGPUs. There doesn't seem to be any encoder for AMD though.
Performance went from 12fps to 344fps (i7-6700HQ, GTX 1060).
What rate control method have you been using?
I didn't really change any other settings than the encoder used. Sorry bout the late response, I forgot about it!
Oh yeah, about the NVIDIA card detection... not all NVIDIA GPUs have HEVC encoder. Second generation Maxwells and Pascals.
Let me see, all GTX 10xx works. Desktop GT 9xx works. GTX 965M and above works, basically all the GM20x cards from here.
For Intel iGPUs, Skylake models (6xxx) can encode 8-bit HEVC. If 10-bits, Kaby Lake (7xxx) is needed.
AMD GPUs do support HEVC encoding, but most ffmpeg builds don't have VCE support.
- Tonga: Radeon R9 285, Radeon R9 380, Radeon R9 380X / Mobile Radeon R9 M390X / R9 M395 / R9 M395X / Radeon R9 M485X
- Tonga XT: FirePro W7100 / S7100X / S7150 / S7150 X2
- Fiji: Radeon R9 Fury / R9 Fury X / R9 Nano / Radeon Pro Duo / FirePro S9300 / W7170M
- Polaris: RX 460 / 470 / 480
I forgot too lol.
I will be leaving it up to the user to make sure their hardware and ffmpeg build supports nvenc_hevc or hevc_qsv. h265ize will simply detect the possibility of hardware encoding support.
I have never come across a ffmpeg build that supports AMD hardware encoding. Perhaps you can point me in the right direction on that.
I see that AMD only started working with VCE recently, so no builds.
I see, hopefully we will get VCE support for ffmpeg soon.
Is there any way we could have nvenc_hevc support for Linux as well?
No. Hardware acceleration still hasn't even been added for windows.
+1 for nvenc_hevc support on Linux.
The current build of ffmpeg at the ffmpeg-3 ppa supports it out of the box: https://launchpad.net/~jonathonf/+archive/ubuntu/ffmpeg-3
The dirty change suggested by aschereT work like a charmed on Windows with Zeranoe builds.
~340fps with my 1080GTX.
For a quick reference for @FallingSnow: The command to get the GPU Informations:
// Mac OS:
system_profiler | grep GeForce
// Windows:
wmic path win32_VideoController get name
// Linux:
sudo lshw -C display
On windows the command will result like that:
$ wmic path win32_VideoController get name
Name
NVIDIA GeForce GTX 1080
Intel(R) HD Graphics 4000
I wish I had found this earlier, I tinkered with the source code in order to support the nvenc codec, the speed is incredible !
I'm going to compare the quality between a file encoded with libx265 and nvenc and see if it is worth the speed gain.
I wish I had found this earlier, I tinkered with the source code in order to support the nvenc codec, the speed is incredible !
I'm going to compare the quality between a file encoded with libx265 and nvenc and see if it is worth the speed gain.
Is this code uploaded somewhere, or could you share. I tried to figure it out, no luck, sadly.
I would love to use nvenc with h265ize
+1
Hi, This can be added in the latest bleeding edge version by editing lib/classes/video.js and replacing .videoCodec('libx265') with .videoCodec('hevc_nvenc'). Make sure you are on the bleeding edge version, the stable version bundles a ffmpeg binary that doesn't have support compiled in. Needs a working CUDA setup beforehand, on Ubuntu 20.04 with an NVIDIA quadro P400. Went from 36 fps to 365.
Hi, This can be added in the latest bleeding edge version by editing lib/classes/video.js and replacing
.videoCodec('libx265')with.videoCodec('hevc_nvenc'). Make sure you are on the bleeding edge version, the stable version bundles a ffmpeg binary that doesn't have support compiled in. Needs a working CUDA setup beforehand, on Ubuntu 20.04 with an NVIDIA quadro P400. Went from 36 fps to 365.
Tried this and still not seeing any GPU usage. Could you do a step by step?
For AMD GPU in the latest bleeding edge version by edit lib/classes/video.js and replace .videoCodec('libx265') with .videoCodec('hevc_amf')