Setup Jellyfin as Your Home Media Server
There are mainly two ways of storing multimedia: keeping them in client, or in server. For the later option, three softwares can be chose: Plex, Emby and Jellyfin. Today let’s talk about the last one —— Jellyfin.
Background
We choose Jellyfin because it’s the only open source solution. Actually, Emby used to be open source as well, but after the company decided to close source, some developer were get annoyed and launched the opensource version of Emby, that’s Jellyfin.
The main page of Jellyfin is as bellow
Installation
I will try to install Jelyfin on Ubuntu, but it also supports a bunch of platforms, such as Windows, Mac and Android.
1 | sudo apt install apt-transport-https |
Now you can access the server through http://your_local_IP_address:8096
to finish the initial setup.
Configuration
Nginx
If your server has public IP address, you may want to access Jellyfin through domain rather than IP:Port.
And normally a server will run multi service simultaneously, then you will need a reverse proxy to route different domain to the related service. Here I will take Nginx as example.
The default config will only use http
as the lack of TLS cert. Your can uncomment the related line to enable https
to increase security.
/etc/nginx/conf.d/jellyfin.conf
1 | # Uncomment the commented sections after you have acquired a SSL Certificate |
Hardware Acceleration
Media server is not exactly like the file sharing server, such as samba. As the media files will be decoded on server side rather than client side.
This patten can be usefule when the media file can not be decoded by client. For example, Chrome can not play HEVC video. And when it happens, the server will transcode the file to a format which can be decoded by client. This process includes two routines: Decoding and Encoding.
Of cource these two works can be done by CPU, but as we know, CPU is not the perfect role to play such tasks, they should belong to the GPU. Then we need to enable GPU acceleration.
I will take Intel Quick Sync Video (QSV) as example because nearly most of home-based NAS are equipped with Intel CPU.
Install VAAPI driver
1
2
3
4
5
6sudo apt update
sudo apt install gpg-agent wget
wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | sudo apt-key add -
sudo bash -c "echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' >> /etc/apt/sources.list"
sudo apt update
sudo apt install intel-media-va-driver-non-freeAdd group
1
2sudo usermod -aG render jellyfin
sudo systemctl restart jellyfinCheck VA info
1
/usr/lib/jellyfin-ffmpeg/vainfo
Configure QSV acceleration
Go to
Dashboard -> Playback -> Transcoding
, selectIntel Quick Sync
, and clickSave
.Check GPU Usage
1
2sudo apt install intel-gpu-tools
sudo intel_gpu_topPlay a HEVC video on Chrome, then check if there’s any GPU usage shown up.
Reference
Downloads - Jellyfin: The Free Software Media System
Home | Documentation - Jellyfin Project
Intel media stack on Ubuntu · Intel-Media-SDK/MediaSDK Wiki · GitHub
software recommendation - How to measure GPU usage? - Ask Ubuntu