Skip to content

VP9 SvcConsumer on a transport without BWE never re-evaluates target layer when the top spatial layer stops #1821

Closed

Description

@mstyura

Bug Report

Your environment

  • Operating system: Linux or MacOS
  • gcc/clang version: -
  • mediasoup (Node) version: 3.20.2 (but seems relevant to other versions)
  • mediasoup (Rust) version: -
  • mediasoup-client version: -

Issue description

For a VP9 SVC consumer created on transport without BWE, when the producer stops sending the top spatial layer (e.g. the encoder drops it under a bitrate cap), the consumer keeps its target pinned to the now-absent layer and never falls back. With K-SVC this means all remaining (lower-layer) packets are dropped and the consumer produces no media at all.

Steps to reproduce

  1. Producer: VP9 K-SVC (e.g. L2T3_KEY), 2 spatial layers.
  2. Consume it on a transport without BWE (no custom preferredLayers - expect to consume best available layer). E.g. plain transport which connects to ffmpeg to record video.
  3. Make the encoder stop the top spatial layer (e.g. cap sender bitrate via RTCRtpEncodingParameters.maxBitrate).
  4. Consumer output goes black; no packets are forwarded.

Expected:
consumer falls back to the highest still-active spatial layer;

Actual:
target stays on the stopped layer; in K-SVC every remaining packet is dropped.

Workaround:
For my particular use case I can probably use pipe transport and forward everything verbatim.

Likely root cause

When the top spatial layer of VP9 SVC stops, the sequence stays continuous and no packet loss happen, the producer's RtpStreamRecv score does not change and SvcConsumer::MayChangeLayers() is never triggered.
It normally runs on producer-score changes or on BWE bitrate-allocation events, but on a transport without BWE (e.g. PlainTransport, or any consumer with no transport-wide-cc negotiated) there's no BWE timer to call it either. So RecalculateTargetLayers() never re-runs and the target stays on the missing layer.

Activity

  1. ibc commented on Jun 4, 2026

    @ibc
    Member

    The rationale is correct. I will come back to this next week.

  2. ibc commented on Jun 15, 2026

    @ibc
    Member

    So the problem is that in K-SVC each spatial layer is a like a separate stream, however we don't have a mechanism to track the status of the spatial layers of the producer and notify the consumers about it. This will take some time but we'll address this.

  3. ibc commented on Sep 14, 2026

    @ibc
    Member

    Steps to reproduce in the mediasoup demo

  4. ibc commented on Sep 14, 2026

    @ibc
    Member

    PR here: #1924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions