The written companion to the video. By the end, your Pi has live over-the-air channels, free streaming channels, a full program guide, and a
The written companion to the video. By the end, your Pi has live over-the-air channels, free streaming channels, a full program guide, and a DVR that records to your NAS.
What this is / isn’t: This is the legitimate way to get live TV on a Pi — free over-the-air broadcast + free, legal ad-supported streaming channels (Pluto TV). It is not paid/”underground” IPTV, which is piracy and gets you demonetized, sued, or malware. We don’t touch that.
Prerequisites (from the earlier videos): Jellyfin already running in Docker on the Pi, and a NAS share for recordings. Live TV is a Jellyfin feature. The free guide in Section 3 uses one small extra container (zap2xml).
Replace every PI_IP with your Raspberry Pi’s real address and HDHR_IP with your HDHomeRun’s address. Don’t post real IPs on screen.
What you need
- Antenna — indoor flat antenna if you’re close to the towers; attic/roof antenna if you’re farther out.
- Tuner — an HDHomeRun (network tuner). Antenna plugs into it; it plugs into your router; every device (including the Pi) can then pull channels from it over the network.
- Raspberry Pi running Jellyfin.
- NAS share for DVR recordings (big files — do NOT record to the SD card).
- Zip code — for the free guide in Section 3 (the zip code where your antenna sits).
- (Optional, no hardware) just the Pi, for the free streaming-channel path in Section 4.
Check what you can receive before buying an antenna: use a signal-locator site (e.g. the FCC’s DTV reception maps or antennaweb.org) — type your address, see which stations and directions are realistic.
1. Set up the HDHomeRun (hardware)
- Screw the antenna coax into the HDHomeRun.
- Run an Ethernet cable from the HDHomeRun to your router.
- Plug in power.
- Run a channel scan: use HDHomeRun’s setup app, or open the device’s web page on your network, and start a scan. It finds your local OTA stations.
Placement matters. OTA is sensitive — near a window, up high, aimed toward your towers beats behind the couch. Fuzzy channel = antenna, not the Pi. Move it during the first scan.
2. Add the tuner to Jellyfin
- Jellyfin Dashboard → Live TV → Tuner Devices → +.
- Type: HDHomeRun.
- Jellyfin usually auto-discovers the box. If not, enter HDHR_IP manually.
- Save.
At this point Jellyfin has your channels — but they’ll show as numbers with no names or schedule. That’s expected. The guide is a separate step (next).
3. Add the guide (XMLTV) — the step everyone skips
The tuner provides channels; it does not provide the program guide (the “what’s on, when” grid). Jellyfin needs you to supply guide data in a format called XMLTV.
Option A, Schedules Direct (paid). About $35 a year, built into Jellyfin as its own guide provider. Go to Dashboard → Live TV → TV Guide Data Providers → + → Schedules Direct, sign in, and pick your lineup. This is the choice if you want the guide to just work.
Option B, zap2xml (free). A small container that downloads your area’s listings every six hours and saves them as an XMLTV file. It needs your zip code. Without it you get a 400 error, “No channels available”.
B1. On a Raspberry Pi, first check that the image has an arm64 build:
docker manifest inspect jesmann/zap2xml:latest | grep architecture
Then make a folder for the file and start the container. Replace YOURZIP with the zip code where your antenna sits, and set your own time zone.
sudo mkdir -p /opt/xmltv
docker run -d --name zap2xml --restart unless-stopped \
-v /opt/xmltv:/xmltv \
-e OUTPUT_FILE=/xmltv/xmltv.xml \
-e POSTAL_CODE=YOURZIP \
-e TZ=America/Chicago \
jesmann/zap2xml:latest
B2. Check that it worked. The log should show the chunks completing, and the file should be several MB.
docker logs --tail 15 zap2xml
ls -lh /opt/xmltv
B3. Share the folder with Jellyfin. Jellyfin runs in its own container, so it cannot see the file until you add this line under volumes in its compose file:
- /opt/xmltv:/xmltv:ro
Then recreate Jellyfin and confirm it can see the file:
docker compose up -d jellyfin
docker exec jellyfin ls -lh /xmltv
B4. Add the guide in Jellyfin: Dashboard → Live TV → TV Guide Data Providers → + → XMLTV. For the file path, enter the path as Jellyfin sees it: /xmltv/xmltv.xml. Save.
zap2xml is a community project that reads public listings, and tools like it have broken before. If it stops updating, switch to Schedules Direct. Nothing else in your setup changes.
Map channels to the guide
Jellyfin shows tuner channels on one side, guide channels on the other. Match each tuner channel to its guide listing. Do it once. Now Live TV shows a real guide — names, now/next, the works. Then run Dashboard → Scheduled Tasks → Refresh Guide and wait a few minutes. A channel that stays blank is usually one you did not map, or a sub-channel the listings do not carry. You can hide those.
4. Bonus: free streaming channels (no hardware)
Pluto TV is free, legal, ad-supported live TV — 400+ channels in the US. Jellyfin plays it through an M3U Tuner (a list of channel links) plus Pluto’s XMLTV guide.
Why there’s a helper: every Pluto stream needs a session pass that Pluto issues to your network, and it expires after 24 hours. That breaks the usual “paste a playlist” approach two ways. Public playlists carry someone else’s pass, so a channel plays a few seconds and stops, or shows “Pluto TV is no longer available on this device.” And a playlist file you refresh yourself still fails a day later, because Jellyfin keeps the links it first read, so it ends up playing an expired pass (the FFmpeg log shows 401 Unauthorized).
The fix is a small helper service on the Pi. It gives Jellyfin a list of local channel links that never change. When you tune in, it forwards the channel to Pluto with a current pass, renewing it every six hours on its own. No extra container — it’s plain Python, already on the Pi.
4a. Create the helper
Paste this whole block on the Pi:
mkdir -p ~/stack/pluto && cat > ~/stack/pluto/pluto_proxy.py << 'EOF'
#!/usr/bin/env python3
"""Local Pluto TV helper for Jellyfin.
Pluto stream links need a session token that expires after 24 hours, and
Jellyfin keeps the links it read from a playlist. So instead of putting the
token in the playlist, this serves links that never change and adds a fresh
token only when a channel is opened:
GET /playlist.m3u -> M3U for Jellyfin's M3U Tuner (stable local links)
GET /ch/<id>.m3u8 -> 302 redirect to Pluto with a current session token
The token is renewed every 6 hours; the channel list is rebuilt from the
Pluto guide (XMLTV) at the same interval, so channel IDs match the guide.
"""
import json
import threading
import time
import urllib.parse
import urllib.request
import uuid
import xml.etree.ElementTree as ET
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
PORT = 8181
REGION = "us"
GUIDE_URL = f"https://i.mjh.nz/PlutoTV/{REGION}.xml"
MAX_AGE = 6 * 3600
UA = {"User-Agent": "Mozilla/5.0"}
_session_lock = threading.Lock()
_channels_lock = threading.Lock()
_session = {"time": 0.0, "stitcher": "", "query": ""}
_channels = {"time": 0.0, "list": []}
def get(url):
with urllib.request.urlopen(urllib.request.Request(url, headers=UA), timeout=60) as r:
return r.read()
def session():
with _session_lock:
if time.time() - _session["time"] > MAX_AGE:
params = urllib.parse.urlencode({
"appName": "web", "appVersion": "8.0.0", "deviceVersion": "122.0.0",
"deviceModel": "web", "deviceMake": "chrome", "deviceType": "web",
"clientID": str(uuid.uuid4()), "clientModelNumber": "1.0.0",
"serverSideAds": "false",
})
boot = json.loads(get("https://boot.pluto.tv/v4/start?" + params))
_session["stitcher"] = boot["servers"]["stitcher"]
_session["query"] = (f"{boot['stitcherParams']}&jwt={boot['sessionToken']}"
"&masterJWTPassthrough=true")
_session["time"] = time.time()
return _session["stitcher"], _session["query"]
def channels():
with _channels_lock:
if time.time() - _channels["time"] > MAX_AGE:
root = ET.fromstring(get(GUIDE_URL))
found = []
for ch in root.findall("channel"):
cid = ch.get("id") or ""
name = (ch.findtext("display-name") or cid).replace(",", " ")
icon = ch.find("icon")
logo = icon.get("src", "") if icon is not None else ""
found.append((cid, name, logo))
_channels["list"] = found
_channels["time"] = time.time()
return _channels["list"]
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
path = urllib.parse.urlparse(self.path).path
try:
if path == "/playlist.m3u":
host = self.headers.get("Host") or f"127.0.0.1:{PORT}"
lines = ["#EXTM3U"]
for cid, name, logo in channels():
lines.append(f'#EXTINF:-1 tvg-id="{cid}" tvg-name="{name}" '
f'tvg-logo="{logo}" group-title="Pluto TV",{name}')
lines.append(f"http://{host}/ch/{cid}.m3u8")
body = ("\n".join(lines) + "\n").encode("utf-8")
self.send_response(200)
self.send_header("Content-Type", "audio/x-mpegurl")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
elif path.startswith("/ch/") and path.endswith(".m3u8"):
cid = path[len("/ch/"):-len(".m3u8")]
if not cid.isalnum():
self.send_error(404)
return
stitcher, query = session()
self.send_response(302)
self.send_header("Location",
f"{stitcher}/v2/stitch/hls/channel/{cid}/master.m3u8?{query}")
self.send_header("Content-Length", "0")
self.end_headers()
else:
self.send_error(404)
except Exception as exc: # network/API failure: tell the client, keep serving
self.send_error(502, str(exc)[:200])
def log_message(self, fmt, *args):
pass
if __name__ == "__main__":
print(f"Pluto helper listening on port {PORT}", flush=True)
ThreadingHTTPServer(("0.0.0.0", PORT), Handler).serve_forever()
EOF
The channel list comes from the same Pluto guide Jellyfin loads, so every channel lines up with its listings.
4b. Run it as a service
Create the service. Replace both YOUR_USER with your Linux username:
sudo tee /etc/systemd/system/pluto-proxy.service > /dev/null << 'EOF'
[Unit]
Description=Pluto TV helper for Jellyfin
Wants=network-online.target
After=network-online.target
[Service]
User=YOUR_USER
ExecStart=/usr/bin/python3 /home/YOUR_USER/stack/pluto/pluto_proxy.py
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
Then start it:
sudo systemctl daemon-reload && sudo systemctl enable --now pluto-proxy.service
Check it. The first command should say active (running). The second should print #EXTM3U and a /ch/ link; the first request takes a few seconds while it downloads the guide.
systemctl status pluto-proxy.service --no-pager
curl -s http://localhost:8181/playlist.m3u | head -3
Find your Pi’s IP (you need it next) and confirm Jellyfin can play through the helper. You want Input #0 and Stream #0 lines, and no 401.
PI_IP=$(hostname -I | awk '{print $1}'); echo "Pi IP: $PI_IP"
docker exec jellyfin /usr/lib/jellyfin-ffmpeg/ffprobe -hide_banner "http://$PI_IP:8181/ch/654932fa4d6d8f00084c4723.m3u8" 2>&1 | grep -E "401|Stream #|Input #|rror"
4c. Add it to Jellyfin
- Dashboard → Live TV → Tuner Devices → + → M3U Tuner. For File or URL, enter http://PI_IP:8181/playlist.m3u (your Pi’s IP, not localhost, because Jellyfin runs in its own container). Turn on Ignore DTS and Read input at native frame rate, which keep playback from stalling when Pluto switches to an ad. Set the simultaneous stream limit to 0 (unlimited) or a small number like 5. Save.
- TV Guide Data Providers → + → XMLTV. For File or URL, enter https://i.mjh.nz/PlutoTV/us.xml. Save.
- Dashboard → Scheduled Tasks → Refresh Guide → Run.
- Reload the page (Ctrl+F5) and play a Pluto channel. Your guide now has 400+ free channels mixed in with your OTA locals.
If a stream misbehaves, open Dashboard → Logs, find the newest FFmpeg.Transcode log, and read its last lines for the reason. Troubleshooting below covers the common ones.
5. DVR — record to your NAS
- Jellyfin Dashboard → Live TV → DVR / Recording settings.
- Set the recording path to your NAS share (e.g. your /mnt/nas-media mount from the NAS video). Not the SD card — recordings are large and pile up fast.
- Optionally set pre/post-record padding (start 1 min early, end a few min late) so you never clip the end of a show.
Record something
- Open the guide, pick a show, Record (one episode) or Record Series (every new episode).
- Recordings land on the NAS and appear in your Jellyfin library like any other video.
Test early: record something short, confirm it lands on the NAS and plays back cleanly, before you trust it with something you care about.
Check file sizes: after your first few recordings, look at each file’s size. A real half-hour episode is hundreds of megabytes. A file of a few hundred bytes is a failed capture, usually from a weak channel. To list suspects, run: find /path/to/recordings -name ‘*.ts’ -size -1M. Check each channel’s SignalQuality at http://HDHR_IP/lineup.json and record from the strong ones.
Performance notes (honest limits)
- Transcoding is the Pi’s bottleneck. One stream that direct-plays on a capable TV app is easy. Multiple simultaneous streams that each need on-the-fly conversion will push a Pi 5 hard. Great for a 1–2 stream household; not a whole-building headend. Enable hardware acceleration in Jellyfin if your Pi build supports it, and prefer client apps that direct-play the stream.
- OTA is physics. You only get stations that actually reach your antenna. Distance/terrain can’t be fixed in software.
- Pluto needs its helper running. The Pluto channels only play while pluto-proxy.service is up (it starts on boot and restarts itself). If Pluto changes how its sessions work, the helper may need an update.
- The NAS is part of your TV. If the NAS share goes missing, Jellyfin can fail to start because the folder it expects isn’t there. Keep the NAS mounted and healthy.
Troubleshooting
Channels show as numbers with no names/schedule → You added the tuner but not the guide, or didn’t map channels. Do Section 3.
Guide is blank / wrong shows → XMLTV source didn’t load, or channel mapping is off. Re-check the source URL and the channel-to-guide mapping.
Jellyfin can’t find the HDHomeRun → Enter HDHR_IP manually in Tuner Devices. Confirm the HDHomeRun is on the same network and its web page loads from the Pi.
Playback buffers / Pi maxes out → Too much transcoding. Reduce simultaneous streams, use a client that direct-plays, enable hardware acceleration, or lower the stream quality.
Recording didn’t save / failed → Check the NAS mount is connected and writable from the Jellyfin container, and that the recording path points at it. Test with a short recording.
Recording is only a few hundred bytes → The capture failed, usually because the tuner could not lock onto that channel. Check the channel’s SignalQuality on the tuner’s lineup.json page and record from a stronger channel. Add a minute or two of start padding. Delete the empty file and its Recordings entry.
zap2xml log says “No channels available” → The container has no zip code. Remove it and run it again with POSTAL_CODE and TZ set (Section 3).
Jellyfin can’t see the guide file → The folder isn’t shared into the Jellyfin container. Add the /opt/xmltv:/xmltv:ro volume, recreate Jellyfin, and check with docker exec jellyfin ls -lh /xmltv.
Pluto plays a few seconds, then “error playing live tv” → The playlist came from someone else’s server, so Pluto’s pass doesn’t match your network. Use the helper in Section 4.
Pluto worked yesterday, black screen today (FFmpeg log: 401 Unauthorized) → Jellyfin is playing an expired pass. That happens when the tuner points at a playlist file with passes baked in, because Jellyfin keeps the old links. Point the M3U tuner at the helper instead: http://PI_IP:8181/playlist.m3u (Section 4c).
Pluto channels won’t start at all → Check the helper: systemctl status pluto-proxy.service –no-pager should say active (running). If it says disabled or inactive, run sudo systemctl daemon-reload && sudo systemctl enable –now pluto-proxy.service. If curl -s http://localhost:8181/playlist.m3u | head -3 prints nothing, check journalctl -u pluto-proxy.service -n 20 –no-pager.
“Unable to find host to play channel” in the Jellyfin log → You’re clicking a channel left over from a tuner you deleted, or the tuner’s stream limit is used up. Run Refresh Guide, reload the page, and set the tuner’s stream limit to 0.
Jellyfin log shows “Name or service not known (zap2it.tmsimg.com)” → Harmless. It’s an old image server referenced by the zap2xml guide data that no longer exists, so some OTA artwork is missing.
Quick reference
HARDWARE: antenna → HDHomeRun → router (Ethernet) → power → scan channels JELLYFIN (Dashboard → Live TV): 1. Tuner Devices → + → HDHomeRun (auto-detect, or enter HDHR_IP) 2. TV Guide Data Providers → + → XMLTV (free: zap2xml file at /xmltv/xmltv.xml, or paid: Schedules Direct ~$35/yr) 3. Map tuner channels to guide channels (the step everyone skips) 4. (Bonus) Pluto helper on the Pi (Section 4) → Tuner Devices → + → M3U Tuner → http://PI_IP:8181/playlist.m3u (Ignore DTS on) + XMLTV guide https://i.mjh.nz/PlutoTV/us.xml → Refresh Guide 5. DVR settings → recording path = NAS share (NOT the SD card) USE IT: open Live TV → guide → Record / Record Series → saves to NAS
Sources & documentation
Jellyfin Live TV docs: https://jellyfin.org/docs/general/server/live-tv/
Jellyfin Docker install: https://jellyfin.org/docs/general/installation/container/
HDHomeRun tuner: https://www.silicondust.com/
zap2xml (free OTA guide), original project: https://github.com/jef/zap2xml
zap2xml fork used in this guide: https://github.com/jesmannstl/zap2xml (Docker image: jesmann/zap2xml)
Schedules Direct (paid guide, ~$35/yr): https://www.schedulesdirect.org/
Pluto TV guide data (XMLTV): https://i.mjh.nz/PlutoTV/
FCC antenna reception map: https://www.fcc.gov/media/engineering/dtvmaps
Companion guide for The Pi Stack Lab. This is the legal, free route — OTA + free FAST services.

