我试图在一个只支持sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream流的Nest电池凸轮上执行WebRTC命令。请求应如下:
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吗?
发布于 2021-12-16 09:58:09
我使用了这个在线工具,并在控制台中得到了报价。
提出了以下提议:
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:1073741823https://stackoverflow.com/questions/70360191
复制相似问题