ErsatzTV Documentation

repository·main·Indexed 25 days ago

https://github.com/ersatztv/legacy

A 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.

Tokens
26.1K
Snippets
10
Records
166
Agent score
83%

What's inside ErsatzTV

  1. Overview of ErsatzTV

    main
    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.
  2. Workflow for setting up ErsatzTV

    main

    To set up your own live TV experience with ErsatzTV, follow these steps:

    1. Install ErsatzTV: Download and set up the server on your system.
    2. Add Your Media: Connect your media libraries and collections.
    3. Create Channels: Design and schedule your own live channels.
    4. Stream Anywhere: Watch on any device using IPTV and EPG support.
  3. Configure XMLTV Channel Guide Templates

    main

    ErsatzTV uses custom templates to generate XMLTV fragments for different media types. These templates must be placed in the ChannelGuideTemplatesFolder of your file system layout. The system looks for specific .sbntxt files 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.

  4. Configure XMLTV generation settings

    main

    The XMLTV generation process is controlled by several configuration keys via the IConfigElementRepository:

    KeyTypeDefaultDescription
    XmltvDaysToBuildint2Number of days into the future to include in the guide.
    XmltvTimeZoneXmltvTimeZoneLocalThe timezone used for the XMLTV output.
    XmltvBlockBehaviorXmltvBlockBehaviorSplitTimeEvenlyHow to handle time distribution for Block schedule 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.
  5. FFmpeg Settings Validation Errors

    main

    When 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 -version argument.
    • 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 -version argument.
  6. Update a Smart Collection

    main

    Use the UpdateSmartCollection command to modify the properties of an existing Smart Collection. This operation updates the collection's Name and Query.

    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.Refresh via a background service request (BuildPlayout).

    Validation Rules:

    • The Id must refer to an existing Smart Collection. If not found, it returns an error: SmartCollection does not exist.
    • The Name must not be empty.
    • The Name must not exceed 50 characters.
    • The Name must be unique across all Smart Collections. If a duplicate is found, it returns an error: SmartCollection name must be unique.
  7. Remove items from a media collection

    main

    Use the RemoveItemsFromCollection command to remove specific media items from an existing collection.

    When items are removed:

    1. The collection is updated in the database.
    2. The search index is automatically reindexed for the removed items via ReindexMediaItems.
    3. All playouts using the modified collection are automatically refreshed using BuildPlayout with PlayoutBuildMode.Refresh to ensure the changes take effect in scheduled broadcasts.
  8. Update a Local Library

    main

    The UpdateLocalLibrary handler allows for updating the name and the collection of paths associated with an existing LocalLibrary.

    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 MediaItem records, LibraryFolder records (starting from the deepest children), and the LibraryPath records 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 ForceScanLocalLibrary request 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.