At the end of my arr stack post I wrote that the TVs "can stream pretty smoothly most of the time" and that transcoding was outside the scope of the blog. This is the blog about the transcoding part, now that I've had the setup running for a few weeks.
I would say that transcoding is one of the biggest pain points of running the arr stack on a Raspberry Pi instead of a mini PC. To sum up transcoding: a video file is a bundle of a video format, one or more audio formats, and a container around them. A TV can only play the formats its hardware and app understand, and older TVs understand fewer of them. Jellyfin handles that in one of three ways:
The TV can only play the formats its hardware and app understand, so Jellyfin checks every part of the bundle against what the TV can take.
The Pi struggles with video because it has no hardware video encoder, so the work lands on its CPU. Many mini PCs can hand this job to their graphics hardware, such as Intel's Quick Sync, so the same transcode barely registers.
This one is more of a notes post than a tutorial.
The stutter
One night my parents put on Fury on the TV and it stuttered badly. Not a dropped frame here and there, but stop-start playback, as if the network was lagging. There were a few guesses as to why that was happening, for example the Ethernet being too slow for the 4K movie that was being streamed, transcoding, and so on, but it was only one movie, so I shrugged and moved on.
The next night The Departed did the same thing. The movie was borderline unwatchable, so I went looking.
Look at the session, not the device
Jellyfin's dashboard shows every live session (Profile → Dashboard), and for each one it tells you whether it is "Direct playing" or transcoding, and why. Open it while the stutter is happening and the reason is usually right there in the live session information.
Here is what it showed for the TV (running the Jellyfin Android TV app 0.20.0):
The TV's app told Jellyfin it can't play AC3, so the audio gets converted. The video is re-encoded at about half of real time, so it stutters.
Why one TV converts what another plays
The TV, or really the Jellyfin app running on it, tells Jellyfin which formats it can decode. Jellyfin checks every part of the file against that list. Whatever is on the list plays as it is, and whatever is missing gets converted. That is why the same file can direct play on one TV and transcode on another. The file doesn't change, the list does.
A file has several things in it: the container around everything, the video, the HDR on top of it, the audio and any subtitles. Each comes in several formats, and the TV has to understand each one it meets.
Which formats a TV can play depends on its chip and on the app running on it, so treat the bars as a rough guide. Dolby and DTS formats need licences, which is part of why cheaper and older TVs skip some of them.
So the cheap, easy combination is H.264 video with AAC audio, because nearly everything plays it. The risky one is the opposite end: Dolby Vision video with a Dolby or DTS audio track. Any one of those can be the thing a particular TV doesn't understand.
What Radarr and Sonarr will actually download
Radarr (movies) and Sonarr (TV) know nothing about your TVs. They pick a release using the quality profile you give them, and a quality profile is mostly about resolution and source (for example 1080p Blu-ray or 2160p WEB-DL), with a size range. It says nothing about the video codec or the audio.
Custom formats are where you can be pickier. A custom format matches words in the release name, like x265, DV, Atmos or TrueHD, and gives it a score. Give a format a positive score to prefer it, or a negative one to avoid it. Without any, a 4K profile will happily grab whichever release ranks best for that quality, Dolby Vision and Dolby audio included. That is how a file like this one ended up on the Pi. Radarr and Sonarr also never convert anything. They download the release as it is.
The tags in a release name are what you can match on. Here are two made-up examples, taken apart:
Plays fine on a TV that handles Dolby Vision and Dolby audio. Otherwise the Pi has to convert it.
Both formats are understood almost everywhere, so there is nothing for the Pi to convert.
The audio was cheap, the video wasn't
Converting audio on its own is cheap, even for a Pi. If AC3 to AAC was the only thing happening, I'd never have noticed.
The expensive part was the video. The session showed the picture being re-encoded as well, and the Raspberry Pi 5 has no hardware video encoder, so that happens in software on the CPU. The CPU can only manage 12 frames per second, which is half of real time.
Converting AC3 doesn't normally force a video re-encode, so the picture was probably being converted for its own reason, most likely the Dolby Vision or HDR handling. The dashboard lists the transcoding reason for each stream, so that is the place to confirm it. Either way, this is what happened to this file:
That also explains why my other TV was fine. It direct-played No Time to Die because that file's audio is AAC, so there was nothing to convert.
The fix: get the TV to accept AC3
If the TV plays AC3 as it is, nothing gets converted and the Pi never has to touch the video. All of this is in the TV's Jellyfin app, under Settings → Playback:
Change one setting at a time and check the dashboard in between, so you know which one made the difference.
The fallback: stop downloading Dolby Vision
If none of those settings work, then that TV can't play Dolby audio through this app, and I can't fix that from the Pi.
What I can do is change what comes in. In my case, the Dolby Vision release is the one where the video got re-encoded as well, so the fallback is to tell Radarr to avoid them. A 4K HDR10 or a 1080p release with the same audio would at worst cost the Pi an audio conversion.
On the other hand, a TV streamer is coming
The house is getting a TV streamer, and the hope is that it takes some of the transcoding off the Pi and lets us play more video formats. That is mostly true, but not quite the way I first pictured it.
A streamer doesn't transcode anything on the Pi's behalf. What it does is run the Jellyfin app on better hardware, with a decoder that understands more formats (HEVC, Dolby Vision, Dolby Digital and so on) and usually the licences for them. When the app tells Jellyfin "I can play that", Jellyfin direct plays and the Pi just sends the file. So the conversion doesn't move to the streamer, it stops being needed.
There are catches. Streamers differ a lot, so check the specs for the formats from the guide above (HEVC, Dolby Vision, Dolby Digital and Digital Plus) before buying. The TV and soundbar still matter, since the streamer can decode Dolby Vision but the TV has to be able to show it, and lossless audio like TrueHD needs a soundbar or receiver to handle it. And whatever the streamer still can't play will still land on the Pi.
A graph I can look at without opening a terminal
While I was at it, I wanted something nicer than SSH to see what the Pi was doing. I set up Beszel, a lightweight monitoring dashboard, and it showed the Pi straight away. It's at port 8090 on the Pi.
For "what happened last night", I pick 12 or 24 hours and look at the CPU and the disk charts.
Beszel can also send alerts when a threshold is crossed, but it needs a notification method such as email set up first, which I haven't done yet.

