webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

Issue with switching among tracks of same kind, codec & clock rate with ReplaceTrack of RTPSender

Open selvan opened this issue 4 months ago • 1 comments

Your environment.

  • Version: github.com/pion/webrtc/v4 v4.1.1

What did you do?

Creating a local track from a TrackRemote (remoteX),

localX, _ := webrtc.NewTrackLocalStaticRTP(remoteX.Codec().RTPCodecCapability, remoteX.ID(), remoteX.StreamID(), webrtc.WithRTPStreamID(remoteX.RID()))

Creating a another local track from a another TrackRemote (remoteY),

localY, _ := webrtc.NewTrackLocalStaticRTP(remoteY.Codec().RTPCodecCapability, remoteY.ID(), remoteY.StreamID(), webrtc.WithRTPStreamID(remoteY.RID()))

remoteX and remoteY are of same kind (Audio), codec type (VP8) and clock rate (90000)

Trying to replace localX with localY on the RTPSender with ReplaceTrack method.

What did you expect?

The remote peer attached to the RTPSender should receive switched video tracks when localX is replaced with localY & vice versa.

What happened?

The remote peer's video just freeze, when trying to replace localX with localY on the RTPSender.

selvan avatar Jun 09 '25 04:06 selvan