DJI Mobile SDK Documentation

      class LiveStreamManager

      class LiveStreamManager
      Package:dji.sdk.sdkmanager
      Description:

      The manager is used to stream the video to a RTMP server to do live streaming with DJI products.

      Class Members:
      method isStreaming
      boolean isStreaming()
      Package:dji.sdk.sdkmanager
      Description:

      Determines if the live streaming starts or not. After starting this flag will not be affected by the RTMP server status.

      Return:
      booleantrue if the live stream manager is streaming.
      method setLiveUrl
      void setLiveUrl (String url)
      Package:dji.sdk.sdkmanager
      Description:

      Sets the URL address of the RTMP Server. This method should be called before the calling of startStream.

      Input Parameters:
      String urlThe URL address string of the RTMP Server.
      method getLiveUrl
      String getLiveUrl()
      Package:dji.sdk.sdkmanager
      Description:

      Gets the current URL address of the RTMP Server.

      Return:
      StringA string of the URL address.
      method startStream
      int startStream()
      Package:dji.sdk.sdkmanager
      Description:

      Starts the live streaming. If the manager starts successfully, isStreaming will return true. The encoder will start to encoding the video frame if it is needed. The video will be streamed to the RTMP server if the server is available. The audio can be streamed along with the video if the audio setting is enabled.

      Return:
      intAn int value of the error code.
      method stopStream
      void stopStream()
      Package:dji.sdk.sdkmanager
      Description:

      Stop the live streaming. The operation is asynchronous and isStreaming will return false when the operation is complete.

      method getStartTime
      long getStartTime()
      Package:dji.sdk.sdkmanager
      Description:

      Returns the start time of the live streaming. The start time is updated when startStream is successful.

      Return:
      longA long value of the start time.
      method setAudioStreamingEnabled
      void setAudioStreamingEnabled(boolean enabled)
      Package:dji.sdk.sdkmanager
      Description:

      Enables/disables the audio streaming. When it is enabled, the audio received by the mobile device's microphone will be streamed to the RTMP server along with the video. This setting will take effect before startStream is called. Changing this setting after startStream is called requires restarting the streaming. The audio can be muted during the streaming by calling setAudioMuted.

      Input Parameters:
      boolean enabledPass true to enable the audio streaming, false to disable the audio streaming.
      method setAudioMuted
      void setAudioMuted(boolean enable)
      Package:dji.sdk.sdkmanager
      Description:

      Mutes the audio or unmutes the audio.
      Notes: this method only works when audio function is enabled ( isLiveAudioEnabled returns true).

      Input Parameters:
      boolean enablePass true to mute the audio, false to unmute the audio.
      method isLiveAudioEnabled
      boolean isLiveAudioEnabled()
      Package:dji.sdk.sdkmanager
      Description:

      Returns true if the audio function is enabled, vice versa.

      Return:
      booleanA boolean value to check if the audio function is enabled.
      method isAudioMuted
      boolean isAudioMuted()
      Package:dji.sdk.sdkmanager
      Description:

      Returns true if the audio is muted, vice versa.

      Return:
      booleanA boolean value to check if the audio is muted.
      method setVideoEncodingEnabled
      void setVideoEncodingEnabled(boolean enable)
      Package:dji.sdk.sdkmanager
      Description:

      Enables/disables the video encoding by force for the live streaming. The basic workflow to process the video feed from the aircraft is to decode first and then encode again with a specific bit rate into H.264 stream. Therefore, video encoding is required in default. For some drones like Mavic Pro, the original video feed from Mavic Pro remote controller can be streamed to a RTMP server directly, so the video encoding is disabled for Mavic Pro, however, the bit-rate of the original video is very high, by enabling this flag, the original video will be decoded and encoded to a lower speed video stream.

      Input Parameters:
      boolean enablePass true to enable the Video Encoding, false to disable the Video Encoding.
      method isVideoEncodingEnabled
      boolean isVideoEncodingEnabled()
      Package:dji.sdk.sdkmanager
      Description:

      Returns true if video encoding is enabled, vice versa.

      Return:
      booleantrue if the force encoding flag is enabled.
      method getLiveVideoFps
      float getLiveVideoFps()
      Package:dji.sdk.sdkmanager
      Description:

      Returns the real-time live video fps.

      Return:
      floatA float value of the live video fps.
      method getLiveVideoBitRate
      int getLiveVideoBitRate()
      Package:dji.sdk.sdkmanager
      Description:

      Returns the real-time video stream bit rate in kpbs.

      Return:
      intAn int value of the live video bit rate.
      method getLiveAudioBitRate
      int getLiveAudioBitRate()
      Package:dji.sdk.sdkmanager
      Description:

      Returns the real-time audio stream bit rate in kpbs.

      Return:
      intAn int value of the live audio bit rate.
      method getLiveVideoCacheSize
      int getLiveVideoCacheSize()
      Package:dji.sdk.sdkmanager
      Description:

      Returns the real-time video cache list size, unit: frame.

      Return:
      intAn int value of the live video cache list size.