Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
  • Guides
  • Device capabilities & events
  • API reference
    • Public conventions
    • Development specification
    • accessToken: Get administrator token
    • API request example
    • Return codes
    • Interface call limits
    • Account docking
    • Device APIs
    • Device live broadcast
      • batchModifyLivePlan
      • bindDeviceLive
      • createDeviceFlvLive
      • createDeviceRecordHls
      • createDeviceRtmpLive
      • deleteDeviceFlvLive
      • deleteDeviceRtmpLive
      • getLiveStreamInfo
      • liveList
      • modifyLivePlan
      • modifyLivePlanStatus
      • queryDeviceFlvLive
      • queryDeviceRtmpLive
      • queryLiveStatus
      • unbindLive
    • Push configuration
    • Cloud storage service
    • Resource pool quota
    • Legacy APIs (deprecated)
  • SDK and tools
  • Solutions
  • Platform and support
On this page
Function details
Request address
Request format
Incoming parameter description
Sample input
Return data field description
Sample output
Error codes
Related

getLiveStreamInfo (getLiveStreamInfo: Query live broadcast information created under the device channel)

getLiveStreamInfo: getLiveStreamInfo: Query live broadcast information created under the device channel

Function details

Obtain the live broadcast address and live broadcast status according to the device serial number and channel number.

Remarks:

You need to create a live broadcast address through bindDeviceLive first, otherwise the live broadcast information cannot be obtained.

Four types of live broadcast addresses can be obtained: HD main stream, SD sub stream, HTTP, and HTTPS.

Request address

https://openapi-[DataCenter].easy4ip.com/openapi/getLiveStreamInfo

Request format

HTTP POST. JSON body layout: Request conventions. Sign with Signature.

Incoming parameter description

Parameter nameParameter typeRequired or notDefault valueLegal valueParameter description
tokenStringYesAdministrator accessToken
deviceIdStringYesDevice serial number
channelIdStringYesChannel ID

Sample input

{
 "system":{
 "ver":"1.0",
 "appId":"lcdxxxxxxxxx",
 "sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
 "time":1603366946,
 "nonce":"2e84717c-0f22-4424-8afe-19bab0d6d606"
 },
 "id":"051824b1-9655-4755-9cc2-adcc9ab5fef1",
 "params":{
 "deviceId":"TESTQWERXXXX",
 "channelId":"0",
 "token":"At_00000ad9e6e87f0142eb92e207aec46a"
 }
}

Return data field description

FieldTypeDescription
streams.hlsStringLive stream hls access address
streams.streamIdIntegerStream type (0: HD main stream; 1: SD secondary stream) (when the live broadcast address is generated by the rtsp source, this field is not available)
streams.statusStringStream output status:1when on;10when off (same semantics as queryLiveStatus)
streams.liveTokenStringtoken for live broadcast

Sample output

{
 "result":{
 "msg":"The operation was successful.",
 "code":"0",
 "data":{
 "streams":[
 {
 "streamId":1,
 "liveToken":"57877dd6774f4cbeb657568be0b7a621",
 "hls":"http://cmgw-vpc.lechange.com:8888/LCO/TESTQWERXXXX/0/1/20201022T113914/dev_TESTQWERXXXX_20201022T113914.m3u8",
 "status":"1"
 },
 {
 "streamId":0,
 "liveToken":"57877dd6774f4cbeb657568be0b7a621",
 "hls":"http://cmgw-vpc.lechange.com:8888/LCO/TESTQWERXXXX/0/0/20201022T113914/dev_TESTQWERXXXX_20201022T113914.m3u8",
 "status":"1"
 },
 {
 "streamId":1,
 "liveToken":"57877dd6774f4cbeb657568be0b7a621",
 "hls":"https://cmgw-vpc.lechange.com:8890/LCO/TESTQWERXXXX/0/1/20201022T113914/dev_TESTQWERXXXX_20201022T113914.m3u8?proto=https",
 "status":"10"
 },
 {
 "streamId":0,
 "liveToken":"57877dd6774f4cbeb657568be0b7a621",
 "hls":"https://cmgw-vpc.lechange.com:8890/LCO/TESTQWERXXXX/0/0/20201022T113914/dev_TESTQWERXXXX_20201022T113914.m3u8?proto=https",
 "status":"10"
 }
 ]
 }
 },
 "id":"051824b1-9655-4755-9cc2-adcc9ab5fef1"
}

Error codes

This method may return the codes below. See Return codes and Capability errors for the full catalog.

Gateway and auth (SN / TK / OP)

CodeMeaningNext step
SN1001Signature errorCheck sign per Development specification
TK1002Token invalid or expiredRefresh accessToken
OP1002Missing required parameterAdd required fields
OP1003Invalid parameterMatch this page’s parameter table
OP1009Permission deniedCheck token and device bind/share grants
OP1013Total call limit exceededReduce call rate
OP1014Daily per-interface limit exceededSee Interface call limits
DV1007Device offlineWait until the device is online

See Return codes · OP/SN/TK for the full catalog.

Sub-accounts (SUB)

CodeMeaningNext step
SUB1001–SUB1002Sub-account lacks API permissionUpdate policy via addPolicy
SUB1005Sub-account token expiredRefresh subAccountToken
SUB1006No device grant for sub-accountCheck Resource and device serial
SUB1008Sub-account not bound to appCreate and bind the sub-account first

See Return codes · SUB.

Device access and channels (DV10xx)

CodeMeaningNext step
DV1007Device offline or timeoutWait for the device to come online
DV1009Device busyRetry later
DV1012Insufficient share/grant permissionCheck sub-account Permission / Resource
DV1019Capability not supportedConfirm model and capability list
DV1020Channel offlineCheck channel status
DV1026Function not supportedUse another API or upgrade firmware
DV1028Not bound or channel missingVerify deviceId / channelId

See Return codes · DV.

Live binding (LV)

CodeMeaningNext step
LV1001Live already existsUnbind via unbindLive or use another source
:---:---:---
LV1002Live does not existCreate the live plan first
:---:---:---
LV1005Live info does not existVerify live id
:---:---:---
LV1006Same RTSP source can bind only once per dayRetry the next day
:---:---:---
LV1008Real-name verification requiredComplete profile in the Open Platform console
:---:---:---
LV1020Live is bound and cannot be deletedUnbind first
:---:---:---
OP1021Failed to get playback URLCheck live status and plan
:---:---:---
OP1022Cloud decode authorization requiredAuthorize in the app as described in the response

See Return codes · catalog.

Related

  • Development specification
  • API conventions
  • Module index
deleteDeviceRtmpLive
liveList