CameraLiveStream-Schema
Nest Cam (alt)
sdm.devices.traits.CameraLiveStream
Dieses Attribut gehört zu allen Geräten, die Livestreaming unterstützen.
Felder
Feld | Beschreibung | Datentyp |
---|---|---|
maxVideoResolution |
Maximale Auflösung des Video-Livestreams. | VideoResolution |
videoCodecs |
Für den Livestream unterstützte Videocodecs. | array(string) Value: ["H264"] |
audioCodecs |
Für den Livestream unterstützte Audio-Codecs. | array(string) Wert: ["AAC"] |
supportedProtocols |
Vom Gerät unterstützte Streamingprotokolle. Der Wert dieses Felds gibt an, welche Befehle für das Gerät unterstützt werden. Wenn dieses Feld beispielsweise WEB_RTC enthält, werden nur WEB_RTC-Befehle unterstützt. | array(string) Value: ["RTSP", "WEB_RTC"] |
VideoResolution (maxVideoResolution)
Feld | Beschreibung | Datentyp |
---|---|---|
width |
Maximale Breite der Bildauflösung. Kann auch als Abfrageparameter in der Download-URL verwendet werden. | int32 Beispiel: 640 |
height |
Maximale Höhe der Bildauflösung. Kann auch als Abfrageparameter in der Download-URL verwendet werden. | int32 Beispiel: 480 |
Beispiel für GET-Anfrage und -Antwort
Anfrage
GET /enterprises/project-id/devices/device-id
Antwort
{
"name" : "enterprises/project-id/devices/device-id",
"traits" : {
"sdm.devices.traits.CameraLiveStream
" : {
"maxVideoResolution" : {
"width" : 640,
"height" : 480
},
"videoCodecs" : ["H264"],
"audioCodecs" : ["AAC"],
"supportedProtocols" : ["WEB_RTC"]
}
}
}
Befehle
GenerateRtspStream
Nest Cam (alt)Fordern Sie ein Token an, um auf eine RTSP-Livestream-URL zuzugreifen.
RTSP-Livestream-URLs können nicht zwischen Clients geteilt werden. Eine Stream-URL kann jeweils nur von einem Client verwendet werden. Wenn mehrere Clients gleichzeitig von derselben Kamera streamen möchten, müssen für jeden einzelnen Client RTSP-Befehle gesendet werden und jeder einzelne Client muss seine eigene Stream-URL verwenden.
GenerateRtspStream-Anfrage und -Antwort
Anfrage
POST /enterprises/project-id/devices/device-id:executeCommand
{
"command" : "sdm.devices.commands.CameraLiveStream.GenerateRtspStream
",
"params" : {}
}
Antwort
{ "results" : { "streamUrls" : { "rtspUrl" : "rtsps://someurl.com/CjY5Y3VKaTZwR3o4Y19YbTVfMF...?auth=g.0.streamingToken" }, "streamExtensionToken" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF...", "streamToken" : "g.0.streamingToken", "expiresAt" : "2018-01-04T18:30:00.000Z" } }
Antwortfelder für GenerateRtspStream
Feld | Beschreibung | Datentyp |
---|---|---|
streamUrls |
Karte mit RTSP-Livestream-URLs. | object |
streamExtensionToken |
Token zum Verlängern des streamToken für einen RTSP-Livestream. |
string Beispiel: „CjY5Y3VKaTZwR3o4Y19YbTVfMF...“ |
streamToken |
Token für den Zugriff auf einen RTSP-Livestream. | string Beispiel: „g.0.streamingToken“ |
expiresAt |
Zeitpunkt, zu dem sowohl streamExtensionToken als auch streamToken ablaufen, im RFC 3339-Format. |
string Beispiel: „2018-01-04T18:30:00.000Z“ |
ExtendRtspStream
Nest Cam (alt)Fordern Sie ein neues RTSP-Livestream-URL-Zugriffstoken an, um ein gültiges RTSP-Zugriffstoken zu ersetzen, bevor es abläuft. Dies wird auch verwendet, um ein gültiges RTSP-Token aus einer vorherigen ExtendRtspStream-Befehlsanfrage zu ersetzen.
Livestream-Sitzungen der Kamera sind nur 5 Minuten lang gültig. Wenn Sie die Lebensdauer eines Livestreams verlängern müssen, verwenden Sie den entsprechenden ExtendFormatStream-Befehl des CameraLiveStream -Traits für das von Ihnen generierte Streamformat.
ExtendRtspStream-Anfrage und -Antwort
Anfrage
POST /enterprises/project-id/devices/device-id:executeCommand
{
"command" : "sdm.devices.commands.CameraLiveStream.ExtendRtspStream
",
"params" : {
"streamExtensionToken" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."
}
}
Antwort
{ "results" : { "streamExtensionToken" : "dGNUlTU2CjY5Y3VKaTZwR3o4Y1...", "streamToken" : "g.0.newStreamingToken", "expiresAt" : "2018-01-04T18:30:00.000Z" } }
Felder der ExtendRtspStream-Anfrage
Feld | Beschreibung | Datentyp |
---|---|---|
streamExtensionToken |
Token, das zum Anfordern einer Verlängerung des RTSP-Streaming-Tokens verwendet werden soll. | string Beispiel: „CjY5Y3VKaTZwR3o4Y19YbTVfMF...“ |
Antwortfelder für ExtendRtspStream
Feld | Beschreibung | Datentyp |
---|---|---|
streamExtensionToken |
Token zum Ansehen eines vorhandenen RTSP-Livestreams und zum Anfordern einer Verlängerung des Streaming-Tokens. | string Beispiel: „dGNUlTU2CjY5Y3VKaTZwR3o4Y1...“ |
streamToken |
Neues Token für den Zugriff auf einen vorhandenen RTSP-Livestream. | string Beispiel: „g.0.newStreamingToken“ |
expiresAt |
Zeitpunkt, zu dem sowohl streamExtensionToken als auch streamToken ablaufen, im RFC 3339-Format. |
string Beispiel: „2018-01-04T18:30:00.000Z“ |
StopRtspStream
Nest Cam (alt)Macht ein gültiges RTSP-Zugriffstoken ungültig und beendet den RTSP-Livestream, der mit diesem Zugriffstoken verknüpft ist.
Anfrage und Antwort für StopRtspStream
Anfrage
POST /enterprises/project-id/devices/device-id:executeCommand
{
"command" : "sdm.devices.commands.CameraLiveStream.StopRtspStream
",
"params" : {
"streamExtensionToken" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."
}
}
Antwort
{}
Anfragefelder für StopRtspStream
Feld | Beschreibung | Datentyp |
---|---|---|
streamExtensionToken |
Token zum Ungültigmachen eines vorhandenen RTSP-Livestreams. | string Beispiel: „CjY5Y3VKaTZwR3o4Y19YbTVfMF...“ |
GenerateWebRtcStream
Nest Cam (alt)WebRTC-Livestream für ein Gerät generieren
GenerateWebRtcStream-Anfrage und -Antwort
Anfrage
POST /enterprises/project-id/devices/device-id:executeCommand
{
"command" : "sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream
",
"params" : {
"offerSdp" : "offerSdp"
}
}
Antwort
{ "results" : { "answerSdp" : "answerSdp", "expiresAt" : "2020-01-04T18:30:00.000Z", "mediaSessionId" : "5TbN9Y7jsz58_2sX5Pnfn-R81M..." } }
Anfragefelder für „GenerateWebRtcStream“
Wir empfehlen, sich das Web Application Sample anzusehen, um zu erfahren, wie Sie einen erfolgreichen Livestream erstellen. In diesem Beispiel wird ein gültiges offerSdp
generiert, das alle Einschränkungen für SDP-Angebote für Nest-Kameras erfüllt.
Ein SDP-Angebot für Nest-Kameras muss die folgenden Einschränkungen erfüllen:
- Nur das Unified-Format wird unterstützt. Plan B wird nicht unterstützt.
- Alle Media-Zeilen (
m=
) müssen im Angebot vorhanden sein und in dieser Reihenfolge angegeben werden:- Audio
- Video
- Anwendung
- Trickle ICE wird unterstützt, ist aber nicht erforderlich.
- Für Audio wird nur der Opus-Codec unterstützt.
- Die Audioeinstellung muss auf
a=recvonly
(nur empfangen) festgelegt sein. - Das Angebot muss mit einem Zeilenumbruchzeichen (entweder
\r\n
oder\n
) enden.
Beispiel für ein gültiges Angebot
Nicht formatiert:
v=0\r\no=- 2214114893783582286 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 103 104 9 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:6ReD\r\na=ice-pwd:QBmcZYd/t+InpMVkxQEEXnE4\r\na=ice-options:trickle\r\na=fingerprint:sha-256 DD:7E:6F:CD:B8:13:4E:37:D2:92:6D:8E:30:FB:FE:13:29:C9:F8:FD:78:0B:C4:59:42:61:BC:CF:02:91:6B:3C\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=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:63 red/48000/2\r\na=fmtp:63 111/111\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:9 G722/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 100 101 122 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116 37\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:6ReD\r\na=ice-pwd:QBmcZYd/t+InpMVkxQEEXnE4\r\na=ice-options:trickle\r\na=fingerprint:sha-256 DD:7E:6F:CD:B8:13:4E:37:D2:92:6D:8E:30:FB:FE:13:29:C9:F8:FD:78:0B:C4:59:42:61:BC:CF:02:91:6B:3C\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:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:6 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:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:11 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=fmtp:98 profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 VP9/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 profile-id=2\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:122 VP9/90000\r\na=rtcp-fb:122 goog-remb\r\na=rtcp-fb:122 transport-cc\r\na=rtcp-fb:122 ccm fir\r\na=rtcp-fb:122 nack\r\na=rtcp-fb:122 nack pli\r\na=fmtp:122 profile-id=1\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:121 rtx/90000\r\na=fmtp:121 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 apt=127\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:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 transport-cc\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\r\na=rtpmap:35 AV1/90000\r\na=rtcp-fb:35 goog-remb\r\na=rtcp-fb:35 transport-cc\r\na=rtcp-fb:35 ccm fir\r\na=rtcp-fb:35 nack\r\na=rtcp-fb:35 nack pli\r\na=rtpmap:36 rtx/90000\r\na=fmtp:36 apt=35\r\na=rtpmap:124 H264/90000\r\na=rtcp-fb:124 goog-remb\r\na=rtcp-fb:124 transport-cc\r\na=rtcp-fb:124 ccm fir\r\na=rtcp-fb:124 nack\r\na=rtcp-fb:124 nack pli\r\na=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032\r\na=rtpmap:119 rtx/90000\r\na=fmtp:119 apt=124\r\na=rtpmap:123 H264/90000\r\na=rtcp-fb:123 goog-remb\r\na=rtcp-fb:123 transport-cc\r\na=rtcp-fb:123 ccm fir\r\na=rtcp-fb:123 nack\r\na=rtcp-fb:123 nack pli\r\na=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032\r\na=rtpmap:118 rtx/90000\r\na=fmtp:118 apt=123\r\na=rtpmap:114 red/90000\r\na=rtpmap:115 rtx/90000\r\na=fmtp:115 apt=114\r\na=rtpmap:116 ulpfec/90000\r\na=rtpmap:37 flexfec-03/90000\r\na=rtcp-fb:37 goog-remb\r\na=rtcp-fb:37 transport-cc\r\na=fmtp:37 repair-window=10000000\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:6ReD\r\na=ice-pwd:QBmcZYd/t+InpMVkxQEEXnE4\r\na=ice-options:trickle\r\na=fingerprint:sha-256 DD:7E:6F:CD:B8:13:4E:37:D2:92:6D:8E:30:FB:FE:13:29:C9:F8:FD:78:0B:C4:59:42:61:BC:CF:02:91:6B:3C\r\na=setup:actpass\r\na=mid:2\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n
Formatiert:
v=0 o=- 2214114893783582286 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 1 2 a=extmap-allow-mixed a=msid-semantic: WMS m=audio 9 UDP/TLS/RTP/SAVPF 111 63 103 104 9 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:6ReD a=ice-pwd:QBmcZYd/t+InpMVkxQEEXnE4 a=ice-options:trickle a=fingerprint:sha-256 DD:7E:6F:CD:B8:13:4E:37:D2:92:6D:8E:30:FB:FE:13:29:C9:F8:FD:78:0B:C4:59:42:61:BC:CF:02:91:6B:3C 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=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:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/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 100 101 122 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116 37 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:6ReD a=ice-pwd:QBmcZYd/t+InpMVkxQEEXnE4 a=ice-options:trickle a=fingerprint:sha-256 DD:7E:6F:CD:B8:13:4E:37:D2:92:6D:8E:30:FB:FE:13:29:C9:F8:FD:78:0B:C4:59:42:61:BC:CF:02:91:6B:3C 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:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay a=extmap:6 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:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id a=extmap:11 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=fmtp:98 profile-id=0 a=rtpmap:99 rtx/90000 a=fmtp:99 apt=98 a=rtpmap:100 VP9/90000 a=rtcp-fb:100 goog-remb a=rtcp-fb:100 transport-cc a=rtcp-fb:100 ccm fir a=rtcp-fb:100 nack a=rtcp-fb:100 nack pli a=fmtp:100 profile-id=2 a=rtpmap:101 rtx/90000 a=fmtp:101 apt=100 a=rtpmap:122 VP9/90000 a=rtcp-fb:122 goog-remb a=rtcp-fb:122 transport-cc a=rtcp-fb:122 ccm fir a=rtcp-fb:122 nack a=rtcp-fb:122 nack pli a=fmtp:122 profile-id=1 a=rtpmap:102 H264/90000 a=rtcp-fb:102 goog-remb a=rtcp-fb:102 transport-cc a=rtcp-fb:102 ccm fir a=rtcp-fb:102 nack a=rtcp-fb:102 nack pli a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f a=rtpmap:121 rtx/90000 a=fmtp:121 apt=102 a=rtpmap:127 H264/90000 a=rtcp-fb:127 goog-remb a=rtcp-fb:127 transport-cc a=rtcp-fb:127 ccm fir a=rtcp-fb:127 nack a=rtcp-fb:127 nack pli a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f a=rtpmap:120 rtx/90000 a=fmtp:120 apt=127 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:107 rtx/90000 a=fmtp:107 apt=125 a=rtpmap:108 H264/90000 a=rtcp-fb:108 goog-remb a=rtcp-fb:108 transport-cc a=rtcp-fb:108 ccm fir a=rtcp-fb:108 nack a=rtcp-fb:108 nack pli a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f a=rtpmap:109 rtx/90000 a=fmtp:109 apt=108 a=rtpmap:35 AV1/90000 a=rtcp-fb:35 goog-remb a=rtcp-fb:35 transport-cc a=rtcp-fb:35 ccm fir a=rtcp-fb:35 nack a=rtcp-fb:35 nack pli a=rtpmap:36 rtx/90000 a=fmtp:36 apt=35 a=rtpmap:124 H264/90000 a=rtcp-fb:124 goog-remb a=rtcp-fb:124 transport-cc a=rtcp-fb:124 ccm fir a=rtcp-fb:124 nack a=rtcp-fb:124 nack pli a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032 a=rtpmap:119 rtx/90000 a=fmtp:119 apt=124 a=rtpmap:123 H264/90000 a=rtcp-fb:123 goog-remb a=rtcp-fb:123 transport-cc a=rtcp-fb:123 ccm fir a=rtcp-fb:123 nack a=rtcp-fb:123 nack pli a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032 a=rtpmap:118 rtx/90000 a=fmtp:118 apt=123 a=rtpmap:114 red/90000 a=rtpmap:115 rtx/90000 a=fmtp:115 apt=114 a=rtpmap:116 ulpfec/90000 a=rtpmap:37 flexfec-03/90000 a=rtcp-fb:37 goog-remb a=rtcp-fb:37 transport-cc a=fmtp:37 repair-window=10000000 m=application 9 UDP/DTLS/SCTP webrtc-datachannel c=IN IP4 0.0.0.0 a=ice-ufrag:6ReD a=ice-pwd:QBmcZYd/t+InpMVkxQEEXnE4 a=ice-options:trickle a=fingerprint:sha-256 DD:7E:6F:CD:B8:13:4E:37:D2:92:6D:8E:30:FB:FE:13:29:C9:F8:FD:78:0B:C4:59:42:61:BC:CF:02:91:6B:3C a=setup:actpass a=mid:2 a=sctp-port:5000 a=max-message-size:262144
Feld | Beschreibung | Datentyp |
---|---|---|
offerSdp |
Ein SDP-Angebot, das für das lokale Gerät spezifisch ist, auf dem der WebRTC-Livestream angezeigt wird. | string Beispiel: „offerSdp“ |
Antwortfelder für „GenerateWebRtcStream“
Die answerSdp
muss innerhalb von 30 Sekunden nach Erhalt der Antwort verwendet werden, um den Livestream zu generieren. Andernfalls läuft sie ab. Wenn es abläuft, führen Sie den Befehl GenerateWebRtcStream noch einmal aus, um ein neues answerSdp
zu erhalten.
Achten Sie beim Öffnen von WebRTC-Channels für den Livestream darauf, dass Sie sowohl einen Daten- als auch einen Video-Channel erstellen.
Feld | Beschreibung | Datentyp |
---|---|---|
answerSdp |
Eine SDP-Antwort, die mit dem lokalen Gerät verwendet werden soll, auf dem der WebRTC-Livestream angezeigt wird. | string Beispiel: „answerSdp“ |
expiresAt |
Zeitpunkt, zu dem der Zugriff auf den WebRTC-Livestream abläuft, im RFC 3339-Format. | string Beispiel: „2020-01-04T18:30:00.000Z“ |
mediaSessionId |
Media-Sitzungs-ID des generierten WebRTC-Livestreams. | string Beispiel: „5TbN9Y7jsz58_2sX5Pnfn-R81M...“ |
ExtendWebRtcStream
Nest Cam (alt)Fordern Sie an, dass der Zugriff auf einen bestehenden WebRTC-Livestream verlängert wird, bevor er abläuft.
Ein WebRTC-Stream kann nur auf kabelgebundenen Kameras verlängert werden. Eine akkubetriebene Kamera gilt als kabelgebunden, wenn sie zum Aufladen angeschlossen ist. Wenn die Kamera mit Akku betrieben wird, wird eine Anfrage zum Verlängern eines aktiven WebRTC-Streams ignoriert.
Livestream-Sitzungen der Kamera sind nur 5 Minuten lang gültig. Wenn Sie die Lebensdauer eines Livestreams verlängern müssen, verwenden Sie den entsprechenden ExtendFormatStream-Befehl des CameraLiveStream -Traits für das von Ihnen generierte Streamformat.
ExtendWebRtcStream-Anfrage und ‑Antwort
Anfrage
POST /enterprises/project-id/devices/device-id:executeCommand
{
"command" : "sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream
",
"params" : {
"mediaSessionId" : "5TbN9Y7jsz58_2sX5Pnfn-R81M..."
}
}
Antwort
{ "results" : { "expiresAt" : "2018-01-04T18:30:00.000Z", "mediaSessionId" : "5TbN9Y7jsz58_2sX5Pnfn-R81M..." } }
Felder der ExtendWebRtcStream-Anfrage
Feld | Beschreibung | Datentyp |
---|---|---|
mediaSessionId |
Media-Sitzungs-ID des WebRTC-Livestreams, der verlängert werden soll. | string Beispiel: „5TbN9Y7jsz58_2sX5Pnfn-R81M...“ |
Antwortfelder für ExtendWebRtcStream
Feld | Beschreibung | Datentyp |
---|---|---|
expiresAt |
Die neue Zeit, zu der der Zugriff auf den WebRTC-Livestream abläuft, im RFC 3339-Format. | string Beispiel: „2018-01-04T18:30:00.000Z“ |
mediaSessionId |
Media-Sitzungs-ID des WebRTC-Livestreams, der verlängert wurde. | string Beispiel: „5TbN9Y7jsz58_2sX5Pnfn-R81M...“ |
StopWebRtcStream
Nest Cam (alt)Macht eine gültige WebRTC-Mediensitzung ungültig und beendet den mit dieser Sitzung verknüpften WebRTC-Livestream.
StopWebRtcStream-Anfrage und ‑Antwort
Anfrage
POST /enterprises/project-id/devices/device-id:executeCommand
{
"command" : "sdm.devices.commands.CameraLiveStream.StopWebRtcStream
",
"params" : {
"mediaSessionId" : "5TbN9Y7jsz58_2sX5Pnfn-R81M..."
}
}
Antwort
{}
Anfragefelder für StopWebRtcStream
Feld | Beschreibung | Datentyp |
---|---|---|
mediaSessionId |
Media-Sitzungs-ID des WebRTC-Livestreams, der beendet werden soll. | string Beispiel: „5TbN9Y7jsz58_2sX5Pnfn-R81M...“ |
Fehler
Die folgenden Fehlercodes können in Bezug auf dieses Attribut zurückgegeben werden:
Fehlermeldung | RPC | Fehlerbehebung |
---|---|---|
Die Kamera ist für das Streaming nicht verfügbar. | FAILED_PRECONDITION |
Die Kamera ist entweder offline oder aufgrund eines technischen Problems nicht für das Streaming verfügbar. |
Der Befehl wird für die Türklingel nicht unterstützt. | FAILED_PRECONDITION |
Ein WebRTC-Stream kann bei akkubetriebenen Türklingeln nicht verlängert werden. Wenn ein Stream auf einer Türklingel über die ursprüngliche Sitzungslänge hinaus angesehen werden soll, beenden Sie den vorhandenen Stream und generieren Sie einen neuen. |
Berechtigung verweigert. | PERMISSION_DENIED |
Der user hat dem developernicht die entsprechenden Berechtigungen auf Geräteebene im Partner Connections Manager (PCM) erteilt, die zum Ausführen eines Befehls erforderlich sind. Beim Generieren eines WebRTC-Livestreams kann dieser Fehler auch bedeuten, dass die Audioeinstellung im offerSdp falsch ist. |
Eine vollständige Liste der API-Fehlercodes finden Sie in der API-Fehlercode-Referenz.