As a result of all the work that Armbian developers put into the upgrade to kernel 4.14 for the XU4 board family, now we can enjoy many new features. One of them is the access to the SoC video encoding capabilities.
Emby Media Server can take advantage of the Exynos 5422 MFC video engine for transcoding. That means lower CPU usage, lower temperatures, and the possibility of encoding in real time higher resolutions or more simultaneous streams. In my tests, I've been able to transcode one HEVC 1080p and one 480p at the same time, or five 480p (though it will depend on the bitrate of the source material).
However, the ffmpeg version shipped with official Emby is quite unstable when using this feature. For that reason, I compiled a better and more stable version from @memeka's repo. I've been using it for over a month without a single crash.
So this is a step-by step guide on how to make everything work:
0. [PREREQUISITE]: You must be running an Armbian Strech XU4 "Next" image, like the one you can download here.
>> DOWNLOAD the emby and ffmpeg packages from this link <<
Install them (Note: this will install Emby Server version 3.5.3, which is the last at the writing of this tutorial. It has been tested to work with this version, and may or may not work with any other):
$ tar xvf emby-server-stretch-xu4_1.0.tar.xz
$ sudo dpkg -i ffmpeg/*.deb
$ sudo dpkg -i emby-server/*.deb
$ sudo apt -f install
Hold the ffmpeg packages, so they don't get upgraded:
$ sudo apt-mark hold ffmpeg-doc ffmpeg libavcodec-dev libavcodec-extra libavdevice-dev libavfilter-dev libavfilter-extra libavformat-dev libavresample-dev libavutil-dev libmysofa-dev libmysofa-utils libmysofa0 libpostproc-dev libswresample-dev libswscale-dev
Add the user "emby" to the video group, so it can have access to the transcoding engine:
$ sudo usermod -aG video emby
Modify the emby executable, to use our custom ffmpeg (Note: you will need to repeat this step every time you update the emby deb package):
$ sudo nano /opt/emby-server/bin/emby-server
# Change the following line:
ffmpeg $APP_DIR/bin/ffmpeg \
ffmpeg /usr/bin/ffmpeg \
Restart the service:
$ sudo service emby-server restart
Now, you can open the web browser, point to your Emby server (e.g. http://odroidxu4.local:8096), and configure it as described in the official tutorial (https://github.com/MediaBrowser/Wiki/wiki/Installation).
For last, you need to enable Hardware video transcoding in the web interface. The option is under the "Transcoding" submenu. Don't forget to click on "Save" when you are done:
And that's it!
As an additional tip, I recommend disabling UPnP in Emby, because it causes the program to crash frequently when enabled (this is just a general recommendation, it has nothing to do with hardware encoding).
Enjoy! And please, share your experiences and comments here.