สคีมา CameraLiveStream

Nest Cam (เดิม) Nest Cam (กลางแจ้งหรือในร่ม, แบบใช้แบตเตอรี่) Nest Cam ที่มีฟลัดไลท์ Nest Cam (แบบใช้ในอาคารและใช้สาย) Nest Hub Max Nest Doorbell (เดิม) Nest Doorbell (แบบใช้แบตเตอรี่) Nest Doorbell (แบบใช้สาย) 

sdm.devices.traits.CameraLiveStream

ลักษณะนี้เป็นของอุปกรณ์ที่รองรับการไลฟ์สด

ช่อง

ช่อง คำอธิบาย ประเภทข้อมูล
maxVideoResolution ความละเอียดสูงสุดของไลฟ์สดวิดีโอ VideoResolution
videoCodecs ตัวแปลงรหัสวิดีโอที่รองรับสำหรับไลฟ์สด array(string)
Value: ["H264"]
audioCodecs ตัวแปลงรหัสเสียงที่รองรับสำหรับไลฟ์สด array(string)
Value: ["AAC"]
supportedProtocols โปรโตคอลการสตรีมที่อุปกรณ์รองรับ ค่าของช่องนี้จะระบุคำสั่งที่อุปกรณ์รองรับ เช่น หากช่องนี้มี WEB_RTC ระบบจะรองรับเฉพาะคำสั่ง WEB_RTC array(string)
Value: ["RTSP", "WEB_RTC"]

VideoResolution (maxVideoResolution)

ช่อง คำอธิบาย ประเภทข้อมูล
width ความกว้างความละเอียดสูงสุดของรูปภาพ นอกจากนี้ยังใช้เป็นพารามิเตอร์การค้นหาใน URL การดาวน์โหลดได้ด้วย int32
Example: 640
height ความสูงความละเอียดสูงสุดของรูปภาพ นอกจากนี้ยังใช้เป็นพารามิเตอร์การค้นหาใน URL การดาวน์โหลดได้ด้วย int32
Example: 480

ตัวอย่างคำขอและการตอบกลับ GET

ส่งคำขอ

GET /enterprises/project-id/devices/device-id

การตอบกลับ

{
  "name" : "enterprises/project-id/devices/device-id",
  "traits" : {
    "sdm.devices.traits.CameraLiveStream" : {
      "maxVideoResolution" : {
        "width" : 640,
        "height" : 480
      },
      "videoCodecs" : ["H264"],
      "audioCodecs" : ["AAC"],
      "supportedProtocols" : ["WEB_RTC"]
    }
  }
}

คำสั่ง

GenerateRtspStream

Nest Cam (เดิม) Nest Hub Max Nest Doorbell (เดิม) 

ขอโทเค็นเพื่อเข้าถึง URL ของสตรีมแบบสด RTSP

คุณจะแชร์ URL ของไลฟ์สด RTSP ระหว่างไคลเอ็นต์ไม่ได้ ไคลเอ็นต์จะใช้ URL ของสตรีมได้ครั้งละ 1 รายการเท่านั้น หากไคลเอ็นต์หลายรายต้องการสตรีมจากกล้องตัวเดียวกันในเวลาเดียวกัน คุณต้องส่งคำสั่ง RTSP สำหรับไคลเอ็นต์แต่ละราย และไคลเอ็นต์แต่ละรายต้องใช้ URL ของสตรีมของตนเอง

คำขอและการตอบกลับ GenerateRtspStream

ส่งคำขอ

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

การตอบกลับ

{
  "results" : {
    "streamUrls" : {
      "rtspUrl" : "rtsps://someurl.com/CjY5Y3VKaTZwR3o4Y19YbTVfMF...?auth=g.0.streamingToken"
    },
    "streamExtensionToken" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF...",
    "streamToken" : "g.0.streamingToken",
    "expiresAt" : "2018-01-04T18:30:00.000Z"
  }
}

ช่องการตอบกลับ GenerateRtspStream

ช่อง คำอธิบาย ประเภทข้อมูล
streamUrls แผนผัง URL ของไลฟ์สด RTSP object
streamExtensionToken โทเค็นที่จะใช้เพื่อขยาย streamToken สำหรับไลฟ์สด RTSP string
Example: "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."
streamToken โทเค็นที่จะใช้เพื่อเข้าถึงไลฟ์สด RTSP string
Example: "g.0.streamingToken"
expiresAt เวลาที่ streamExtensionToken และ streamToken หมดอายุในรูปแบบ RFC 3339 string
Example: "2018-01-04T18:30:00.000Z"

ExtendRtspStream

Nest Cam (เดิม) Nest Hub Max Nest Doorbell (เดิม) 

ขอโทเค็นเพื่อการเข้าถึง URL ของสตรีมไลฟ์สด RTSP ใหม่เพื่อแทนที่โทเค็นเพื่อการเข้าถึง RTSP ที่ถูกต้องก่อนที่จะหมดอายุ นอกจากนี้ยังใช้เพื่อแทนที่โทเค็น RTSP ที่ถูกต้องจากคำขอคำสั่ง ExtendRtspStream ก่อนหน้าด้วย

เซสชันไลฟ์สดของกล้องจะมีอายุเพียง 5 นาที หากต้องการขยายอายุการใช้งานของไลฟ์สด ให้ใช้คำสั่ง ExtendFormatStream ที่เหมาะสมของ ลักษณะ CameraLiveStream สำหรับรูปแบบสตรีมที่คุณสร้าง

คำขอและการตอบกลับ ExtendRtspStream

ส่งคำขอ

POST /enterprises/project-id/devices/device-id:executeCommand
{
  "command" : "sdm.devices.commands.CameraLiveStream.ExtendRtspStream",
  "params" : {
    "streamExtensionToken" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."
  }
}

การตอบกลับ

{
  "results" : {
    "streamExtensionToken" : "dGNUlTU2CjY5Y3VKaTZwR3o4Y1...",
    "streamToken" : "g.0.newStreamingToken",
    "expiresAt" : "2018-01-04T18:30:00.000Z"
  }
}

ช่องคำขอ ExtendRtspStream

ช่อง คำอธิบาย ประเภทข้อมูล
streamExtensionToken โทเค็นที่จะใช้เพื่อขอขยายโทเค็นการสตรีม RTSP string
Example: "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."

ช่องการตอบกลับ ExtendRtspStream

ช่อง คำอธิบาย ประเภทข้อมูล
streamExtensionToken โทเค็นที่จะใช้เพื่อดูไลฟ์สด RTSP ที่มีอยู่และเพื่อขอขยายโทเค็นการสตรีม string
Example: "dGNUlTU2CjY5Y3VKaTZwR3o4Y1..."
streamToken โทเค็นใหม่ที่จะใช้เพื่อเข้าถึงไลฟ์สด RTSP ที่มีอยู่ string
Example: "g.0.newStreamingToken"
expiresAt เวลาที่ streamExtensionToken และ streamToken หมดอายุในรูปแบบ RFC 3339 string
Example: "2018-01-04T18:30:00.000Z"

StopRtspStream

Nest Cam (เดิม) Nest Hub Max Nest Doorbell (เดิม) 

ทำให้โทเค็นเพื่อการเข้าถึง RTSP ที่ถูกต้องไม่ถูกต้องและหยุดไลฟ์สด RTSP ที่เชื่อมโยงกับโทเค็นเพื่อการเข้าถึงดังกล่าว

คำขอและการตอบกลับ StopRtspStream

ส่งคำขอ

POST /enterprises/project-id/devices/device-id:executeCommand
{
  "command" : "sdm.devices.commands.CameraLiveStream.StopRtspStream",
  "params" : {
    "streamExtensionToken" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."
  }
}

การตอบกลับ

{}

ช่องคำขอ StopRtspStream

ช่อง คำอธิบาย ประเภทข้อมูล
streamExtensionToken โทเค็นที่จะใช้เพื่อทำให้ไลฟ์สด RTSP ที่มีอยู่ไม่ถูกต้อง string
Example: "CjY5Y3VKaTZwR3o4Y19YbTVfMF..."

GenerateWebRtcStream

Nest Cam (เดิม) Nest Cam (กลางแจ้งหรือในร่ม, แบบใช้แบตเตอรี่) Nest Cam ที่มีฟลัดไลท์ Nest Cam (แบบใช้ในอาคารและใช้สาย) Nest Doorbell (แบบใช้แบตเตอรี่) Nest Doorbell (แบบใช้สาย) 

สร้างไลฟ์สด WebRTC สำหรับอุปกรณ์

คำขอและการตอบกลับ GenerateWebRtcStream

ส่งคำขอ

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

การตอบกลับ

{
  "results" : {
    "answerSdp" : "answerSdp",
    "expiresAt" : "2020-01-04T18:30:00.000Z",
    "mediaSessionId" : "XnJrcjlfItx05xvNHnrNt4elml..."
  }
}

ช่องคำขอ GenerateWebRtcStream

เราขอแนะนำให้ใช้ตัวอย่างเว็บแอปพลิเคชันเพื่อเรียนรู้วิธีสร้างไลฟ์สดที่สำเร็จ ตัวอย่างนี้ จะสร้าง offerSdp ที่ถูกต้องซึ่งเป็นไปตามข้อจำกัดทั้งหมดของข้อเสนอ SDP สำหรับกล้อง Nest

ข้อเสนอ SDP สำหรับกล้อง Nest ต้องเป็นไปตามข้อจำกัดต่อไปนี้

  • รองรับเฉพาะรูปแบบ Unified ไม่รองรับ Plan B
  • บรรทัดสื่อทั้งหมด (m=) ต้องอยู่ในข้อเสนอและต้องเรียงตามลำดับต่อไปนี้:
    1. เสียง
    2. วิดีโอ
    3. แอปพลิเคชัน
  • รองรับ Trickle ICE แต่ไม่บังคับ
  • รองรับเฉพาะตัวแปลงรหัส Opus สำหรับเสียง
  • การตั้งค่าเสียงต้องตั้งค่าเป็น a=recvonly (รับเท่านั้น)
  • ข้อเสนอต้องลงท้ายด้วยอักขระขึ้นบรรทัดใหม่ \r\n หรือ \n

ดูตัวอย่างข้อเสนอที่ถูกต้อง

ไม่ได้จัดรูปแบบ:

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

จัดรูปแบบแล้ว:

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
ช่อง คำอธิบาย ประเภทข้อมูล
offerSdp ข้อเสนอ SDP ที่เฉพาะเจาะจงกับอุปกรณ์ในเครื่องที่จะแสดงไลฟ์สด WebRTC string
Example: "offerSdp"

ช่องการตอบกลับ GenerateWebRtcStream

คุณต้องใช้ answerSdp เพื่อสร้างไลฟ์สดภายใน 30 วินาทีหลังจากได้รับการตอบกลับ ไม่เช่นนั้นไลฟ์สดจะหมดอายุ หากหมดอายุ ให้เรียกใช้คำสั่ง GenerateWebRtcStream อีกครั้งเพื่อรับ answerSdp ใหม่

เมื่อเปิดช่อง WebRTC สำหรับไลฟ์สด ให้สร้างช่องข้อมูลและช่องวิดีโอด้วย

ช่อง คำอธิบาย ประเภทข้อมูล
answerSdp คำตอบ SDP ที่จะใช้กับอุปกรณ์ในเครื่องที่จะแสดงไลฟ์สด WebRTC string
Example: "answerSdp"
expiresAt เวลาที่การเข้าถึงไลฟ์สด WebRTC หมดอายุในรูปแบบ RFC 3339 string
Example: "2020-01-04T18:30:00.000Z"
mediaSessionId รหัสเซสชันสื่อของไลฟ์สด WebRTC ที่สร้างขึ้น string
Example: "XnJrcjlfItx05xvNHnrNt4elml..."

ExtendWebRtcStream

Nest Cam (เดิม) Nest Cam (กลางแจ้งหรือในร่ม, แบบใช้แบตเตอรี่) Nest Cam ที่มีฟลัดไลท์ Nest Cam (แบบใช้ในอาคารและใช้สาย) Nest Doorbell (แบบใช้สาย)   แบบใช้สาย   

ขอขยายการเข้าถึงไลฟ์สด WebRTC ที่มีอยู่ก่อนที่จะหมดอายุ

คุณจะขยายสตรีม WebRTC ได้เฉพาะในกล้องที่ใช้สายไฟเท่านั้น กล้องที่ใช้แบตเตอรี่จะถือว่าเป็นกล้องที่ใช้สายไฟขณะเสียบปลั๊กเพื่อชาร์จ หากกล้องใช้พลังงานแบตเตอรี่ ระบบจะละเว้นคำขอขยายสตรีม WebRTC ที่ใช้งานอยู่

เซสชันไลฟ์สดของกล้องจะมีอายุเพียง 5 นาที หากต้องการขยายอายุการใช้งานของไลฟ์สด ให้ใช้คำสั่ง ExtendFormatStream ที่เหมาะสมของ ลักษณะ CameraLiveStream สำหรับรูปแบบสตรีมที่คุณสร้าง

คำขอและการตอบกลับ ExtendWebRtcStream

ส่งคำขอ

POST /enterprises/project-id/devices/device-id:executeCommand
{
  "command" : "sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream",
  "params" : {
    "mediaSessionId" : "XnJrcjlfItx05xvNHnrNt4elml..."
  }
}

การตอบกลับ

{
  "results" : {
    "expiresAt" : "2018-01-04T18:30:00.000Z",
    "mediaSessionId" : "XnJrcjlfItx05xvNHnrNt4elml..."
  }
}

ช่องคำขอ ExtendWebRtcStream

ช่อง คำอธิบาย ประเภทข้อมูล
mediaSessionId รหัสเซสชันสื่อของไลฟ์สด WebRTC ที่จะขยาย string
Example: "XnJrcjlfItx05xvNHnrNt4elml..."

ช่องการตอบกลับ ExtendWebRtcStream

ช่อง คำอธิบาย ประเภทข้อมูล
expiresAt เวลาใหม่ที่การเข้าถึงไลฟ์สด WebRTC หมดอายุในรูปแบบ RFC 3339 string
Example: "2018-01-04T18:30:00.000Z"
mediaSessionId รหัสเซสชันสื่อของไลฟ์สด WebRTC ที่ขยาย string
Example: "XnJrcjlfItx05xvNHnrNt4elml..."

StopWebRtcStream

Nest Cam (เดิม) Nest Cam (กลางแจ้งหรือในร่ม, แบบใช้แบตเตอรี่) Nest Cam ที่มีฟลัดไลท์ Nest Cam (แบบใช้ในอาคารและใช้สาย) Nest Doorbell (แบบใช้แบตเตอรี่) Nest Doorbell (แบบใช้สาย) 

ทำให้เซสชันสื่อ WebRTC ที่ถูกต้องไม่ถูกต้องและหยุดไลฟ์สด WebRTC ที่เชื่อมโยงกับเซสชันดังกล่าว

คำขอและการตอบกลับ StopWebRtcStream

ส่งคำขอ

POST /enterprises/project-id/devices/device-id:executeCommand
{
  "command" : "sdm.devices.commands.CameraLiveStream.StopWebRtcStream",
  "params" : {
    "mediaSessionId" : "XnJrcjlfItx05xvNHnrNt4elml..."
  }
}

การตอบกลับ

{}

ช่องคำขอ StopWebRtcStream

ช่อง คำอธิบาย ประเภทข้อมูล
mediaSessionId รหัสเซสชันสื่อของไลฟ์สด WebRTC ที่จะหยุด string
Example: "XnJrcjlfItx05xvNHnrNt4elml..."

ข้อผิดพลาด

ระบบอาจแสดงรหัสข้อผิดพลาดต่อไปนี้ที่เกี่ยวข้องกับลักษณะนี้

ข้อความแสดงข้อผิดพลาด RPC การแก้ปัญหา
กล้องไม่พร้อมใช้งานสำหรับการสตรีม FAILED_PRECONDITION กล้องออฟไลน์หรือไม่พร้อมใช้งานสำหรับการสตรีมเนื่องจากปัญหาทางเทคนิค
ไม่รองรับคำสั่งสำหรับกริ่งประตู FAILED_PRECONDITION คุณจะขยายสตรีม WebRTC ในกริ่งประตูแบบใช้แบตเตอรี่ไม่ได้ หากต้องการดูสตรีมในกริ่งประตูเกินความยาวเซสชันเริ่มต้น ให้หยุดสตรีมที่มีอยู่และสร้างสตรีมใหม่
ปฏิเสธสิทธิ์การใช้งาน PERMISSION_DENIED ไม่ได้ให้สิทธิ์ระดับอุปกรณ์ที่เหมาะสมใน Partner Connections Manager (PCM) ซึ่งจำเป็นต่อการเรียกใช้คำสั่ง เมื่อสร้างไลฟ์สด WebRTC ข้อผิดพลาดนี้อาจหมายความว่าการตั้งค่าเสียงใน offerSdp ไม่ถูกต้อง user developer

ดูรายการรหัสข้อผิดพลาดทั้งหมดของ API ได้ที่ข้อมูลอ้างอิงรหัสข้อผิดพลาดของ API สำหรับ