Closed defagos closed 4 months ago
Excellent WWDC session about KPIs we can extract and how. Here are the associated slides for quick reference. Associated sample code and video can also be found online.
First draft:
See here the format for a START
event payload:
{
"session_id": "1",
"event_name": "START",
"timestamp": 1717665997932,
"data": {
"time_metrics": {
"metadata": 1200,
"asset": 1500,
"token": 1000,
"drm": 100,
"total": 2856
},
"screen": {
"width": 1280,
"height": 720
},
"os": {
"name": "android / iOS / macOS / windows / linux ",
"version": "11.23"
},
"player": {
"name": "pillarbox / video.js / letterbox",
"platform": "android / apple / web",
"version": "2.0.1"
},
"browser": {
"name": "safari / chrome / firefox",
"version": "11.0"
},
"media": {
"id": "urn:rts:video:1234",
"metadata_url": "https://il.srgssr.ch/composition/?urn=urn:rts:video:1234",
"asset_url": "https://akamai.com/quality_content.m3u8",
"origin": "ch.srgssr.srf-meteo / www.rts.ch/info/article/1234"
},
"device": {
"id": "MAC / IDFV",
"model": "Samsung Galaxy S24 / iPhone15,7",
"type": "TV / Car / Phone / Tablet / Desktop / Headset"
}
}
}
And an example of how it can be stored in the database:
device_id | device_model | ... | payload |
---|---|---|---|
iOS | iPhone15.7 | ... | { JSON } |
Remarks:
START
event can only be sent after the timings have been recorded, but its timestamp
must be the time at which the item being played becomes active.metadata
and asset
represent QoE values, i.e. they represent the value perceived by the user (0 if preloading was successful).See here the format for an ERROR
event payload:
{
"event_name": "ERROR",
"session_id": "1a2b3c-xyz",
"timestamp": 1717665997932,
"data": {
"severity": "WARNING / FATAL",
"name": "ERR_001",
"message": "Not found",
"player_position": 11000,
"url": "https://www.rts-vod.akamai.com/content/segm10.ts",
"log": "Raw error information as returned by the player, for example stack trace"
}
}
Some remarks:
player_position
cannot be extracted (e.g. error before playback even started) then omit.ERROR
is always preceded by a START
. The START
only provides timings that are available (e.g. no drm
timing is provided if the media source could not even be loaded).See here the format for an event payload:
{
"event_name": "BUFFER / HEARTBEAT / STOP / STALL / DISCONTINUITY / ...",
"session_id": "1a2b3c-xyz",
"timestamp": 1717665997932,
"data": {
"url": "https://www.rts-vod.akamai.com/content/segm10.ts",
"bitrate": 1000000,
"bandwidth": 2000000,
"buffer_duration": 120000,
"stall": {
"count": 2,
"duration": 1000
},
"playback_duration": 40000,
"player_position": 10000
}
}
Some remarks:
bitrate
is the quality of the variant currently being played, in bytes per second.bandwidth
is the device-measured network bandwidth, in bytes per second.buffer_duration
is the forward buffered duration, measured in milliseconds.stall.count
is the number of times the player unexpectedly buffers during playback, not as a result of a seek.stall.duration
is the corresponding total duration, in milliseconds.playback_duration
in milliseconds as well. playback_duration
is measured in wall-clock time, independent of playback speed settings (i.e. playback_duration = 60000
if a user watches 60 seconds of content, no matter the playback speed).player_position
in milliseconds. For DVR streams the offset from the live edge (collapsing to 0 if there is no window; the value is never omitted).STOP
for normal playback end and playback interruption (e.g. tab or player view closed by the user) since the distinction is not really relevant for QoS / QoE.Cumulative values can be sent in different ways to create charts that show total or increments:
We should investigate what is possible with graph tools before we decide what we send.
TL;DR We keep things as simple as possible and avoid introducing complex logic where no strict alignment is required.
In the end, and from a QoS perspective, having the same media counted as two sessions or seen as a single one should not be relevant. Therefore we should keep each platform implementation as simple as possible and identify sessions in the simplest way on each.
isTrackingEnabled
has been set to false
.As long as we don't store any IP address server-side, the data we send should be safe. But we should check with the data officer first.
@amtins contacted the RTS team but got no answer. Maybe we should ask the GD data governance team directly.
The mail has been sent. Moving this task to Follow while waiting for an answer.
As a Pillarbox team member I need to better understand how Pillarbox behaves in production.
Acceptance criteria
Tasks