A stream that goes silent does not cost the seconds it was silent #169

Closed
opened 2026-11-14 19:25:46 -05:00 by cmoriarty · 1 comment
Owner

What happens

From the app's log, 2026-11-11 19:13 to 2026-11-14 18:10 EST: 25 of 173 changes of stream came after the playing stream had listed no new segment for 16 to 17 s. 18 of the 25 were one site's stream host.

By the time the channel changes stream, the new one has moved on by those seconds. With #168 the jump is shorter, but the new stream still holds the moment the old one stopped only when it was the slower of the two: D + 16.5 <= W, with D the seconds its end was ahead of the old stream's and W the seconds it keeps (12 to 24 on the sites measured). When the stream that died was the slower one, the picture still skips.

This is step 3 of 3 in the milestone. It needs #168. It was not tested in the research: the idea comes from the numbers.

The idea

  • While the playing stream is silent, keep the standby's segments. When the playing stream has listed nothing new for longer than its usual gap (start: one and a half segments, and at least 6 s; the watch knows each stream's gaps), and a standby has a trusted relation (#167), download the segments in the standby's playlist and each new one as it appears. The watch already reads that playlist every 1 to 3 s.
  • If the stream speaks again, drop them. Nothing in the channel has changed.
  • If the channel changes stream, join on them as #168 does, from the moment the old stream stopped.

A wrong stream costs nothing

The owner, 2026-11-14: "it is fairly common for the streams to just be wrong, and this new feature will need to be robust to that scenario." And: "sometimes the streams are from different markets and have different commercials, but they are showing the same game."

  • Nothing is kept for a link with no trusted relation. Another game, or another broadcast of this one, cannot be joined on the same moment, so it costs no request.
  • A standby in a different commercial is still kept: its relation is trusted from before the break (#167), and the check at the join (#168) says whether it could be confirmed.

Settings

The owner, 2026-11-14. Two rows on the Settings page, beside Start behind live:

  • Keep the standby's video while the stream is silent: "Only then" (default) or "Never". His words: "download a standby's pieces while your stream is silent - This should be another setting, and by default do 'Only then'." Keeping it all the time is not built: it doubles the downloads for every watched game. Say if it should be a third value.
  • After a stall: "Stay" (default) or "Skip ahead to live". His words: "also should be a setting: after a stall - default to stay". Stay carries on from where the old stream stopped, so the channel runs that many seconds later until it is reopened. Skip ahead lands as today.

What it costs

  • About ten segment downloads per stall: what the standby keeps (3 to 6 segments) and what it lists during the wait. For an encrypted stream, its key as well.
  • None while the playing stream is not silent.
  • A silence that ends by itself costs the few segments kept until then. A ceiling per game (start: 30 kept segments in 10 minutes) stops a stream that keeps going quiet from multiplying requests.

Data it needs

  • The two settings, in settings.json under playback, on GET /api/settings and PUT /api/settings/playback.
  • On the change-of-stream event: how many segments were kept and how many were used, beside moved_seconds.

Done when

In the unit lane, with the generated streams of #167:

  • A stall with "Only then" and "Stay": the channel carries on from the moment the old stream stopped. No second of the programme is missing or repeated.
  • With "Skip ahead to live": it lands as today.
  • With "Never": no segment of the standby is downloaded beyond the watch's own sample, and the swap is aimed as far as #168 can.
  • A silence that ends: the kept segments are dropped, and the channel's playlist is what it would have been.
  • A standby with no trusted relation: nothing is kept.
  • Requests are counted in the test: none while the stream is not silent, and never above the ceiling.
  • The event says how many segments were kept and used, and how far the picture moved.

Live: the next stall on a game with a matched standby records 0.0 s moved (within 0.1).

Specs: stream-supervision, admin-page, event-log.

## What happens From the app's log, 2026-11-11 19:13 to 2026-11-14 18:10 EST: 25 of 173 changes of stream came after the playing stream had listed no new segment for 16 to 17 s. 18 of the 25 were one site's stream host. By the time the channel changes stream, the new one has moved on by those seconds. With #168 the jump is shorter, but the new stream still holds the moment the old one stopped only when it was the slower of the two: `D + 16.5 <= W`, with D the seconds its end was ahead of the old stream's and W the seconds it keeps (12 to 24 on the sites measured). When the stream that died was the slower one, the picture still skips. This is step 3 of 3 in the milestone. It needs #168. It was not tested in the research: the idea comes from the numbers. ## The idea - **While the playing stream is silent, keep the standby's segments.** When the playing stream has listed nothing new for longer than its usual gap (start: one and a half segments, and at least 6 s; the watch knows each stream's gaps), and a standby has a trusted relation (#167), download the segments in the standby's playlist and each new one as it appears. The watch already reads that playlist every 1 to 3 s. - **If the stream speaks again,** drop them. Nothing in the channel has changed. - **If the channel changes stream,** join on them as #168 does, from the moment the old stream stopped. ## A wrong stream costs nothing The owner, 2026-11-14: "it is fairly common for the streams to just be wrong, and this new feature will need to be robust to that scenario." And: "sometimes the streams are from different markets and have different commercials, but they are showing the same game." - **Nothing is kept for a link with no trusted relation.** Another game, or another broadcast of this one, cannot be joined on the same moment, so it costs no request. - **A standby in a different commercial is still kept:** its relation is trusted from before the break (#167), and the check at the join (#168) says whether it could be confirmed. ## Settings The owner, 2026-11-14. Two rows on the Settings page, beside Start behind live: - **Keep the standby's video while the stream is silent:** "Only then" (default) or "Never". His words: "download a standby's pieces while your stream is silent - This should be another setting, and by default do 'Only then'." Keeping it all the time is not built: it doubles the downloads for every watched game. Say if it should be a third value. - **After a stall:** "Stay" (default) or "Skip ahead to live". His words: "also should be a setting: after a stall - default to stay". Stay carries on from where the old stream stopped, so the channel runs that many seconds later until it is reopened. Skip ahead lands as today. ## What it costs - **About ten segment downloads per stall:** what the standby keeps (3 to 6 segments) and what it lists during the wait. For an encrypted stream, its key as well. - **None while the playing stream is not silent.** - **A silence that ends by itself** costs the few segments kept until then. A ceiling per game (start: 30 kept segments in 10 minutes) stops a stream that keeps going quiet from multiplying requests. ## Data it needs - The two settings, in `settings.json` under `playback`, on `GET /api/settings` and `PUT /api/settings/playback`. - On the change-of-stream event: how many segments were kept and how many were used, beside `moved_seconds`. ## Done when In the unit lane, with the generated streams of #167: - **A stall with "Only then" and "Stay":** the channel carries on from the moment the old stream stopped. No second of the programme is missing or repeated. - **With "Skip ahead to live":** it lands as today. - **With "Never":** no segment of the standby is downloaded beyond the watch's own sample, and the swap is aimed as far as #168 can. - **A silence that ends:** the kept segments are dropped, and the channel's playlist is what it would have been. - **A standby with no trusted relation:** nothing is kept. - **Requests are counted in the test:** none while the stream is not silent, and never above the ceiling. - **The event says** how many segments were kept and used, and how far the picture moved. Live: the next stall on a game with a matched standby records 0.0 s moved (within 0.1). Specs: `stream-supervision`, `admin-page`, `event-log`.
Author
Owner

Merged in PR #195 (merge 4d8b2c5), archived in fbe6270, live as fbe6270 since 2026-11-18 17:54Z.

  • What it does. While the stream playing has listed nothing for about 6 to 12 s, the channel downloads the standby the recovery would take. It starts from the segment holding the moment the stream stopped, and keeps each new one.
  • Past the playlist. It reaches back past the standby's playlist by the addresses the watch saw listed, while the host still serves them.
  • The join. The recovery joins on those segments, and its event carries kept_segments and kept_used.
  • Cost. At most 30 such downloads per channel in 10 minutes. None for a background channel nobody watches, none for a standby with no trusted relation.
  • Settings. Two rows: "Keep the standby's video while silent" (Only then, the default) and "After a stall" (Stay, the default). Skip ahead to live lands three segments from the new stream's end, not aimed.

Not seen live yet: a stall on a game whose standby is ahead and matched. It should land within a keyframe of where the stream stopped, with segments kept and used.

Merged in PR #195 (merge 4d8b2c5), archived in fbe6270, live as fbe6270 since 2026-11-18 17:54Z. - **What it does.** While the stream playing has listed nothing for about 6 to 12 s, the channel downloads the standby the recovery would take. It starts from the segment holding the moment the stream stopped, and keeps each new one. - **Past the playlist.** It reaches back past the standby's playlist by the addresses the watch saw listed, while the host still serves them. - **The join.** The recovery joins on those segments, and its event carries `kept_segments` and `kept_used`. - **Cost.** At most 30 such downloads per channel in 10 minutes. None for a background channel nobody watches, none for a standby with no trusted relation. - **Settings.** Two rows: "Keep the standby's video while silent" (Only then, the default) and "After a stall" (Stay, the default). Skip ahead to live lands three segments from the new stream's end, not aimed. Not seen live yet: a stall on a game whose standby is ahead and matched. It should land within a keyframe of where the stream stopped, with segments kept and used.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker#169
No description provided.