S4M Asset Scheduling
We have implemented a custom S4M/Avatega asset scheduling process that reads data from the S4M data source and applies it to an Asset Schedule in Chameleon.
In 2025: Avatega replaces S4M for schedule data
The main pieces are
Read asset data
Create required assets
Schedule assets repeatedly and evenly through a 24 hour period.
but not during blackouts (scheduled in Flow)
S4M/Avatega Data Source
The data is stored in a SQL Server Database.
There are a couple tables that provide the data:
Materials:
[COP_Uci].[uci].[available_s4m_spot_media]
Schedule
2025 Avatega:
[WideOrbit_Schedule].[avatega].[playlist_adzone_events_vw]
LEGACY S4M:
[S4M_Schedule].[s4m].[dlevent]
We have built an ASP.Net Core minimal web API to access this data. This app is running in IIS. It has it’s own Application Pool (set to No Managed Code) and an Application in the Default Web Site. By using this type of access we can either pull the data live as json or use BLADE Runner to pull the data and post it somewhere else for access.
The published code is simply copied into the website folder to update it.
API Endpoints
Example endpoints using the new Avatega schedule view for 2025 Q3 to get the schedule
http://localhost/corusassets/schedule/event/CJBN?startDate=2025-04-09
To get the details for a material (data source unchanged from original)
http://localhost/corusassets/material/1011045
Example endpoint to get the BC1 station’s data for Jan 6, 2023:
http://localhost/S4M/schedule/event/BC1?startDate=2023-01-06
To get to the details for a material:
http://localhost/S4M/material/00032512
All materials in Ad Zones
http://localhost/s4m/material/
Asset Scheduler
Settings required include (with examples)
S4M Source Settings
Setting | Example Value | Notes |
---|---|---|
Station Id | BC1 |
|
Live Url | URL where the live data is accessible from | |
Use Live Url | true/false | True pulls data from the live URL |
Alternate Url | https://www.bannisterlake.com/dl/Global/S4M/BC1.json | Alternate location where a data file has been made available to use instead - same json format as the live URL (saved output) |
Alternate Material Url | https://www.bannisterlake.com/dl/Global/S4M/adzoneMaterials.json | Alternate location where a data file has been saved with Material data pulled from the live URL. |
Chameleon and Schedule Settings
Setting | Example Value | Notes |
---|---|---|
First Hour of the Day | 5 | 5:00 am |
Repeat Count | 40 | Repeats each item this many times in the 24 hour period |
Content Group Name | BC |
|
Channel Name | BC1 Test |
|
Media Bin Name | BC1 Zone Ads | Location of S4M media |
Media Bin Content Group Name | BC |
|
Project Content Group | Global |
|
Project Name | L-Frame 2022 Ad Zones | Must have scenes named
|
Media Field Name | media.media |
|
Database User Id | Updater |
|
Database User Password | password is set in an environment variable
| Run as Admin: setx FlowSettings__DatabaseUserWd "password" /M |
Flow Url | https://localhost/chameleon | URL of the Flow instance to populate the data into |
Processing Steps
Make a connection to the Chameleon database.
Pull the S4M data for the given date
Find the given content group, channel, and media bin items each by name
Find or create assets based on the S4M Id
Looks for an asset whose name matches the S4M Id in the given content group
If not found
Creates a new asset with a template named Ad Zone 1-4 based on the S4M data in the given project (if it can find it)
Attaches the media with the name of the S4M Id to the media.media field (if it can find it)
Reads the blackout schedule for the channel
Calculates the total blackout time
Determines the amount of time between assets that is left
Loops through all the S4M assets, evenly adding each to the schedule in turn over the 24 hours minus the blackout times