I’ve written about the topic of a home media server multiple times in the past, from building an RV media center to running a Synology NAS on 12V DC power, integrating internet radio into the sources, and running an Apple TV on 12V DC power. This time I wanted to cover a recent improvement: adding live TV-like custom IPTV channels.
My goals with the media center vary and start with the usual cord-cutting raison d’ĂȘtre of saving money. Those goals also include limiting commercials/advertisements in what I see and permanence — I want to own as much of a library as I can without losing access due to time-limited content licenses. Custom IPTV channels allow me to retain much of the live TV feel and casual watching while controlling the feed itself more. They avoid the typical indecision around deciding on something to watch.
New Hardware
The Synology DS118 that I use for the RV’s media center is not powerful enough to host the IPTV software pieces. It lacks the virtualization support necessary for Docker, does not have hardware-level H.264 transcoding, and its 8 TB drive is also nearly full. Adding another NAS to the overall system made sense.
I chose the Synology DS718+, which includes dual drive mirroring, hardware H.264 transcoding, and virtualization. While it could also work within the RV media center, I do not take it because of limited space — the DS118 is adequate. It hosts the less-frequently-viewed content and the newly-added IPTV software for home use.
ErsatzTV
ErsatzTV is an actively-developed project that allows its users to create their own IPTV channels. It is also a very young project, so I expect some changes to my setup as it matures (there’s a similar project, DizqueTV, which may match some use cases better). For me, it solves the problem of deciding what to watch — I just select one of my channels and let it play. ErsatzTV lives in a Docker container hosted on the Synology DS718+.
Docker Setup
The first step to getting ErsatzTV up and running on the Synology DS718+ is starting and configuring the Docker container. Install the Synology Docker package if needed and once done, add the ErsatzTV image. Hardware transcoding support will use the VAAPI interface, so that means selecting the latest-vaapi
tag when prompted.
Launch a container from that image once it finishes downloading, and you’ll be prompted for some configuration options. The following changes from the defaults are needed.
Enable Execute container using high privilege
This setting is needed for ErsatzTV to be able to leverage the hardware transcoder on Synology, specifically the /dev/dri/renderD128
device handle.
Enable Automatic Restarting
This setting is simple: if the software crashes for any reason, the container will be automatically restarted.
Map the Storage Volume(s)
The Synology Docker UI will have you choose the source folder first and then allow for typing in the container mount path. For this setup, I’ll have the source media folder mounted at /mnt/media1
(read-only) and the ErsatzTV config directory at its path: /root/.local/share/ersatztv
(read-write). It’s important that the ErsatzTV config directory is mapped to a permanent directory on the Synology because that allows preserving the channel lineup and other configuration changes between updates.
Optional: Use Docker Host Networking
This setting avoids the need to manually set the port number for the ErsatzTV web UI or look it up after the container launches.
Set the Time Zone
This is technically optional, but setting it helps align the schedule times shown to your actual time zone for easier editing.
ErsatzTV Setup
When you first connect to the ErsatzTV container, you’ll see a basic documentation screen with a menu on the left. This documentation describes each of the settings and pages in more detail than I’ll cover and can be returned to at any time by clicking on the logo in the top left corner.
By default, ErsatzTV wants to transcode to 1080p H.264 to ensure all items in the stream share the same encoding and resolution, but on my hardware, this is too computationally expensive and results in a lot of buffering. What follows are the changes and configurations I made to get reliable playback plus the basic setup needed to create a channel.
Adding Media
Prior to doing anything else, it’s useful to get the library configured so ErsatzTV can perform its initial indexing, which takes some time. This is done by adding the corresponding path(s) mapped in the docker setup earlier to either Movies or TV Shows depending on the type. Plex users can use that integration instead if desired.
Hardware Transcoding
Under the hood, ErsatzTV uses ffmpeg to power the media stream consumed by Channels. It defaults to the libx264
video encoder and ac3
audio encoder, both of which run in software rather than hardware. Software transcoding should be avoided at all costs because it can rarely keep up with 1x playback speed, resulting in regular buffering pauses. I size to 720p because that’s what I find streams most reliably with my hardware, and the pair of settings in the Video
column (turning on VAAPI hardware acceleration and using the h264_vaapi
codec) allows me to leverage the Synology’s hardware transcoder (virtually any model with an Intel processor has this).
Channel Settings
Adding a custom channel in ErsatzTV starts with creating the main channel entry. In this, you set the number you’d like it to appear on (DTV-like sub-channels such as 200.1 are supported), the name, streaming mode, which ffmpeg setting profile to use, and the channel thumbnail. I stick with the default streaming mode because HLS has some additional overhead for functionality I will never use.
Creating a Collection
Collections in ErsatzTV are a way of grouping of media items (typically movies — TV series and seasons have automatic collections created) to add into a schedule. They currently have no settings aside from the name and are purely organizational. Adding items to a collection only requires selecting the items in the media browser (a checkbox appears on the top left corner when one is hovered) and clicking the Add to Collection button that appears.
Tip: holding the shift key to select the last item will select everything between the first item and it.
Making the Schedule
A schedule defines the playback items and behavior for one or more channels. For my schedule here, I’m going to leave it on Shuffle
, but for something like a TV series you’d like to play in order, Chronological
would be the better choice. After adding the empty schedule, you can add items to it using the edit items button on the right side of the list. With the channel I’m creating, I select the collection I just created and hit save.
Create the Playout
The final step in creating a custom channel is to assign the schedule to the channel. This is accomplished by creating a playout and selecting the desired channel and schedule pair.
Channels DVR
For actually viewing the custom channels, I’m still using the Channels app that I’ve been using to stream live TV from an HDHomeRun for some time. Adding custom channels into the lineup is seamless with their server-based companion software, Channels DVR, which is running on the Synology DS718+. Its namesake is the DVR functionality, but I actually use it very little for that. Instead, it’s used to aggregate a bunch of content streams for more convenient viewing — these include local over-the-air channels from the HDHomeRun, Pluto TV free channels, one paid streaming service, and my custom channels from ErsatzTV.
Adding ErsatzTV Channels
Start by adding a source and choosing the Custom Channels
option. You’ll be prompted for a few settings: the name of the source (anything), the stream format (MPEG-TS
if you took my recommendation above), the source URL (copy this from the M3U link in the ErsatzTV UI), and the refresh interval.
After adding the source, you’ll see it in your TV guide list, but it will display one long block of time named for the channel. To actually list the individual media items in their time slots, click the configure button on the newly-added media source and then the menu item to set the guide data provider. Next, click on on the small USA popup, select the Custom URL
option, and paste in the XMLTV link from ErsatzTV.
At this point, Channels is ready for playback. You can watch it directly from the browser via the Live TV
link up top or from their app on your platform of choice.
Bonus Content: Pluto TV
This was a recent discovery for me, a find courtesy of some casual reading of the Channels forums. In short, it’s a sizable number of IPTV channels that contain ad-sponsored older content, including entire sitcom series and some movies. While I’d rather pay to avoid ads completely, much of the content it offers isn’t readily available without some cumbersome DVD ripping, so I tolerate it.
One of the developers for Channels put together a Docker image for Pluto TV that can run right on the Synology DS718+. The playlist and guide links from that can then be added to Channels DVR as a “Custom Channels” source so they appear in the channel lineup.