Why Schedules Exist
A schedule (ProgramSchedule for Classic schedules, or a file-based definition for YAML and Scripted) is the bridge between your media library and your channel. It answers three questions:
- What plays — which collections, shows, movies, or playlists are scheduled
- When it plays — at fixed clock times or dynamically back-to-back
- In what order — chronological, shuffled, random rotation, marathon mode, and more
Playback Order
Every schedule item references aPlaybackOrder that controls the sequence in which media items are drawn from a collection:
Classic Schedules
A Classic schedule (ProgramSchedule) is the original ErsatzTV scheduling model. It is a named list of program schedule items (ProgramScheduleItem), each representing a content slot that can have a fixed start time or a dynamic (back-to-back) start time.
Key properties of a Classic schedule:
Schedule Item Playout Modes
EachProgramScheduleItem carries a PlayoutMode that controls how many items are drawn from the collection for that slot:
Filler in Classic Schedules
Each schedule item supports five categories of filler preset:- Pre-Roll — plays immediately before the main content
- Mid-Roll — inserted between items in a multi-item slot
- Post-Roll — plays immediately after the main content
- Tail — fills the remaining time at the end of a fixed-duration slot
- Fallback — a last-resort filler if no other filler applies
Classic Schedules
Set up time-slot grids with fixed start times, flood fill, and per-item filler presets.
Block Schedules
Build template-driven programming blocks with Deco overlays and precise time budgets.
YAML Schedules
Define your channel’s schedule declaratively in a structured YAML file.
Scripted Schedules
Write Python scripts to generate fully dynamic, algorithmically driven programming.
Block Schedules
Block scheduling uses a template and deco system. Instead of a flat list of time slots, you define reusable programming blocks — each block has a fixed duration and a set of content instructions. Blocks are assembled into templates that define a full day’s worth of programming. A Block playout can be configured with aDeco (decoration), which layers additional content or graphics onto the block’s output. The PlayoutTemplate entity maps a template to specific days of the week, days of the month, months of the year, and optional date ranges — giving you fine-grained seasonal and weekday-aware scheduling.
ErsatzTV maintains playout history for Block schedules, tracking which items were played per block and collection so that playback can resume correctly after a rebuild.
Playout history is exclusively maintained for Block schedules. This history ensures that after a playout reset or daily rebuild, ErsatzTV resumes each block’s collection from where it left off rather than starting over from the beginning.
YAML Schedules (Sequential)
The Sequential schedule kind (internally PlayoutScheduleKind.Sequential) uses a YAML-formatted file (ScheduleFile) to define the playout sequence declaratively. A YAML schedule describes the full programming structure in a human-readable, version-controllable text file, making it easy to replicate, share, or automate schedule creation.
The YAML file is referenced by the playout’s ScheduleFile property and is re-read whenever the playout is rebuilt.
Scripted Schedules
Scripted schedules (PlayoutScheduleKind.Scripted) let you write a Python script that programmatically generates playout instructions. The script has access to ErsatzTV’s Scripted Schedule API, which provides functions to query media, build time slots, and emit scheduling decisions at runtime.
Scripted schedules are the most powerful option — they allow conditional logic, external data lookups, dynamic time math, and any algorithm you can express in Python.
External JSON (ExternalJson)
PlayoutScheduleKind.ExternalJson allows ErsatzTV to consume a pre-built playout timeline delivered as a JSON document from an external source. This is useful for integrating ErsatzTV with external scheduling tools or automation pipelines that produce their own program data.
Schedule Kind Reference
ThePlayoutScheduleKind enum lists all schedule types supported by a playout:
Schedule Items and Collections
Regardless of schedule type, content is always referenced through a collection type (CollectionType). A single schedule item can point to:
- A Collection — a manually curated list of media items
- A Multi-Collection — a group of collections treated as one pool
- A Smart Collection — a dynamic collection defined by a search query
- A Playlist — an ordered list of items
- A Single Media Item — one specific movie, episode, or other item
- A Search Query — inline search expression evaluated at build time
Alternate Schedules
Classic schedule playouts support alternate schedules (ProgramScheduleAlternates). An alternate schedule can override the primary schedule for specific days of the week, date ranges, or other conditions. This allows seasonal overrides (e.g. a Christmas programming block that activates in December) without requiring you to create a separate playout for every variation.