A manual way to stop a game's re-encode and go back to the stream's own resolution #156

Closed
opened 2026-11-10 21:47:48 -05:00 by cmoriarty · 1 comment
Owner

The problem (owner, 2026-11-11). There is no longer a way to make Sports Breaker stop re-encoding a game. It used to be enough to disconnect and wait for the game to fall off Now Playing. Since background channels (#96), a followed game's channel keeps running with nobody watching, so it never goes away.

Why it sticks (code, 2026-11-11)

  • A channel takes its shape from its first stream and keeps it for its life (#39). A later stream of another shape is re-encoded to it.
  • While the channel is in the background and unplayed, the shape is reset only when a new stream lands (Channel._adopt). A channel left on a stream it is already re-encoding keeps re-encoding until the next swap or recovery.
  • The routes on a channel are reject, back and swap. None of them closes it or resets its shape. A swap needs a ready standby, and with a viewer connected it keeps the shape.
  • The only ways out now are the game leaving the kept-warm ranking or restarting the app.

What is wanted
A control on the game (the Playing card is the natural place) that stops the re-encode and returns the channel to the resolution and frame rate of the stream it is playing.

To decide

  • With a viewer connected. Changing the shape mid-play is what #39 exists to prevent: Emby's transcode died at such a change on 2026-10-30. Options: allow it only with nobody watching, allow it with a warning that the player may need re-tuning, or close the channel so the next tune starts fresh.
  • Reset or close. Resetting the shape keeps the channel's buffer and history. Closing is simpler, but the background round would need to not reopen it straight away, or it reopens on the same terms.

Done when the owner can stop a game's re-encode from the page, without restarting the app, and the channel then plays the stream at its own resolution.

**The problem (owner, 2026-11-11).** There is no longer a way to make Sports Breaker stop re-encoding a game. It used to be enough to disconnect and wait for the game to fall off Now Playing. Since background channels (#96), a followed game's channel keeps running with nobody watching, so it never goes away. **Why it sticks (code, 2026-11-11)** - A channel takes its shape from its first stream and keeps it for its life (#39). A later stream of another shape is re-encoded to it. - While the channel is in the background and unplayed, the shape is reset only when a new stream lands (`Channel._adopt`). A channel left on a stream it is already re-encoding keeps re-encoding until the next swap or recovery. - The routes on a channel are reject, back and swap. None of them closes it or resets its shape. A swap needs a ready standby, and with a viewer connected it keeps the shape. - The only ways out now are the game leaving the kept-warm ranking or restarting the app. **What is wanted** A control on the game (the Playing card is the natural place) that stops the re-encode and returns the channel to the resolution and frame rate of the stream it is playing. **To decide** - **With a viewer connected.** Changing the shape mid-play is what #39 exists to prevent: Emby's transcode died at such a change on 2026-10-30. Options: allow it only with nobody watching, allow it with a warning that the player may need re-tuning, or close the channel so the next tune starts fresh. - **Reset or close.** Resetting the shape keeps the channel's buffer and history. Closing is simpler, but the background round would need to not reopen it straight away, or it reopens on the same terms. **Done when** the owner can stop a game's re-encode from the page, without restarting the app, and the channel then plays the stream at its own resolution.
Author
Owner

Done in PR #157 (merge 9d57161), deployed from main at ff67045 on 2026-11-11 03:09Z.

  • POST /api/channels/{game_id}/shape stops the re-encode: the channel takes the shape of the stream it is playing and serves it as it comes. The buffer and history stay.
  • On the Playing card it is the dashed chip beside the picture, which names the shape the stream is re-encoded to. It shows only while a stream is re-encoded.

The two open points, decided without the owner and easy to reverse:

  • Reset, not close.
  • Allowed with a viewer connected, behind a second press: the chip turns amber and says the player may need re-tuning.

Not used on a live re-encoding channel yet: none was re-encoding at the deploy.

Done in PR #157 (merge 9d57161), deployed from main at ff67045 on 2026-11-11 03:09Z. - `POST /api/channels/{game_id}/shape` stops the re-encode: the channel takes the shape of the stream it is playing and serves it as it comes. The buffer and history stay. - On the Playing card it is the dashed chip beside the picture, which names the shape the stream is re-encoded to. It shows only while a stream is re-encoded. The two open points, decided without the owner and easy to reverse: - **Reset, not close.** - **Allowed with a viewer connected**, behind a second press: the chip turns amber and says the player may need re-tuning. Not used on a live re-encoding channel yet: none was re-encoding at the deploy.
Sign in to join this conversation.
No labels
No milestone
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#156
No description provided.