【问题标题】:SDP Offer WebRTCSDP 提供 WebRTC
【发布时间】:2022-01-18 10:23:02
【问题描述】:

我正在尝试在仅支持 WebRTC 流的 Nest Battery Cam 上执行 sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream 命令。请求应如下所示:

POST /enterprises/$project-id/devices/$device-id:executeCommand
{
  "command" : "sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream",
  "params" : {
    "offerSdp" : "$offerSdp"
  }
}

根据另一个已回答的问题,以下代码会生成正确的 SDP 报价,该报价被 Google 接受:

const myPeerConnection = new RTCPeerConnection

myPeerConnection.createDataChannel("dataSendChannel");

myPeerConnection.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0}).then(function(offer) {
    return myPeerConnection.setLocalDescription(offer);
  })
  .then(function() {
    console.log(myPeerConnection.localDescription.sdp + "\n");
  })
  .catch(function(reason) {
    console.log("An error occurred, so handle the failure to connect");
  });

有谁知道如何从最后一个代码“生成”要插入第一个代码的 $offerSdp?

【问题讨论】:

    标签: webrtc nest sdp


    【解决方案1】:

    我已使用this online tool 并在控制台中获得了报价。

    生成了以下报价:

    a=rtcp-mux
    a=rtcp-rsize
    a=rtpmap:120 VP8/90000
    a=rtpmap:124 rtx/90000
    a=rtpmap:121 VP9/90000
    a=rtpmap:125 rtx/90000
    a=rtpmap:126 H264/90000
    a=rtpmap:127 rtx/90000
    a=rtpmap:97 H264/90000
    a=rtpmap:98 rtx/90000
    a=setup:actpass
    a=ssrc:3270553860 cname:{6d4a9509-da38-4be5-b6c0-e1b61b24de50}
    m=application 9 UDP/DTLS/SCTP webrtc-datachannel
    c=IN IP4 0.0.0.0
    a=sendrecv
    a=ice-pwd:df7be166f74ae8480f36d9b634908922
    a=ice-ufrag:da4e0cc3
    a=mid:2
    a=setup:actpass
    a=sctp-port:5000
    a=max-message-size:1073741823
    

    【讨论】:

      猜你喜欢
      • 2017-06-22
      • 2021-04-03
      • 2018-12-28
      • 2017-06-26
      • 1970-01-01
      • 2021-06-13
      • 2017-11-14
      • 2019-06-07
      • 1970-01-01
      相关资源
      最近更新 更多