I was getting tired of connecting a laptop to the TV with a long-ass HDMI cable so I could play movies on there, or running the movies through an arcane combo of apps so the Chromecast would deign to play from Jellyfin…
,when I thought, hey, the server is near the TV, can’t that fucker somehow play to the TV directly?
The server is a barebones Debian with just the basic packages installed and everything running in Docker containers, no graphics stack. But it has an Intel CPU+iGPU and it does have a HDMI out.
That’s when I remember the framebuffer. Long story short, here’s the Dockerfile for a container that installs mpv and all that’s needed to play on the framebuffer:
FROM debian:trixie-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get -y install ca-certificates openssl
COPY <<"EOT" /etc/apt/sources.list.d/debian.sources
Types: deb
URIs: https://deb.debian.org/debian
Suites: trixie trixie-updates trixie-backports
Components: main non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
URIs: https://security.debian.org/debian-security
Suites: trixie-security
Components: main non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOT
RUN apt-get update
RUN apt-get -y dist-upgrade
RUN apt-get -y install \
mpv vainfo libdrm-tests \
mesa-va-drivers libva-drm2 libdrm2 alsa-utils \
nnn
RUN rm -rf /var/lib/apt/lists/*
Can probably simplify it further. And here’s a compose.yaml for it:
services:
fbplayer:
image: local/fbplayer:1
container_name: fbplayer
hostname: fbplayer
volumes:
- "./playmovie:/usr/local/bin/playmovie:ro"
- "./nnn:/usr/local/bin/nnn:ro"
- "/mnt/nas/multimedia:/media:ro"
devices:
- "/dev/dri:/dev/dri"
- "/dev/snd:/dev/snd"
group_add:
- 44 # getent group video
- 105 # getent group render
- 29 # getent group audio
environment:
- TZ=Continent/Capital
- NNN_OPENER=/usr/local/bin/playmovie
entrypoint: ["tail", "-f", "/dev/null"]
restart: 'always'
The playmovie and nnn scripts are helper scripts so I don’t have to re-type all the mpv parameters or refer the file by hand.
Here’s playmovie. Find out your audio card name and device number with aplay -l). The DejaVu fonts are installed by default on Trixie.
#!/bin/sh
case "$1" in
*.[Mm][Kk][Vv]|*.[Mm][Pp]4|*.[Aa][Vv][Ii])
exec mpv --vo=drm --drm-device=/dev/dri/card0 --hwdec=vaapi \
--ao=alsa --audio-device=alsa/hw:CARD=PCH,DEV=3 --volume=50 \
--sub-font="DejaVu Sans Mono" --sub-font-size=40 --sub-bold=yes --sub-ass-override=force \
--sub-color="#FFFF00" --sub-border-size=5 --sub-border-color="#000000" \
"$1"
;;
*)
exit 1 ;;
esac
And here’s the nnn script (make sure to place it in a dir that’s before /usr/bin in PATH):
#!/bin/sh
exec /usr/bin/nnn -coQ /media
It’s still pretty arcane and I have to grab a shell in that container from the PC or a laptop, and remember mpv keyboard shortcuts… but at least I don’t have to run cables or fuck around with phone apps.
If anybody knows some sort of media/DLNA browser that can run in framebuffer please leave a comment. It would be nice to have some sort of UI that runs standalone on the TV all the time, and I can probably figure out how to add a bluetooth airmouse/remote or something to control it. I’ve seen some cute BT gadgets that even have a mini keyboard so you can do a quick search.
Why not just run a media application like Kodi standalone though a display kiosk like cage?
Pretty much made exactly for the scenario of needing to run a graphical output like framebuffer, but without an actual DE installed and without requiring each app to support framebuffer output.
The only reason I don’t personally do this is because Dolby Vision output on Linux on anything other than a couple of TV boxes is basically non-existent lol.
Oh I didn’t know Kodi can run standalone on framebuffer, I’ll check it out.
I have standalone Kodi running on an arch docker image with GLES/GBM which supports full HDR without a desktop environment. I can post my compose later.
Please do, that sounds very interesting.
Jellyfin mpv shim allows you to select your server as a TV in Jellyfin and control it from a phone to select media, play/pause, etc. Maybe look into that instead?
Thanks that’s interesting, I’ll see if I can get it to run headless as a Jellyfin “play to” target.
running the movies through an arcane combo of apps so the Chromecast would deign to play from Jellyfin
That shouldn’t be necessary. I can cast right from the Jellyfin app to my Chromecast.
It would be nice to have some sort of UI that runs standalone on the TV all the time
I think at this point, you’re reinventing the graphical desktop. Pick a minimal DE or Plasma Bigscreen, or just something that can run Jellyfin in Firefox, and use a Bluetooth remote or mini keyboard.
I can cast right from the Jellyfin app to my Chromecast.
I can’t, the Chromecast doesn’t show up for me in Jellyfin and never has. Not sure why, other apps can cast to it just fine.
you’re reinventing the graphical desktop
I’m going to look into getting a graphical stack going but only if it can work in a container.
Is your Jellyfin server exposed on port 443 with a CA-signed cert? Google made it so the source server MUST be HTTPS with a cert trusted by your Chromecast.
Yeah it’s behind a reverse proxy on a proper domain with LE certs.
Edit: …but that’s not what it advertises via mDNS, it announces its non-HTTPS URL behind the proxy.
Your comment and the other content about mDNS is what clicked it, thanks, I bet that’s the problem.
Then you have an mdns failure. Make sure the two are on the same L2 broadcast domain and make sure your WiFi isn’t keeping the two peers from seeing each other.
I will double check but I can see other mDNS-based stuff. I can browse Jellyfin’s own DLNA, I can print to a CUPS printer, and Chromecast works on other apps.
That’s strange. You don’t have anything weird going on network-wise? The only thing different that I can think of is that the video source would be your local server, so if the Chromecast plays direct it would need to be able to resolve and reach that host.
I’m sure someone’s built Bigscreen in a container. I’ve used Firefox in a container a bunch of times myself. You can easily use Firefox set in kiosk mode without any underlying desktop environment. I’ve never tried rendering it directly to the framebuffer, though.
Deleting the apt sources list is an absurd level of minimalism that I’ve never seen before. I love it
I usually do that on Debian containers but considering this one is about 900MB it probably doesn’t matter much.
Does the Chromecast not have playstore apps?
Like why couldn’t you just spin up the server just for internal network access, then connect via 192.168.xx.xx:8096?



