ErsatzTV Documentation
repository·main·Indexed 25 days ago
https://github.com/ersatztv/legacyA media server management tool for creating custom live TV channels from existing media libraries. It features EPG support, channel scheduling, and IPTV streaming with hardware transcoding (NVENC, QSV, VAAPI, AMF, VideoToolbox). The system integrates with Plex, Jellyfin, and Emby, and provides detailed controls for channel creation, XMLTV guide generation via Scriban templates, and streaming configuration.
What's inside ErsatzTV
- ErsatzTV is a tool that transforms a media library into a personalized live TV experience. It provides features such as Electronic Program Guide (EPG) support, channel scheduling, and seamless streaming to various devices via IPTV. It supports hardware transcoding (NVENC, QSV, VAAPI, AMF, VideoToolbox) and integrates with media servers like Plex, Jellyfin, and Emby.
Workflow for setting up ErsatzTV
mainTo set up your own live TV experience with ErsatzTV, follow these steps:
- Install ErsatzTV: Download and set up the server on your system.
- Add Your Media: Connect your media libraries and collections.
- Create Channels: Design and schedule your own live channels.
- Stream Anywhere: Watch on any device using IPTV and EPG support.
Configure XMLTV Channel Guide Templates
mainErsatzTV uses custom templates to generate XMLTV fragments for different media types. These templates must be placed in the
ChannelGuideTemplatesFolderof your file system layout. The system looks for specific.sbntxtfiles to render data for various content types.Required template filenames:
movie.sbntxt(for Movies)episode.sbntxt(for Episodes)musicVideo.sbntxt(for Music Videos)song.sbntxt(for Songs)otherVideo.sbntxt(for Other Video types)remoteStream.sbntxt(for Remote Streams)
If these files are missing, the system will log an error and fail to generate the corresponding XMLTV fragments. Ensure these files exist in your custom templates directory and restart ErsatzTV if you add them after startup.
Configure XMLTV generation settings
mainThe XMLTV generation process is controlled by several configuration keys via the
IConfigElementRepository:Key Type Default Description XmltvDaysToBuildint2Number of days into the future to include in the guide. XmltvTimeZoneXmltvTimeZoneLocalThe timezone used for the XMLTV output. XmltvBlockBehaviorXmltvBlockBehaviorSplitTimeEvenlyHow to handle time distribution for Blockschedule types.XmltvBlockBehavior options:
SplitTimeEvenly: Divides the total block duration equally among the items in the group.UseActualTimes: Uses the actual start and finish times of the items.
FFmpeg Settings Validation Errors
mainWhen attempting to update FFmpeg settings, the following errors may be returned if the tool paths are invalid:
ffmpeg path does not exist: The path provided for the FFmpeg executable is not found on the file system.Unable to verify ffmpeg version: The FFmpeg executable exists but failed to return a valid version string when run with the-versionargument.ffprobe path does not exist: The path provided for the FFprobe executable is not found on the file system.Unable to verify ffprobe version: The FFprobe executable exists but failed to return a valid version string when run with the-versionargument.
Errors when adding a show to a playlist
mainWhen attempting to add a show to a playlist via the
AddShowToPlaylisthandler, the following errors may occur if validation fails:Playlist does not exist.: The providedPlaylistIdcould not be found in the database.Show does not exist: The providedShowIdcould not be found in the database.
Build a Playout using BuildPlayout
mainTheBuildPlayoutcommand is used to initiate the building process for a specific playout. It can be triggered with a specific build mode and an optional start time. This command is handled as anIBackgroundServiceRequest.Update a Smart Collection
mainUse the
UpdateSmartCollectioncommand to modify the properties of an existing Smart Collection. This operation updates the collection'sNameandQuery.When a Smart Collection is successfully updated, the following side effects occur:
- Search targets are notified of the change.
- The Smart Collection cache is refreshed.
- All Playouts that utilize this specific Smart Collection are queued for a refresh using
PlayoutBuildMode.Refreshvia a background service request (BuildPlayout).
Validation Rules:
- The
Idmust refer to an existing Smart Collection. If not found, it returns an error:SmartCollection does not exist. - The
Namemust not be empty. - The
Namemust not exceed 50 characters. - The
Namemust be unique across all Smart Collections. If a duplicate is found, it returns an error:SmartCollection name must be unique.
Remove items from a media collection
mainUse the
RemoveItemsFromCollectioncommand to remove specific media items from an existing collection.When items are removed:
- The collection is updated in the database.
- The search index is automatically reindexed for the removed items via
ReindexMediaItems. - All playouts using the modified collection are automatically refreshed using
BuildPlayoutwithPlayoutBuildMode.Refreshto ensure the changes take effect in scheduled broadcasts.
Update a channel via UpdateChannel command
mainTheUpdateChannelcommand is used to modify the configuration and properties of an existing channel. It requires aChannelIdand accepts a wide range of parameters to update channel metadata, playback behavior, streaming settings, and visual assets.Update a Local Library
mainThe
UpdateLocalLibraryhandler allows for updating the name and the collection of paths associated with an existingLocalLibrary.When updating a library:
- Path Synchronization: The handler compares existing paths with incoming paths. It automatically removes paths that are no longer present and adds new paths.
- Cleanup: If paths are removed, the handler deletes associated
MediaItemrecords,LibraryFolderrecords (starting from the deepest children), and theLibraryPathrecords themselves. - Search Index: If changes are detected, the handler removes the affected items from the search index.
- Automatic Scanning: If the library is successfully updated and the entity locker allows it, a
ForceScanLocalLibraryrequest is sent to the scanner background service to refresh the library content.
Note: Paths are normalized (converted to full local paths and upper-cased) during the comparison process to prevent duplicate entries.
Create a Playout in ErsatzTV
mainPlayouts define how content is scheduled for a specific channel. You can create different types of playouts depending on the scheduling logic required (Classic, Block, Sequential, Scripted, or External JSON).