Skip to content

Wrong TWCC extension ID when Pion is sending and some other app is subscribing #3179

@kmansoft

Description

@kmansoft

Your environment.

  • Version:

github.com/pion/interceptor v0.1.40
github.com/pion/webrtc/v4 v4.1.2

  • Browser: Brave 1.80.122 (Official Build) (64-bit) / Chromium: 138.0.7204.157
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context

What did you do?

I'm working on a C++ WebRTC implementation, and right now working on the Subscribe side.

I ran Pion's "whip / whep" sample in the console, and used the provided web page to publish media into Pion.

Then I used my C++ library to subscribe to the feed using http://localhost:8080/whep.

The SDP offer on my - subscribe - side included lines like:

m=video 9 UDP/TLS/RTP/SAVPF 96 97
a=recvonly
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
...
m=audio 9 UDP/TLS/RTP/SAVPF 98 99
a=recvonly
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01

The SDP answer from Pion included:

m=video 9 UDP/TLS/RTP/SAVPF 96 97
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=sendonly
...
m=audio 9 UDP/TLS/RTP/SAVPF 98
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=sendonly

What did you expect?

I was expecting my C++ library subscriber to see that each media packet contains the TWCC extension with ID = 5 (as negotiated) and the global SEQ number.

What happened?

Instead, I see this data with the extension ID = 3, regardless of which extension ID I negotiate on the subscribe side using the SDP. Besides 5, I also tried 14.

More details

I used Chrome's developer tools to see the SDP exchange on the publish side.

And lo and behold, the publisher (the web browser) also uses TWCC on the publishing side, and the negotiated extension ID there is 3.

So it seems that:

  • Pion doesn't strip the publisher's TWCC extension ID as it routes media from the publisher to the subscriber
  • Pion doesn't add its own TWCC sequence even though it negotiated the extension

If I have to add something special to the WHIP-WHEP example to enable TWCC sending please let me know.

But even then, the fact that the publisher's TWCC data is forwarded to the subscriber without any modification is definitely a bug. The subscriber could have negotiated a completely different extension with the same ID ( 3 in my tests ) and the TWCC data there would appear as data corruption.

I would be happy to try to make a fix for this - if someone could provide some pointers. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions