Set Live Streaming Quality

2022-07-19
No Rating

Live Set Quality

services

Communication method: MQTT

API interface:

PUB Topic: thing/product/#{remote control/airport SN}/services
SUB Topic: thing/product/#{remote control/airport SN}/services_reply

Parameter Description:

  • #{pid}:Refers to the product ID of the gateway device, which is usually expressed by the SN number of the device, and is different for each device. So you need to use a wildcard when the server side subscribes to topic.

Example:

{
    "tid": "d729f59d83194e3eb62340648ca86e4e",
    "bid": "248b7bba35464489ac42eb8e13c6f596",
    "method": "live_set_quality",
    "data": {
        "video_id": "1ZNDH1D0010098/0-39-7/normal-0",
        "video_quality": 4
    }
}

Parameter Description:

  • video_id: ID number of the live video stream. String

    video_id has a format requirement, the specific combination format is aircraft SN / payload and enumeration values for mount locations / payload lens number.

    ​ Example: 1ZNDH1D0010098/0-39-7/normal-0

  • video_quality: Live quality.

    • 0: Auto
    • 1: Smooth
    • 2: Standard Definition
    • 3: High Definition
    • 4: Ultra HD

services_reply

For the message response, the server needs to keep the tid and bid consistent. The client uses these two fields to determine which message the server responds to.

Example:

{
    "tid":"fc55099072324bbba9ee7b014d9637de",
    "bid":"9b748a8e00b94d02879e506160cf7ab5",
    "method":"live_set_quality",
    "data":{
        "result":0
    }
}

Parameter Description:

  • result: Error code, see the chapter Error Code for specific meaning.

Start Live Streaming Manually

If you need to start the live streaming when the user is using it, and send the stream back to the server for archive analysis, you can use this interface to implement it. The detailed steps for users to manually start the live streaming in DJI Pilot 2 are as follows.

  1. After logging into the three-party cloud platform on DJI Pilot 2, you need to request a streaming server address parameter from the server, which varies from one three-party cloud platform to another, or you can write it directly in the code.

  2. Then send the parameters to DJI Pilot 2 for setting through the JSBridge interface. Refer to Live Start Push.

    window.djiBridge.liveshareSetConfig(type: Int, params: String).

  3. After DJI Pilot 2 receives the live streaming configuration, it immediately starts to push the stream. Users can enter the flight interface to view the live information, or stop or restart the live streaming.

Note: With manual live streaming, the push stream is always the DJI Pilot 2 main screen stream, and when the flyer switches the camera, the push stream will follow.