Skip to content
samestrinPublic

About

A virtual HDHomeRun tuner for Plex that merges any number of IPTV subscriptions and web live streams into one curated, numbered lineup with a full guide, and keeps each channel playing by switching to a backup source when a stream fails.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omnituner logo

A virtual HDHomeRun tuner for Plex that merges any number of IPTV subscriptions and web live streams into one curated, numbered lineup with a full guide, and keeps each channel playing by switching to a backup source when a stream fails.

CI Release License: MIT

Plex Live TV only accepts tuners. omnituner is a tuner that does not exist in hardware: it takes many inputs, cleans them up, keeps them playing when a source fails, and hands Plex a lineup that reads like a cable guide.

Area What omnituner does
Inputs IPTV playlists (M3U) from any number of subscriptions or providers; YouTube, Rumble and Kick live streams; any direct .m3u8 stream; XMLTV guides, including a local antenna guide.
Fault tolerance Every channel keeps a list of sources: the same channel from other subscriptions, other providers and other feeds of the same network. A failing stream, or one that sends no video for 4 seconds, switches to the next source inside the same Plex session; an offline screen plays while nothing works (a "VPN down" screen when the VPN is the cause); per-subscription connection limits and health checks decide what to try first.
Curation Number blocks by type (Locals, News, Sports, Movies and more), extendable with your own groups and sub-groups; repeat feeds merged, including renamed networks; filters and per-group allow-lists; country versions next to the main channel; second sources as .2; numbers that stay stable.
Guide and look One XMLTV guide for everything; matching across messy channel names; logos from several public sources; dark logos placed on white; text tiles for channels with no logo; show images from TMDB; tags removed from names.
Translation Optional: watch a foreign-language channel together, each in your own language. The original stays on its number with its own sound; a copy next to it plays a few seconds behind live with captions in your language, made by your own Whisper and LLM servers.
Privacy Optional: all internet traffic through an HTTP proxy, such as a VPN client (gluetun), with any VPN provider. Plex traffic stays local, and nothing goes out directly when the VPN is down.
Delivery plex-sync saves the lineup in Plex for you, or keeps it in sync on its own. One Plex DVR with one guide for everything. Behind it, one program presents two HDHomeRun tuner devices (IPTV, and web channels), so Plex respects each source's own stream limit. Docker image with ffmpeg and yt-dlp.

A French news channel with live English captions

A French news channel (LCN) on its translated copy, with the English captions omnituner added. The frame comes from the channel's stream, with its captions drawn by ffmpeg.

Why

  • One outage should not take a channel down. The same channel is often available from more than one subscription, provider or feed. omnituner serves each channel once and switches between its sources when one fails, inside the same Plex session, so Plex does not show an error. It spreads viewers across subscriptions and never opens more streams than each allows.
  • Plex Live TV only accepts tuners. omnituner answers like an HDHomeRun network tuner, so Plex adds it like any other tuner, with an XMLTV guide, and plex-sync keeps Plex's channel list up to date.
  • IPTV playlists are messy. It drops repeat feeds, removes what you do not want, and numbers channels in blocks by type, so related channels sit together.
  • Good channels live outside your playlist. Web live streams and free .m3u8 channels get numbers inside the same groups as your IPTV channels, with an offline screen when a stream is down.
  • Not everyone in the room speaks the language on screen. A foreign-language channel can get a copy with live captions in your language, so two people can watch the same news together, each in their own language.

Install

Every method except Docker needs ffmpeg on the host at run time (each stream passes through ffmpeg -c copy), and yt-dlp only for YouTube, Rumble and Kick channels. Keep yt-dlp current: YouTube changes break old versions.

Release binary

Download omnituner_<version>_<os>_<arch>.tar.gz for your system (linux or darwin, amd64 or arm64) and checksums.txt from the latest release, then check and unpack it:

sha256sum --ignore-missing -c checksums.txt   # macOS: shasum -a 256 --ignore-missing -c checksums.txt
tar -xzf omnituner_*_linux_amd64.tar.gz
sudo install omnituner_*_linux_amd64/omnituner /usr/local/bin/

Docker

The image includes ffmpeg and yt-dlp.

git clone https://github.com/samestrin/omnituner.git
cd omnituner
cp config.example.json config.json   # then edit it
docker compose up -d --build

config.json is mounted read-only into the container; channel numbers are kept in ./data.

go install

Needs Go 1.26 or newer.

go install github.com/samestrin/omnituner@latest

From source

git clone https://github.com/samestrin/omnituner.git
cd omnituner
go build -o omnituner .

To run it as a service on Linux, see docs/running.md.

Upgrade

Restarting omnituner ends every stream that is playing through it; check that nobody is watching first. With a release binary, install the new one over the old one and restart the service. With Docker, run git pull && docker compose up -d --build. Channel numbers are kept across upgrades.

Quick start

cp config.example.json config.json   # set your subscriptions (m3u) and epg_url
./omnituner config.json
curl -s localhost:8480/discover.json

omnituner logs its lineup (trimmed):

omnituner starting: port=8480 subscriptions=a,b tuners=4
listening on :8480
lineup refreshed: 943 in playlist, 909 after rules, 467 after dedupe, 467 in lineup map[Anime:4 Documentaries:20 Entertainment:101 Kids:15 Locals:60 Movies:78 Music:35 News:19 Sports:120 ...]

/discover.json answers like an HDHomeRun (trimmed):

{
  "BaseURL": "http://localhost:8480",
  "DeviceID": "1A2B3C4D",
  "FriendlyName": "omnituner",
  "LineupURL": "http://localhost:8480/lineup.json",
  "ModelNumber": "HDTC-2US",
  "TunerCount": 4
}

Then add the tuner in Plex once: Settings, Live TV & DVR, Set up Plex DVR, enter <host>:8480, and choose the XMLTV guide http://<host>:8480/epg.xml. After that, omnituner plex-sync saves channel changes in Plex (see docs/plex-sync.md). docs/plex-setup.md also covers the case where Plex hides the XMLTV option.

Usage

Command What it does
omnituner [config.json] Runs the tuner (HTTP server). Plex talks to it; you rarely do.
omnituner plex-sync [config.json] Saves the current lineup in Plex: adds missing tuners to the DVR, waits for the guide, saves each tuner's channel list, reloads the guide. Needs PLEX_TOKEN and the plex config block.
PLEX_TOKEN=xxxxxxxx omnituner plex-sync config.json

Endpoints served by the tuner:

Endpoint What it does
GET /discover.json HDHomeRun device info for Plex.
GET /lineup.json The channel list: number, name and stream URL.
GET /lineup_status.json HDHomeRun scan status (always idle).
GET /ch/<id> One IPTV channel as MPEG-TS, with failover between subscriptions.
GET /epg.xml The XMLTV guide, keyed by channel number, with icons.
GET /channels Debug: the lineup with groups, plus subscription health, as JSON.
GET /healthz Debug: subscription health, channel count and a guide checksum, as JSON.
GET / The status page, for people (see below).
GET /status.json The status page's data, as JSON.
GET /custom/<number> One web channel (second port, default 8481).

The second port also serves its own /discover.json, /lineup.json and /lineup_status.json. Both tuners go into the same Plex DVR, so you see one guide. They stay separate devices because Plex counts streams per device: this way it never starts more IPTV streams than your subscriptions allow, even when web channel slots are free.

Example: check which subscription is healthy.

curl -s localhost:8480/healthz
{
  "channels": 288,
  "epg_hash": "97b5f6c92c45",
  "health": {
    "a": { "down": false, "fails": 0, "last_probe": "2026-12-01T13:18:51-08:00" },
    "b": { "down": false, "fails": 0, "last_probe": "2026-12-01T13:18:51-08:00" }
  }
}

down turns true after probe_count failed checks in a row (default 3); fails counts the failures in a row, and one good check sets it back to 0. epg_hash changes when the guide changes.

Example: see one channel and its sources.

curl -s localhost:8480/channels

/channels returns {"channels": [...], "health": {...}}; health is the same as in /healthz. One channel (trimmed):

{
  "id": "200163528",
  "name": "US: ABC News Live",
  "tvg_id": "abcnewslive.us",
  "logo": "https://logo.m3uassets.com/abcnewslive.png",
  "group": "US News",
  "category": "News",
  "mta": "206.1",
  "sources": [
    { "sub": "a", "id": "200163528" },
    { "sub": "b", "id": "200163528" },
    { "sub": "a", "id": "400124863" },
    { "sub": "b", "id": "400124863" }
  ]
}

mta is the channel number in Plex. sources lists every feed of the channel in order of preference: the same stream on each subscription, then other feeds of the same network. When a viewer tunes in, feeds on a subscription that is down are tried last. Stream URLs are never shown, because they hold account keys.

Status page

Open http://<host>:8480/ in a browser to see what omnituner decided and what it is doing. The page is read-only and refreshes every 10 seconds.

The omnituner status page

  • Subscriptions: up or down, failed checks in a row, and connections in use out of max_streams.
  • Playing now: each open Plex stream, with the feed that plays (a subscription, live for a web channel, or the offline or VPN image), how long, and how much it sent.
  • Lineup: every channel by number block, with its sources (click a row to see them, with each subscription's health) and the show on now. "name only" means the guide has no shows for the channel, only blocks named after it; "no guide" means it has nothing. The filters show these channels, and channels with one source only: the weak spots of the lineup.
  • Web channels: type, and whether one is playing.

The page and /status.json show no stream, playlist, guide or proxy URLs and no keys. They do show channel names and client addresses, so like the rest of omnituner they belong on a trusted network.

Configuration

All settings live in one JSON file, given as the first argument (default config.json). config.example.json shows the main keys.

Name Default Meaning
subscriptions required Your IPTV playlists, in priority order: name, m3u (playlist URL), max_streams (default 2), optional epg_url (a guide for this subscription) and stream_base (build stream URLs as stream_base/<id> instead of using the playlist URLs). The older a / b keys still work.
epg_url none The main XMLTV guide URL. Per-subscription guides are merged after it; the first guide to match a channel wins.
port 8480 HTTP port for the IPTV tuner.
tuner_count sum of max_streams Streams Plex may open at once.
device_id 1A2B3C4D HDHomeRun device id. Keep it stable or Plex sees a new device.
probe_every, probe_count 60s, 3 Health check interval, and failures before a subscription counts as down.
remux true Pass IPTV streams through ffmpeg so a drop reconnects inside the same Plex session. false pipes bytes directly.
splice true Join the feeds of one Plex session into one stream: after a reconnect, time keeps moving forward, seconds the source sends again are dropped, and a new source starts at a keyframe. false writes each feed as ffmpeg sends it.
ffmpeg ffmpeg Path to ffmpeg.
offline_image built in Image shown while no source works.
dedupe true Keep one feed per network.
exclude_categories ["PPV / Events"] Groups left out of the lineup.
exclude_channels none Regexes on channel names to leave out.
category_only none Per group, keep only channels matching one of these regexes.
categories, same_network, display_strip from rules.default.json Number blocks and keywords, network aliases, and tags removed from names shown in Plex.
extra_xmltv none A local XMLTV file to merge into the guide (for example an antenna guide).
ota_logos, plex_logos none JSON files that map names to public logo URLs.
guide_map none Channel number or name to a guide channel id; the channel gets that guide channel's shows. See docs/icons-and-guides.md.
guides none Extra XMLTV guides (URLs or files, gzip allowed) that guide_map can take shows from.
drop_titles ["^channel no longer available$"] Regexes (case-insensitive) on show titles to remove from the guide, so the channel name shows instead.
logo_overrides none Channel name to logo URL; "" means no logo.
dark_logo_url an images.weserv.nl URL Wraps dark, see-through logos on a white background. "" turns it off.
text_logo_url a placehold.co URL Text tile with the channel name for channels with no logo. "" turns it off.
custom none The web channel tuner: port (8481), device_id (1A2B3C4E), tuner_count (2), ytdlp (yt-dlp), ffmpeg, offline_image, channels.
plex none For plex-sync: url, dvr (default: the DVR holding the tuner), tuner_url (how Plex reaches omnituner, needed only to add a new tuner), insecure_tls, auto_sync (sync after start-up and on every lineup change).
show_images true Show images from TMDB in the guide, when TMDB_READ_TOKEN or TMDB_API_KEY is set. See docs/icons-and-guides.md.
proxy none An http://host:port proxy for all internet traffic, for example a VPN client such as gluetun. Plex traffic does not use it. If the proxy is down, streams fail instead of going out directly. See docs/vpn.md.
translate none Translated captions: stt_url, stt_model, llm_url, llm_model, to (en), delay (15s), channels (channel, from). See docs/translation.md.
proxy_check_url https://www.gstatic.com/generate_204 Fetched through proxy when every source of a channel fails. If it fails too, viewers see a "VPN down" image instead of "Channel offline".
PLEX_TOKEN (environment) none The Plex token for plex-sync. plex.token in the config also works but keeps a secret in the file.
TMDB_READ_TOKEN or TMDB_API_KEY (environment) none A free TMDB key, for show images in the guide.

omnituner writes its files in its working directory: channel-map.json (channel numbers, so they stay the same across restarts), logo-check.json (which logos are dark) and show-images.json (show images found on TMDB). Subscription URLs contain account keys; keep config.json private.

Details: channel numbers and filters, web channels, icons and antenna guide.

Output and exit codes

Response When
200, video/mp2t A channel is streaming. If every source fails after that, the offline image plays and omnituner keeps retrying.
503 Every subscription connection is in use. Plex reports that no tuner is free.
404 Unknown channel.
400 Malformed channel path.

The process exits with a non-zero code when the config file cannot be read or is invalid (for example a bad regex, an unknown web channel type, or two web channels with the same number).

How it works

omnituner reads every playlist every two hours, joins entries that share a stream id or a network name into one channel with a list of sources, applies your filters and assigns numbers by group. Plex asks /lineup.json for the channels and /epg.xml for the guide. When a viewer tunes in, omnituner takes the first source on a healthy subscription with a free connection and runs ffmpeg -c copy from it to MPEG-TS. When that stream ends, or sends no video for 4 seconds (a newly started feed gets 20 seconds for its first video), it moves to the next source and keeps writing to the same response, so Plex does not notice. The feeds are joined into one stream (splice): time only moves forward, seconds the source sends again after a reconnect are dropped, and a new source starts at a keyframe. Web channels work the same way on the second port, after yt-dlp finds the current stream URL.

Limits

  • omnituner provides no content. It ships no channels, playlists, accounts or streams and does not help find them. Use only sources you are allowed to use.
  • Matching across providers is by name. Channels from different providers join when their cleaned names match (or they share a stream id). Two different channels with the same name can be joined by mistake; same_network and exclude_channels correct that.
  • Tested with Plex only. Other HDHomeRun clients (Jellyfin, Emby, Channels) may work but are untested.
  • Plex saves about 470 channels per tuner. Plex sends the whole channel list in one URL and rejects it past about 32 KB. Use filters to stay under that.
  • Plex loads only public image URLs. It refuses images from LAN addresses, so omnituner cannot serve icons itself; it points at public ones, including two free services (images.weserv.nl, placehold.co) that you can turn off.
  • The antenna is not an input stream. An antenna guide can be merged into epg.xml, but a USB or network antenna tuner stays its own device in Plex; Plex puts both tuners in one DVR (see docs/plex-setup.md).
  • No discovery broadcast. Plex finds the tuner when you enter its address; omnituner does not answer HDHomeRun network discovery.
  • No authentication. Anyone who can reach the ports can watch and can open the status page. Run it on a trusted network only.
  • One ffmpeg process per viewer. With remux on, each stream costs one ffmpeg copy process (no re-encode).
  • A mid-stream switch can show a short glitch in a recording while the new stream starts.
  • Web channels depend on third parties. YouTube, Rumble, Kick and free stream URLs change; a dead source shows the offline image.
  • Not handled: DRM streams, geo-blocked streams, and placeholder videos a provider plays when its own feed is down (they look like real video).

Documentation

Development

go test ./...        # unit tests; uses fake ffmpeg scripts, no network
go test -race ./...  # the same with the race detector
go vet ./...
gofmt -l .

The default channel rules are in rules.default.json, embedded in the binary at build time.

Changelog

See CHANGELOG.md.

License

MIT, see LICENSE.

About

A virtual HDHomeRun tuner for Plex that merges any number of IPTV subscriptions and web live streams into one curated, numbered lineup with a full guide, and keeps each channel playing by switching to a backup source when a stream fails.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages