Table of Contents
What “Restreaming” Actually Means
Restreaming is the process of pulling a video stream from one source (a satellite capture, an origin HLS URL, a MAG portal, another IPTV provider's M3U) and republishing it to your own users under your panel's URL structure.
At the bare minimum, a restream moves bytes from an input to an output. In practice, you often need to:
- Normalize the container (TS, fMP4, raw) to what your output expects (usually HLS with TS segments).
- Preserve or rewrite audio tracks (add a default, drop secondary languages).
- Handle source disconnects and auto-reconnect.
- Rewrite segment URLs if the source uses relative paths.
- Pass through or regenerate EPG data.
Source Formats You Will Encounter
- M3U / M3U8 HLS - the most common. An
.m3u8URL with.tssegments. - MPEG-DASH (.mpd) - common for premium OTT. Usually paired with Widevine DRM.
- MPEG-TS over HTTP - a single long-running HTTP response. Satellite captures often output this.
- RTMP / RTMPS - legacy but still used for low-latency contributions.
- RTSP - cameras and some IPTV headends.
- SRT - increasingly popular for long-haul satellite-to-headend transport.
- UDP multicast - rare outside telecom operators' own networks.
Your panel output is almost always HLS (for web/app clients), TS (for MAG STBs), or RTMP (for RTMP-expecting apps).
The Restream Pipeline
Every restream follows the same conceptual pipeline:
A good IPTV panel handles all five stages for you. If you are building by hand, each stage is a separate FFmpeg / Nginx / watchdog problem.
1FFmpeg Command Reference
HLS source to HLS output, copy codec (most common)
TS-over-HTTP to HLS
RTMP source to HLS
Transcode to H.264 (when source codec is odd)
SRT input to HLS
/dev/shm? HLS segments are written and read rapidly. Writing them to a tmpfs (/dev/shm) avoids disk IOPS bottlenecks. For a busy server you want 4-8 GB of RAM dedicated to /dev/shm.
2HTTP Headers and User-Agent Gotchas
A huge percentage of failed restreams come from the source refusing requests that do not present the right headers. Things you will encounter:
User-Agent whitelist
Referer check
Cookie-based auth
Multiple headers
A good IPTV panel exposes a Headers field on each channel so you paste the full header block and the panel forwards it on every request - including segment requests, not just the manifest.
manifest_refresh_min profile setting exactly for this.
3Doing It in a Panel vs. By Hand
You can run FFmpeg restreams by hand under systemd or supervisord, but it breaks down fast:
- 100 channels = 100 FFmpeg processes = 100 systemd units to manage.
- Source disconnects need auto-restart logic with backoff.
- Each user connection needs to be authenticated, logged, and counted against their package.
- EPG needs to be associated with each channel.
- Load balancing across multiple output servers.
An IPTV panel collapses all of this into a database row + automatic FFmpeg orchestration. Xtream UI, XUI.ONE, and Xtream-Masters all handle the restream pipeline automatically once you add a channel.
4Bulk Import from an M3U Playlist
Most wholesale IPTV providers give you a big .m3u file with hundreds of channels. Instead of adding each manually:
In any Xtream-family panel: Management → Streams → Import M3U. Paste the URL, map categories, click Import. The panel parses the M3U, creates a stream entry per channel, assigns transcoding profiles, and wires up EPG.
Xtream-Masters goes one step further with Auto M3U Content Sync - the panel re-fetches the source M3U periodically and auto-adds new channels that appear. Useful for event-heavy categories (e.g., sports channels that come and go).
5Scaling: Source Once, Serve Many
The naive model: each load balancer pulls each source independently. 3 LBs x 200 channels = 600 source pulls. If each channel is 4 Mbps, your inbound bandwidth is 2.4 Gbps - you just multiplied your source provider's bill by 3.
The right model: main server pulls the source once, fans out the segments to LBs over a private network. 3 LBs x 200 channels = 200 source pulls total.
This is where panel architecture matters. XUI.ONE runs the source pull on each LB independently - the naive model. Xtream-Masters runs a shared stream state cluster so one pull feeds the whole system - the efficient model. At scale this is thousands of euros per month in saved upstream bandwidth.
A Note on Legality
Restreaming technology is content-neutral. The legal question is whether you have the right to redistribute the source. Pulling a public-domain feed (your own camera, a licensed contribution, a permitted mirror) is fine. Pulling a rights-holder's broadcast without permission is not, regardless of whether the technical mechanism is FFmpeg, a panel, or a cron script.
This article is a technical reference. If you are unsure about the legal status of a source, consult a lawyer who handles broadcasting rights in your jurisdiction.
