I post this because I have not found a clear guide to do it, and after going around a lot and trying things in the end it turned out well. If there is already a guide for this, sorry, I have not found it, that some moderator delete the thread.
FIRST:
Have a CPU with Intel Quick Sync technology... obvious...
see:
https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video
https://ark.intel.com/content/…873&0_QuickSyncVideo=True
SECOND:
Install the drivers
It has worked for me with VA-API, see https://github.com/intel/intel-vaapi-driver
There are several drivers depending on the CPU, look for the correct one.
Install via console:
optional install vainfo to check the result
and then run
The system will spit out the graphical settings.
THIRD:
And finally include the graphical configuration in docker. I have done it using stacks, I put two examples, jellyfin and handbrake, both have worked for me. They are illustrative examples, each one must adapt them to their particular case, there is a lot of documentation on this.
The key is these two lines, which inform the docker where the graph is:
For Handbrake:
For Jellyfin:
Note: In the case of Jellyfin, I previously assigned the user I use for that docker to the video and render groups. I don't know if this is necessary but I'm not going to touch it now that it works
RESULT:
Handbrake encoding video on the NAS in 7.5 times less time than without Quick Sync.
Jellyfin streaming 4K encoded video at 10% CPU.
NAS administrator, you don't have time to queue videos from Handbrake.