首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >(更新) GenerateWebRtcStream返回400,"sdp_offer包含无效值“。当被送到鸟巢照相机或鸟巢门铃时

(更新) GenerateWebRtcStream返回400,"sdp_offer包含无效值“。当被送到鸟巢照相机或鸟巢门铃时
EN

Stack Overflow用户
提问于 2021-12-23 19:29:19
回答 1查看 215关注 0票数 0

我已经编写了一个Android应用程序,可以从我的巢式摄像机和门铃上播放视频。我有一个有效的访问令牌,可以检索所有嵌套设备的列表。但是,当我向任何设备发送GenerateWebRtcStream时,它都会返回相同的400错误。

我已经证实我的提议:

  1. a=recvonly,也有H264作为可用的视频编解码器。如文件所示
  2. 有一个数据通道(按照另一个解决方案对此问题的建议)。
  3. 在视频流数据之前有音频流数据(如第二个解决方案对此问题的建议)。
  4. 更新的创建了用SdpSemantics.UNIFIED_PLAN初始化的PeerConnection

其他信息:

我的安卓应用程序(几乎完全)是基于这个非常有用的博客。该应用程序在连接到非嵌套相机(即在另一个设备上的自身实例)时工作,因此提供和逻辑在某种程度上是有效的。

关于Nest相机将接受什么服务的信息似乎很少,所以我将生成的报价和命令发布到API中,希望有人对我可能需要更改的内容有一个想法。

在此之前,非常感谢您。

sdpOffer:

代码语言:javascript
复制
v=0
o=- 5150109222623794114 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KQKv
a=ice-pwd:QvV7coYbshMtmKmkqpBno0xz
a=ice-options:trickle renomination
a=fingerprint:sha-256 C2:16:13:A3:80:1A:8E:96:21:98:4B:8C:03:26:93:DE:FA:88:C5:8B:DB:06:62:87:FF:BA:D4:0C:98:2A:3E:C9
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=recvonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 125 100 101 127
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KQKv
a=ice-pwd:QvV7coYbshMtmKmkqpBno0xz
a=ice-options:trickle renomination
a=fingerprint:sha-256 C2:16:13:A3:80:1A:8E:96:21:98:4B:8C:03:26:93:DE:FA:88:C5:8B:DB:06:62:87:FF:BA:D4:0C:98:2A:3E:C9
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:100 red/90000
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:127 ulpfec/90000
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:KQKv
a=ice-pwd:QvV7coYbshMtmKmkqpBno0xz
a=ice-options:trickle renomination
a=fingerprint:sha-256 C2:16:13:A3:80:1A:8E:96:21:98:4B:8C:03:26:93:DE:FA:88:C5:8B:DB:06:62:87:FF:BA:D4:0C:98:2A:3E:C9
a=setup:actpass
a=mid:2
a=sctp-port:5000
a=max-message-size:262144

帖子体:

代码语言:javascript
复制
{
   {
   "command":"sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream",
   "params":{
      "sdpOffer":"v=0\r\no=- 5150109222623794114 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=msid-semantic: WMS\r\nm=audio 9 UDP\/TLS\/RTP\/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:KQKv\r\na=ice-pwd:QvV7coYbshMtmKmkqpBno0xz\r\na=ice-options:trickle renomination\r\na=fingerprint:sha-256 C2:16:13:A3:80:1A:8E:96:21:98:4B:8C:03:26:93:DE:FA:88:C5:8B:DB:06:62:87:FF:BA:D4:0C:98:2A:3E:C9\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/abs-send-time\r\na=extmap:3 http:\/\/www.ietf.org\/id\/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus\/48000\/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC\/16000\r\na=rtpmap:104 ISAC\/32000\r\na=rtpmap:9 G722\/8000\r\na=rtpmap:102 ILBC\/8000\r\na=rtpmap:0 PCMU\/8000\r\na=rtpmap:8 PCMA\/8000\r\na=rtpmap:106 CN\/32000\r\na=rtpmap:105 CN\/16000\r\na=rtpmap:13 CN\/8000\r\na=rtpmap:110 telephone-event\/48000\r\na=rtpmap:112 telephone-event\/32000\r\na=rtpmap:113 telephone-event\/16000\r\na=rtpmap:126 telephone-event\/8000\r\nm=video 9 UDP\/TLS\/RTP\/SAVPF 96 97 98 99 125 100 101 127\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:KQKv\r\na=ice-pwd:QvV7coYbshMtmKmkqpBno0xz\r\na=ice-options:trickle renomination\r\na=fingerprint:sha-256 C2:16:13:A3:80:1A:8E:96:21:98:4B:8C:03:26:93:DE:FA:88:C5:8B:DB:06:62:87:FF:BA:D4:0C:98:2A:3E:C9\r\na=setup:actpass\r\na=mid:1\r\na=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/abs-send-time\r\na=extmap:13 urn:3gpp:video-orientation\r\na=extmap:3 http:\/\/www.ietf.org\/id\/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:12 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/playout-delay\r\na=extmap:11 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/video-content-type\r\na=extmap:7 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/video-timing\r\na=extmap:8 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/color-space\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8\/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx\/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9\/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=rtpmap:99 rtx\/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:125 H264\/90000\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:100 red\/90000\r\na=rtpmap:101 rtx\/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:127 ulpfec\/90000\r\nm=application 9 UDP\/DTLS\/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:KQKv\r\na=ice-pwd:QvV7coYbshMtmKmkqpBno0xz\r\na=ice-options:trickle renomination\r\na=fingerprint:sha-256 C2:16:13:A3:80:1A:8E:96:21:98:4B:8C:03:26:93:DE:FA:88:C5:8B:DB:06:62:87:FF:BA:D4:0C:98:2A:3E:C9\r\na=setup:actpass\r\na=mid:2\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"
   }
}

错误响应:

代码语言:javascript
复制
{
   "error":{
      "code":400,
      "message":"sdp_offer contains an invalid value.",
      "status":"INVALID_ARGUMENT"
   }
}
EN

回答 1

Stack Overflow用户

发布于 2022-02-04 06:58:22

按照@BTGunner的建议在github.com/google/device-access-sample-web-app上运行示例应用程序(再次感谢!),并看到成功的请求是什么样子的。

我提出的提议被接受了。问题是,GenerateWebRtcStream的文档和实现出现了偏差。当前的文档表明,报价描述应该命名为offerSdp (失败)。示例应用程序使用offer_sdp,这将返回一个有效的答案。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70466625

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档