Live Stream
Overview
The live streaming mainly sends the camera payload of the aircraft and the video stream of the DJI Dock to the tripartite cloud platform for broadcasting, and users can conveniently broadcast live on the remote web page.
Supported Live Streaming Types
Type | Description |
---|---|
Agora | The DJI public cloud platform is also based on the "Interactive Live Streaming Standard" function of Agora. The overall live broadcast delay is relatively low and the effect is good. For the third-party cloud privatization deployment, Agora also provides a hybrid cloud deployment model. The data is in the customer's private server, and then a link is opened through the air gap to the Agora's public cloud. This link channel is mainly used to upgrade and operate and maintain the privatized deployed servers. |
RTMP | Real-Time Messaging Protocol (RTMP) is a communication protocol for streaming audio, video and data over the Internet. This protocol is based on TCP and is a protocol family that includes the RTMP and RTMPT, RTMPS, RTMPE and many other variants. |
RTSP | RTSP (Real Time Streaming Protocol) is an application layer protocol in the TCP/IP protocol architecture that defines how one-to-many applications can efficiently deliver multimedia data over IP networks. RTSP is on top of RTP and RTCP in architecture, and it uses TCP or UDP to complete data transmission. Compared with RTSP, HTTP transmits HTML, while RTSP transmits multimedia data. |
GB28181 | GB/T 28181-2016 is a transmission control standard for the access of security video equipment to platforms in Mainland China. For some servers which already have 28181 downlink gateway, the data rate of DJI enterprise devices can be pushed to the server directly through this protocol. |
Framework for Live Streaming
As shown above, the aircraft flight platform is not directly connected to the tripartite cloud platform, it needs to be forwarded through the remote control or the DJI Dock. The communication between the remote control and the DJI Dock and the aircraft is still using DJI private AirLink.
The tripartite cloud platform requires pre-deployment of MQTT and streaming media server. DJI's streaming protocol supports RTMP, RTSP, GB28181 and Agora. MQTT is mainly used for message communication, configuration information setting and reading.
Pilot Interactive Timing Diagram
Load Live Streaming Module
Server Side call protocol to start live stream
Verification Succeeded
Verification Failed
App Side call JSBridge to start live stream
Detailed API Realization
Load DJI Pilot 2 Live Module
window.djiBridge.platformLoadComponent(String name, String param)
Before using the live streaming function, you need to pre-load Pilot2's live streaming module via JSBridge in the Webview, developers can consider adding the interface to load the live module directly during the up/down login stage.App Side call JSBridge to start livestreaming
For scenarios that do not require live viewing in the background, but need to turn on live streaming when the user is using it and send the code stream back to the server for archival analysis. The interface can be combined to allow users to manually trigger the live streaming function in Pilot2, with the following detailed steps.- After logging into the three-party cloud platform in the Webview of Pilot2, you need to request a live streaming server address parameter from the server, which is configured differently by each three-party cloud platform, or you can write it directly in the front-end code.
- Send the live streaming parameters to DJI Pilot 2 for setting through the JSBridge interface.
- After DJI Pilot 2 receives the live broadcast configuration, it immediately initiates a live stream push, and users can enter the flight interface to view live information, stop the live broadcast, restart the live broadcast, and other operations.
Note: In the manual live streaming mode, the streaming image is always the main image stream of DJI Pilot 2. When DJI Pilot 2 switches the camera image, the streaming image will also change accordingly.
Live Capacity
The field live_capacity is placed in the object model of the gateway device and is only pushed when there is a state change on the device side.Start Live Streaming
The server sends the commandmethod=live_start_push
to the device via MQTT, which uses the service method of the thing model to interact.Stop Live Streaming
Set Live Streaming Quality