Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for abs-send-time - closes #1081 #1084

Merged
merged 9 commits into from Mar 21, 2024

Conversation

theimowski
Copy link
Contributor

@theimowski theimowski commented Mar 11, 2024

  • added a=extmap: http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time to SDP extension headers
  • added a=rtcp-fb goog-remb for all media tracks to SDP
  • the header extension is added only when remote track supports it
  • for now the method can only accept a single extension to be added, but could be made more generic for subsequent extensions
  • fixed typo ATTRIBUE in one of the consts

closes #1081

@sipsorcery sipsorcery merged commit 1c1ca9f into sipsorcery-org:master Mar 21, 2024
1 check failed
@theimowski
Copy link
Contributor Author

Thanks! When can we expect a new NuGet version released?

@ChristopheI
Copy link
Collaborator

Thanks a lot for this PR.
Could you please share an example to use it ?
Thx

@theimowski
Copy link
Contributor Author

The abs-send-time extension will apply itself as long as the receiver accepts it.

It will be added to every RTP packet that is send from SIPSorcery sender, in our example it happens when we send Video:

rtcPeerConnection.SendVideo(rtpDuration, sample)

It helps the receiver (in our case web browser) calculate REMB properly, and then on SIPSorcery sender side we can subscribe to REMB events:

  let onReceiveReport: Action<Net.IPEndPoint, SDPMediaTypesEnum, RTCPCompoundPacket> =
    Action<_, _, _>(fun _ _ packet ->
      if not (isNull packet.Feedback) && not (isNull packet.Feedback.Header) then
        let feedback = packet.Feedback
        let header = packet.Feedback.Header

        match header.PacketType, header.PayloadFeedbackMessageType with
        | RTCPReportTypesEnum.PSFB, PSFBFeedbackTypesEnum.AFB ->
          let exponent = feedback.BitrateExp
          let mantissa = feedback.BitrateMantissa
          // This is what REMB tells us the maximum bitrate should be
          let rembMaxBitrateInBitsPerSecond = pown 2u (int exponent) * mantissa
          onREMB.Trigger rembMaxBitrateInBitsPerSecond
        | RTCPReportTypesEnum.PSFB, PSFBFeedbackTypesEnum.PLI -> onPLI.Trigger()
        | _ -> ())

  ...

  rtcPeerConnection.add_OnReceiveReport onReceiveReport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for abs-send-time (willing to contribute)
3 participants