QNAP TS-877 Truenas Journal

finally got jellyseerr to connect to the jellyfin docker container. not sure if this makes the cut for this thread but it’s part of my setup for this build so hope don’t mind :sweat_smile:

Deploy the jellyfin docker container.

I linked it to the proxy network i created

so in both jellyfin and jellyseerr they have this inside for the network portion

    networks:
      - proxy



networks:
  proxy:
    external: true

Another thing i did was

    environment:
      - PUID=0
      - PGID=0

this uses root as the user. changing it to a non root might work if you have it setup properly for that. But to expedite for a local lan only setup, this was what i used. But for security you don’t want root for your dockers normally, just saying.

Next was in jellyfin > admin dashboard > networking

Tick allow remote connections to this server. Maybe it’s not required but it’s what i have so i just mentioned what my active setting was at when this worked.

nginx proxy manager, this was setup to point my jellyfin service to a domain name of my choice using duckdns. i have working letsencrypt https setup for this url. Maybe just simply using local lan ip would work? but i didn’t test for that. But my setup for this definitely works.

Once you go to the jellyseerr url for initial setup, fill in the credentials. But for the email, PUT a different email. this one caught me off guard. so if it won’t let you proceed beyond this point and you are user username and password are correct, try change the email. In logs it even mention email was the issue.

On the next page, i encountered an issue where i couldn’t sync library to jellyfin. How i solved this was stop jellyserr, delete the jellyseerr folder in docker. Editted the compose to add the root user in environment, redeployed, then it worked now. So this was probably a permission issue if you get stucked then i would suggest delete and redeploy with the correction added in your compose then try again.

So finally i got jellyseerr to work. so thought i’d share how i managed to troubleshoot. *official discord for the app wasn’t helpful so i had to figure it out myself

Basically what this app does is help you queue new content to later add to your jellyfin sort of like a reminder or queue. It can also interact with other automation apps that can download these queued content. I don’t use it for that though you could. I only use it to bookmark content i want to watch later to keep track of new movies or tv series for example.

1 Like

managed to fix the docker container names not being able to be used in nginx proxy manager.

meaning, before instead of say adding the docker container name e.g. librespeed:port

i had to do docker lan ip e.g. 192.168.0.24:port

but now the docker container name method works.

what was probably the solution was to create the docker network *you do this in cmdline. but in portainer you can do this from UI.

Then you edit docker compose, make sure all connected to that network you created e.g. dockge, librespeed, authentik, nginx proxy manager and so on.

at this point it worked.

*update

i take that back. Tried testing again using private browsing (firefox) and incognito (chrome). Noticed it still didn’t work. So why it did before was probably some sort of caching. Which is why you should always test in the private/incognito.

but the reason why i thought it did was because in nginx proxy manager where the url has a colored dot if it works or not, it lit up green which it never did before for this.

Will keep researching on this i guess :thinking:

In uptime kuma using the docker container name works. but nginx proxy manager doesn’t for some reason.

1 Like

Das came up with the solution to get transcoding working for plex with jailmaker. he listed the steps in his github post

I may consider to have another try setting up for jellyfin. Not that i really need it, just for experimentation and see if i can provide the steps for others trying to do this.

2 Likes

based on this

sudo apt install curl gnupg

sudo add-apt-repository universe

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg

this part not sure what to do here so i skipped :sweat:

export VERSION_OS="$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release )"
export VERSION_CODENAME="$( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release )"
export DPKG_ARCHITECTURE="$( dpkg --print-architecture )"
cat <<EOF | sudo tee /etc/apt/sources.list.d/jellyfin.sources
Types: deb
URIs: https://repo.jellyfin.org/${VERSION_OS}
Suites: ${VERSION_CODENAME}
Components: main
Architectures: ${DPKG_ARCHITECTURE}
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF

sudo apt update

sudo dpkg -i jellyfin_*.deb jellyfin-ffmpeg_*.deb

sudo apt -f install

sudo systemctl {action} jellyfin
sudo service jellyfin {action}

The repository is the preferred way to obtain Jellyfin on Debian and Ubuntu systems, as this ensures you get automatic updates and that all dependencies are properly resolved. **Use these steps only if you really know what you’re doing.

which i clearly don’t.

All i know that maybe i need to install the ffmpeg because i can proceed. But how? not sure cause i may end up breaking something :sweat:

the official jelly instructions simply assumes you r installing everything from linux or debian but doesn’t take into account you had already installed via docker, and am merely just trying to enable the nvidia graphics card only.

so yes i did try but i’m stuck. i tried looking google but there just isn’t much guidance for setting this on jailmaker xd

Doing some digging i sus i need to direct focus to this area

instructions specific to the docker setup for this container.

*update

This is the crucial part you have to do. But i had previously done this for Immich (both basically have the same instruction for this step apparently). So i skipped this since i ran the command to confirm i had this setup and working already

Nvidia

Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here: GitHub - NVIDIA/nvidia-container-toolkit: Build and run containers leveraging NVIDIA GPUs

We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-container-toolkit is installed on your host you will need to re/create the docker container with the nvidia container runtime --runtime=nvidia and add an environment variable -e NVIDIA_VISIBLE_DEVICES=all (can also be set to a specific gpu’s UUID, this can be discovered by running nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv ). NVIDIA automatically mounts the GPU and drivers from your host into the container.

root@docker:~# nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv
name, uuid
NVIDIA GeForce GTX 1050, GPU-6xxxxxxxxxxxxxxxxxxxx10
root@docker:~#

Reading the linuxserver it doesn’t mention anyt step for modifying the docker compose for any graphics card entry needed.

It simply just said to setup the nvidia toolkit as i mentioned above only.

But when i compare to plex setup, they do

services:
  plex:
    container_name: plex
    image: plexinc/pms-docker
    restart: unless-stopped
    network_mode: host
    volumes:
      - /mnt/data/plex/configs:/config
      - /mnt/data/plex/transcode:/transcode
      - /mnt/media/plex:/data
    deploy:
      resources:
        reservations:
          devices:
            - capabilities:
                - gpu
    env_file:
      - .env
networks: {}

sauce

The parts i’m interested in is the transcoding bind mount location, and the deploy resources device capabilities gpu (immich also uses this in it’s compose to get nvidia graphics card to work).

So though linuxserver made no mention of this, i assume you would need to add that into docker compose to get transcoding to work. Otherwise how would docker compose know unless you add that entry? Just simply installing the toolkit isn’t sufficient afaik.

Obviously different docker container apps have different requirements. My point here is, you might be able to garner some inferences from how these other apps are setup to get nvidia graphics card to work, and this is how i came to my hypothesis on this setup.

will have to trial and error :grimacing:

this is what i came up with

services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=0
      - PGID=0
      - TZ=newyork
      - JELLYFIN_PublishedServerUrl=https://jellyfin.mydomain.duckdns.org #optional
    volumes:
      - /mnt/docker/data/jellyfin:/config
      - /mnt/xxxxx/Videos:/data/media1:ro
      - /mnt/xxxxx/Videos:/data/media2:ro
    ports:
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
    # - 1900:1900/udp #optional
    networks:
      - proxy
      
    deploy:
      resources:
        reservations:
          devices:
            - capabilities:
                - gpu
      
      
    restart: unless-stopped
#networks: {}


networks:
  proxy:
    external: true

deployed with this and jellyfin didn’t error or complain about it.

Then went to jellyfin web ui no issue. Went to admin settings > playback > hardware acceleration enable nvidia.

Then in the options there spotted this

FFmpeg path:
/usr/lib/jellyfin-ffmpeg/ffmpeg
The path to the FFmpeg application file or folder containing FFmpeg.
Transcode path:
/config/data/transcodes
Specify a custom path for the transcode files served to clients. Leave blank to use the server default.

Ok so i checked at the /usr/lib/jellyfin-ffmpeg/ffmpeg which should be located inside the jail. went there but saw nothing. So i probably have to install this myself via shell. How? no idea. It involves adding the repo (which 1? and how?) the installing it (which? how?)

As for transcoding location i assume that means you don’t have to add a specific transcoding bind mount since it uses the existing config bind mount. Unless you plan to add a custom pathing i guess.

1 Like

my result

Playback Error

This client isn’t compatible with the media and the server isn’t sending a compatible media format.

this is my error message

jellyfin  | [xxxxxxxx] [INF] [70] Jellyfin.Api.Helpers.TranscodingJobHelper: Deleting partial stream file(s) /config/data/transcodes/57xxxxxxxxa.m3u8
jellyfin  | [xxxxxxxx] [INF] [38] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
jellyfin  | [xxxxxxxx] [INF] [38] Jellyfin.Api.Helpers.TranscodingJobHelper: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device cuda=cu:0 -filter_hw_device cu -autorotate 0 -i file:"/data/media1/Anime/Overlord/xxxxxxxx] Overlord [Season 4] [BD 1080p x265 HEVC AAC] [Dual Audio]/Overlord - S04E07.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_nvenc -preset p1 -b:v 6963250 -maxrate 6963250 -bufsize 13926500 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(1920\,1080*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(1920/a\,1080))/2)*2,format=yuv420p" -codec:a:0 libfdk_aac -ac 2 -ab 256000 -ar 48000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/data/transcodes/bxxxxxxxx71%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/data/transcodes/bxxxxxxxx1.m3u8"
jellyfin  | [xxxxxxxx] [ERR] [38] Jellyfin.Api.Helpers.TranscodingJobHelper: FFmpeg exited with code 1
jellyfin  | [xxxxxxxx] [ERR] [38] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL GET /videos/fxxxxxxxxaf/hls1/main/0.ts.
jellyfin  | MediaBrowser.Common.FfmpegException: FFmpeg exited with code 1
jellyfin  |    at Jellyfin.Api.Helpers.TranscodingJobHelper.StartFfMpeg(StreamState state, String outputPath, String commandLineArguments, HttpRequest request, TranscodingJobType transcodingJobType, CancellationTokenSource cancellationTokenSource, String workingDirectory)
jellyfin  |    at Jellyfin.Api.Controllers.DynamicHlsController.GetDynamicSegment(StreamingRequestDto streamingRequest, Int32 segmentId)
jellyfin  |    at Jellyfin.Api.Controllers.DynamicHlsController.GetHlsVideoSegment(Guid itemId, String playlistId, Int32 segmentId, String container, Int64 runtimeTicks, Int64 actualSegmentLengthTicks, Nullable`1 static, String params, String tag, String deviceProfileId, String playSessionId, String segmentContainer, Nullable`1 segmentLength, Nullable`1 minSegments, String mediaSourceId, String deviceId, String audioCodec, Nullable`1 enableAutoStreamCopy, Nullable`1 allowVideoStreamCopy, Nullable`1 allowAudioStreamCopy, Nullable`1 breakOnNonKeyFrames, Nullable`1 audioSampleRate, Nullable`1 maxAudioBitDepth, Nullable`1 audioBitRate, Nullable`1 audioChannels, Nullable`1 maxAudioChannels, String profile, String level, Nullable`1 framerate, Nullable`1 maxFramerate, Nullable`1 copyTimestamps, Nullable`1 startTimeTicks, Nullable`1 width, Nullable`1 height, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 videoBitRate, Nullable`1 subtitleStreamIndex, Nullable`1 subtitleMethod, Nullable`1 maxRefFrames, Nullable`1 maxVideoBitDepth, Nullable`1 requireAvc, Nullable`1 deInterlace, Nullable`1 requireNonAnamorphic, Nullable`1 transcodingMaxAudioChannels, Nullable`1 cpuCoreLimit, String liveStreamId, Nullable`1 enableMpegtsM2TsMode, String videoCodec, String subtitleCodec, String transcodeReasons, Nullable`1 audioStreamIndex, Nullable`1 videoStreamIndex, Nullable`1 context, Dictionary`2 streamOptions)

from that gibberish my only sense of it is, maybe it didn’t find ffmpeg which it needs, so it spazzed out and died :rofl: So i assume the nvidia graphics part was all done correctly, it’s just that i am missing the ffmpeg step.

any ideas how to install ffmpeg for it in the docker jail? :pray:

root@docker:~# sudo apt update && sudo apt install -y jellyfin-ffmpeg5

Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]                 
Hit:3 https://nvidia.github.io/libnvidia-container/stable/deb/amd64  InRelease                
Hit:4 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:5 https://download.docker.com/linux/debian bookworm InRelease
Fetched 55.4 kB in 1s (65.7 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package jellyfin-ffmpeg5
root@docker:~#

seems like i got to add the repo. how? :sweat:

root@docker:~# sudo add-apt-repository universe
sudo: add-apt-repository: command not found
root@docker:~#

sauce

:thinking:

Heh.

The linuxserver image is supposed to have ffmpeg etc pre-installed, and is ready for Nvidia or Intel GPU acceleration…

Well, that’s what they say :slight_smile:

i thought that too, but… hmm

could be just a simple matter of removing the read only flags for bind mounts, but i don’t want it to actually replace the existing file with a lower quality encode if it’s trying to replace it in the same directory where media is stored. I assumed live transcoding merely encodes into the config folder a temporarily re-encoded file for live transcoding was my assumption.

so it’s either that or it’s it can’t find ffmpeg is my guess.

*update

i looked and yes there is a transcoding folder within config that jellyfin uses

another lead :thinking:
https://www.reddit.com/r/jellyfin/comments/neor56/install_jellyfinffmpeg_4321_for/

The Jellyfin server uses a modified version of FFmpeg as its transcoder, namely jellyfin-ffmpeg. It enables the Jellyfin server to access the fixed-function video codecs, video processors and GPGPU computing interfaces provided by vendor of the installed GPU and the operating system.

Using FFmpeg binaries downloaded from somewhere else will result in partial acceleration.

Jellyfin-ffmpeg usually ships with our deb package, official Docker images and Windows installers.

The only exception is when using a portable installation or an unsupported distro, then it’s required to manually download and set it in Jellyfin.

:thinking:

good luck :slight_smile:

My Jellyfin box doesn’t have a GPU or iGPU

sudo apt-get install software-properties-common

sudo add-apt-repository universe

:sweat:

Unable to handle repository shortcut 'universe'

this part works, so i skipped the nvidia drivers since i doubt i need them. it’s just the ffmpeg i doubt is done yet. stuck

root@truenas[~]# jlmkr shell docker
Connected to machine docker. Press ^] three times within 1s to exit session.
root@docker:~# nvidia-smi
Tue May  7 xxxxxxxx 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.23.08              Driver Version: 545.23.08    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce GTX 1050        Off | 00000000:12:00.0 Off |                  N/A |
| 35%   38C    P0              N/A /  75W |      0MiB /  2048MiB |      2%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+
root@docker:~#

Someone else is planning to check the steps for jailmaker jellyfin, so will be waiting on their progress so we can compare notes to hopefully fix this issue to get nvidia graphics working for truenas jailmaker docker for jellyfin.

I was working on other side projects while waiting. Got qrdirstats to work

in this example i was using it to manage disk space usage for the jailmaker docker containers


With qdirstats i am able to better see the disk space usage by folders and files in an sorted format so i know immediately what is taking up a ton of storage space. I usually go through the list starting with the disk space hogs and check whether they are worth keeping. This is how i will be managing storage space usage on the truenas with the help of this useful docker container app.

There is also a linuxserver version but i could not get that to work

1 Like

Finally cracked the nvidia graphics transcoding for truenas jailmaker docker jellyfin. Solution here

it’s definitely working because when i move back and forth in the video time, it is much faster than before. which is the point of using the graphics card acceleration to make that speedier.

Downside is a slightly worse quality than the original whenever you are transcoding. If you can do directplayback, do so.

In fact, i can do directplayback using the jellyfin media player on android which then points to an external video player mx player, which has ffmpeg loaded, so i can play the video file without triggering any transcoding. Playback is smooth and and change time and it loads pretty fast.

This was tested on the TS-877 running truenas dragonfish latest, and setup using jailmaker docker jellyfin (i use the linuxserver image for it)

Anyway i am okay leaving it to live transcode with the help of the graphics card for better responsiveness. Besides when i want to do some serious watching i use desktop mpv anime4k for the best experience.

So i use jellyfin more as a convenience secondary option for mobile devices.

Or as a way to stream from truenas to the the UHDTV

2 Likes

Was looking into how to add docker monitoring to the inbuilt truenas netdata. found these leads if anyone is interested

https://www.reddit.com/r/truenas/comments/1akifu0/netdata_on_truenas_scale_cant_find_or_edit_config/

Found a simple solution.

Dozzle can show basic cpu average and memory

Nothing fancy like netdata which is way more detailed (like it doesn’t show timeline or stuff like drive space usage), but it’s sufficient for me just to check if any docker cpu or memory consumption is abnormal or not.

1 Like

okay the metered pdu arrived. installed it in rack.

first thing i was did was connect it to the truenas ts-877. so i’m only recording this device only for now.

on boot up was about 80-90 watts. leaving it running for another 30minutes or close to it, to get a better idea of the idle wattage when running 21 active docker containers more or less idle.

this is ts-877 truenas with 20 docker containers active on idle. this reading didn’t include any other devices (e.g. router, switches, etc)

then into my power company calculator

So about $63.61 yearly to leave on 24/7 assuming the watt remains steady. I can live with that :smiling_face_with_tear:

i can’t exactly roll back to qts to check on that platform :sweat: but from my observation the cpu usage usage dropped from 20% down to 1-5% so it made a difference. But to be fair, i was running grafana + cadvisor + prometheus + glacier and a few more apps compared to now. So it’s not exactly a fair comparison :sweat_smile:

But considering when i switched over to truenas that came with netdata inbuilt, i could drop all those other monitor docker containers for a more efficient resource monitoring that works right out the gate without any tinkering.

*update

so i redid all my power cables, most of my stuff i use comes down to about 318 watts :grimacing:

truenas: 81.2w

desktop pc: 149w (probably would ramp up when gaming obviously)

24 port poe++ switch: 44w

fan: 125w

pfsense router: 28w

unifi wifi access point in another room + the poe+ 2.5gbe 5port switch roughly 20watt?

modem not listed cauz pdu not enough sockets. so lets just say its 10 watt at least.

not counting backup nas, because i only power them on when needed, so not a concern.

that’s my homelab power usage :sweat_smile:

desktop pc i set to sleep so it’s not running 24/7. Only the nas, router, modem, and wifi ap.

1 Like

redid some tests and noted some stuff

example when i ran openspeedtest using the lan ip, there is no speed bottleneck


but when i re-ran same test but using duckdns url, there is a speed cap. no idea why

usability it doesn’t matter. but if i plan to do anything that requires max transfer, then i would just need to be mindful to use the lan ip e.g. when using file browser for downloading files.

i run too many apps to remember which port for which app, but if i go to dockge, i can click the link and it opens it up. which is convenient.

don’t think this is a truenas issue, more of some sort of misconfiguration on my part. but thought i’d mention it :sweat_smile: