2 2
JMCC

[HOWTO]: Emby Server with hardware transcoding in XU4/HC1/HC2 Armbian Stretch

Recommended Posts

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.

 

  1. >> DOWNLOAD the emby and ffmpeg packages from this link <<
  2. 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

     

  3. 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

     

  4. Add the user "emby" to the video group, so it can have access to the transcoding engine:
    $ sudo usermod -aG video emby

     

  5. 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 \
    
    # to:
    
    ffmpeg /usr/bin/ffmpeg \

     

  6. Restart the service:

    $ sudo service emby-server restart

     

  7. 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).

  8. 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:743001677_2018-08-2917_32_32-Transcoding.thumb.png.4ff3b4db527d9b0a318b327e9afca184.png

 

 

1122350758_2018-08-2917_32_45-Transcoding.thumb.png.3fe655aadc8dcc6ea6af274e33860545.png

 

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2