Manage your Media Collection with Jellyfin! Install on Proxmox with Hardware Transcode

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
continuing on the path to build the ultimate Home Server today we're going to learn about proxmox privileged containers passing Hardware through into containers and everyone's favorite home media application jellyfin if you haven't been following along this is a little Nas box I've been converting to run proxmox as the ultimate Home Server it's pretty compact it's not that powerful but that's fine because it's low power in the electricity sense and it's got an integrated Intel GPU and we're going to use that today to do transcoding in jellyfin so for those of you that have never heard of jelly thin before it's basically an app that runs on a server and manages your media all those Blu-rays you've ripped TV shows music Etc unless you stream it to clients around your house it's completely locally managed no cloud services required and no subscriptions you just have to provide the media yourself usually by ripping DVDs or Blu-Rays and while that's great one disadvantage to that is that you have to now manage all the different formats that all the different devices could potentially support so if you're playing back a video on say an iPad it's probably going to be able to play just about anything but if you've got some old Smart TV or Raspberry Pi it might be a little bit pickier about what it'll accept and so that's where transcoding comes in the server can take a graphics card like this little one I got here or the integrated one built into my Nas and it can use that to decode the file and then re-encode it in a format that the client can support and that's why Hardware passthrough is so important for jellyfin so we can get the fancy fancy Hardware acceleration to our transcoding jobs and that's really the whole reason I'm making this video because jelly fit on its own is pretty easy to install by itself but when you want to get into Hardware trans code support that's where it starts getting a little bit tricky so to demo today I got two different graphics cards here this has an Intel Celeron Processor with Intel integrated Graphics so this will show us how to use Intel quick sync I also have this little guy here it's a Radeon Pro ws3100 and I bought it because it was pretty cheap single slot half height which fits in my micro server here because that's the biggest little fit it's also not that expensive it's not a great graphics card but it'll do transcode just fine and this will use amd's AMD GPU driver and VA API on Linux I unfortunately don't have an Nvidia card I can test with none of them fit in my servers and I actually don't even own any I'd have to borrow one so no Nvidia cards today but I can do AMD and Intel quick sync and that should be a lot of your applications especially if you're using an integrated GPU on either a ryzen chip or an Intel chip so with all that said let's jump into the tutorial so time to create a container for jelly fin so you can see I've already got my home assistant server my file server it's a quick rehash last episode we need to download a container template so we need to pick a storage here that can do file i o and has CT templates as one of the allowed things local storage allows that by default and we need to download Debian 11 so you can click on templates here sort by package and get Debian 11. I've already done that though in the past episode so this is our Debian container template I like to use containers whenever possible because they're so lightweight and they're so little overhead so we're going to use one of them for jellyfish again about jellies tell you that's how you do right so because we're gonna give jelly fan Hardware access to do transcoding I'm going to uncheck the unprivileged container box and like I said in the last episode it's kind of a backwards checkbox so when you check it it removes privileges from the container when you uncheck it it gives privilege to The Container so we're going to uncheck it and that means that the container will have root access to the system sort of it's still stuck within its own file system namespace but it has access to Hardware into the kernel that it wouldn't have as an unprivileged container and that'll let us do Hardware transcoding pretty easily so we're going to give it a password as usual we need to pick a template and I again have that Debian 11 standard template we again need a disk this disk is just going to be for the operating system template again so 16 gigs or 10 gigs or whatever that's fine I'm going to give it two CPU cores because I only have two in the system you can give it as many as you want and five Phillip mix I'm going to bump this up to 10 24. because we're doing transcoding we might do a little bit more RAM for ffmpeg Network we got to give some IPS okay so I typed in some IPS for my container we're going to give it e0 Bridge 2 bmbr 0 no VLAN tags the usual stuff DNS host and confirm let's go ahead and start it up so just like that we have a functioning Linux system in the container so jellyfin has a pretty good guide on how to install just going to apt install XD repo we don't need to use sudo because we're already running as root and they have a system for managing their repository using X repo so we just installed X repo now we use x repo enable jelly pin that'll add the package repository for jellyfin and once we've done that we can just do apt update and app install Jelly fan you can add Dash y if you don't want to hit yes it just forces it to say yes so once that's done we should be able to log in so we need to go to the IP address of the container colon 8096 fun fact jellyfin has IPv6 disabled by default I have no idea why they would do that so you have to go to the ipv4 address how primitive um I'm not even bother adding a password and I'm not going to add a media library yet I'll come back and do that later so we'll log in with our new users jelly thin with no password I mean obviously you could create a username with a password if you wanted so where do we want to store our media now as you know I have two different ZFS pools on the system from the past videos d-pool and local ZFS we can use either one of those to create a sub volume for this however I want to create a sub volume that I can also share with Samba in addition to using it in jellyfin so we're going to do this manually through the command line so in the last episode I told you that it's pretty easy to add a new Mount Point here and it is but the disadvantage of doing it this way is when we manage the mount points with proxbox we can't share them between multiple containers so we're going to do instead is we're going to go to the proximox node and go to the Shell and we'll do a ZFS list and that'll show us everything on the ZFS system so deep pool in our pool are two ZFS pools so you can see we have our vm100 disks we have our fast disk spinning rest disc these are all here but they're managed by proximox so we don't need to touch them but we can create a new data set in ZFS if we'd like and use it for whatever we want so let's see if that's create our pool slash media actually I'm going to put it on deep pool instead so Z of s create d-pool slash media that'll give us a data set off of the d-pool pool which is our spinning hard drive pool called media pretty simple so if you ZFS list it we see we have it there say we want to give it a cap so that we can't go above some size in this case I have two terabytes on my pool so say we can use one t so ZFS set whoa cut equals one equals one t e pool slash media now if I do a ZFS list again you can see that available is 10 24 gigs because we've quoted it to be no more than one terabyte so it'll show up as having one terabyte of free space so now let's Mount this new directory we created it's new dataset and ZFS d-pool media let's mount it to both our file server container and our jellyfin container and back on the file server you'll recall we have Mount point 0 and 1.1 and then over here we don't have any amount points we just have the root disk so it's important because we need to keep aware of those Mount Point numbers because they come in for proximox so another thing to be aware of here is the Mount point this is where the files are located on the local system so in this case it's d-pool slash media and they're mounted there so that's the path we need to the local system and the path and remote system or the container we're going to put in slash mount so the command we're going to use is PCT proximox container toolkit set and then the ID of the container so one of the 402 is my jelly container and then dash dash the mount Point number so we'll say mp2 and then the path on the local system so slash d pool flash media comma MP equals and then the mount point on the remote system so slash Mount slash media there we go and you'll notice I picked Mount point two here and I picked Mount 0.2 because we don't have a mount point two in our file server yet so I can come over here with the same command and mount it into 401 the file server so both of these guys should have a map point two like over here the file server we have amount point two d pool media into Mount media and if I go to jellyfin we again have that same thing d-pool midi and amount media and of course we can come back to our file server container from the last episode and add a share to it another thing to be aware of is by default this new data set is owned by root and nobody has access so in order to give access to everyone I'm going to CH mod that new folder so chmod Dash Big R for recursive 777 e pool media so now everyone has permissions to read and write to it which is good so our containers cooperate on it and so can our file sharing so we have this new folder now here I'm going to create a folder called movies go to Holocaust movies okay everyone called TV shows and I'm going to copy some stuff into these folders for my own collection for testing so now that I've copied an assortment of stuff into that folder via file sharing it should show up in jellyfame which means we should be able to create some libraries so libraries in jellyfin are basically folders that have a certain type of media in them so in this case I made two folders one for movies one for TV shows so I can click movies um folders so Mountain media movies and if you'd like here you can put the network path so that clients can connect directly to it instead of going to the Jelly fence River I'm going to leave this out for the purpose of this video okay and we'll add one more shows plus folders Mount media TV shows there we go so we'll scan the libraries see what we can find so everything is working great now I can connect jellyfin in web browser using the app Etc that works now the challenge is transcoding which I'm sure is why you clicked on this video so I go over here into the admin dashboard so I click here little guy dashboard it shows me everyone who's connected now so this is me I'm blue and here's another web browser that's playing back a movie so I click on the info here it says it's transcoding it because the video Codec is not supported by the client so if the client doesn't support whatever format the video is in jellyfin will decode it and re-encode it in some other version so let's see what it does to our CPU oh yeah our CPU is not happy right now so it's uh we're putting a lot of load on our little two core CPU this is the entire system too how much of this is coming from our container guy yes or we're pegging our CPU at 90 percent just to do this transcode and that leaves us with about 10 for everything else going on in the system which is not good we're not doing too bad on RAM now we're using about half a gig so it's good that I gave it a whole gig so how do we improve this well we need to give jellyfin some Hardware that can do the transcoding work for it and thankfully graphics cards are really good at this there's really two steps here there's decoding the video which is relatively straightforward but could be relatively computationally intensive and then we have re-encoding the video we take the raw frames and compress them back down in some other format to send out and both of these steps can potentially be accelerated by the graphics card but the end code step is particularly important because that's harder on the CPU than the decode step so jellyfin has a really long page on Hardware acceleration and I will say right off the bat this is very specific to your Hardware I don't have every piece of Hardware to test and I can't necessarily demonstrate all the different configurations but I will try two different configurations and show you what worked for me so we have Tara which is the one we've been using today this has an Intel CPU with onboard Graphics so we can use the onboard graphics card with Intel quick sync and I have big store and big store has access to that Radeon ws3100 so the first thing I noticed is that the Intel it has this note about Intel gen 9 and newer igpus and I happen to have one of those so I have a Jasper Lake CPU so low power encoding must be enabled for my case I'm already using kernel 5 by 15 and newer so I'm on 6.1 which is the latest proximox experimental build and they also note that we need to enable the Huck or the guck so these are basically little microcontrollers that are part of the GPU and the code for them is not available it's a binary blob so Linux doesn't load it by default um but it's not that hard to enable it so we have to do this on the host because the host is what actually loves the driver so we're going to come in here go to the Shell so we're going to add a file called Etsy modprobe.d i915.com and it should be a new file so we're going to add some options for the i915 driver which is the Intel integrated graphics driver and we're going to say options i-915 enable underscore gup equals three it's sort of a magic thing but basically there's two different binary Flags so one plus two two flags gives us a three that tells it what micro code it should load and I have found the latest proxmox versions already include the micro code and everything so we don't need to do anything other than enable it say yes and reboot so jelly pin actually has a guide for us on how to set this up on proxmox and it's pretty simple we just need to copy and paste these lines here so click the little copy button into our config file so we come over here go to the Shell let's see PVE C or 2.5 and we'll paste it in obviously you would use whatever container ID you have minus 402. so basically what this does is it bind mounts two devices into the file system Dev dri card zero and Dev dri render d128 so these are the nodes from the kernel direct rendering manager or kernel DRM so every graphics driver on Linux will always have a Dev dri card device and that's what's normally used by x windows and things like that and it will probably also have a render device and this is used by software that just wants to do rendering that doesn't need to do screen access and then we're also giving some permissions to access these devices and we're passing through these group IDs so we'll save that so in order to have access to these things we just added a config file we need to reboot the container so we're going to click shutdown I'll shut it down and restart it so let's see if we have those there we go you have dri part 0 and render d128 one thing to note now is that our Dev dri nodes are owned by root I have the group video and input so we need to let the user jelly fin that runs the jellyfin account have access to these two devices so we're going to do user mod little a dash little a dash Big G then the name of the group so video and the name of the user so jellyfin and then we'll do the same for the group input and that way jelly fin as its user jelly fin should have access to card 0 and render d128 because it is part of those groups next thing we need to do is install some Mesa drivers and I found the easiest way to do this is to install the utility VA info that should install the Intel lid VA drivers which we need so for the permission changes we did to take effect we have to restart jelly thin so go ahead and do that system control restart jelly pen it's not from our jelly fin system we can come over here to our user go to admin dashboard playback we have the option for transcode so because we have an Intel GPU in this example we're going to pick Intel quick sync and we can enable decoding for all these Etc and in my case I happen to know that all of these except av1 should be supported by this GPU and because I'm on a Jasper Lake I have to enable the low power encoder and I can encode an h.265 which is hevc depending on your Hardware you might have to enable this or you might have to disable it might have to try it both ways like it says here the i-915 Huck from ready to be configured which we already did to the bottom and say save and let's see if that works so now I opened up that same movie again and you can see if we click on the info it's being transcoded and it says video Codec is not supported but if I go over here our CPU usage is much lower we're only using 11 percent and if we come here to logs we can see what it's doing so it'll be a ffmpeg transcode log it'll have a whole bunch of stuff in it so in this case what it says is doing is taking mpeg-4 native into h.264 and it's using h.264 qsv which is quick sync video and for audio it's doing native into AAC so it's transcoding audio on the CPU which is fine it's decoding mpeg-4 on the CPU which is where our 11 CPU comes from and then it's encoding it into h.264 using Intel quick sync and plenty of stuff is going on here and the playback works fine so I speed ran setting up jelly spin again on my server with the AMD graphics card and we're again getting out of the config file now oops there we go now one Quirk on this system if you have more than one graphics card they may not be render d128 and card zero so in my case I have a basic basic graphics card that's the ipmi and that is card zero so my AMD card is still rendered Eagle on 28 but now it's card one I'm going to pass it through as card zero Commander d128 so again in the container we have our card zero which is actually card one in the host and render d128 which in this case actually Ranger d120 and the host 2. we'd really like to keep those names identical because a lot of software will automatically look for render d128 if you don't specify and so now we're going to do the same group AD that we did before so in jellyfin this time for AMD we're going to say VA API and again we need that path Dev dri render d128 which in this case it is we actually run VA info in the container it'll show us what it supports so looks like we have h.264 and hevc and vc1 Hardware decode h264 hevc bc1 and then pick two a little bit less features that are Intel Hardware encoding options again we do not use the Intel low power encoder because this is an AMD card I'm not going to allow encoding an habc format I wouldn't help a whole lot anyway because not a lot of clients support hevc we'll go down to the bottom and save this got it so I got another client again playing back if we look at their info they're doing transcode and if we look at the logs we see we're transcoding F of npeg so we're using mpeg-4 input again so we're decoding on the CPU we're encoding h.264 with VA API which is the AMD API and we're encoding audio on the CPU so how is our resource usage going on here 33 not bad it was using about 90 with Hardware encoding so like with the other system makes a big difference to have Hardware Transco here hopefully you guys enjoyed this and you were able to get this to work on your system I got plenty of more tutorials coming for the ultimate Home Server project so stay tuned for more if you want to see some others in this playlist I've done home assistant and I've done Samba file sharing already there's a playlist down in the description below of all the past episodes of this project don't forget to subscribe so you can see more if you want to buy any of these things feel free I guess uh they work I guess they're pretty cheap if you have any ideas for future projects I always love hearing about them I have a Discord server down in the description feel free to message me there I always love hearing from viewers and as always I will see you on the next adventure
Info
Channel: apalrd's adventures
Views: 64,080
Rating: undefined out of 5
Keywords:
Id: tWumbDlbzLY
Channel Id: undefined
Length: 22min 9sec (1329 seconds)
Published: Thu Feb 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.