Mavic Air 1 RTMP stream
CompletedI am trying to live stream the camera from the Mavic Air to my RTMP server. I know that the rtmp server works, and my client works.
In the line of code:
int result = DJISDKManager.getInstance().getLiveStreamManager().startStream();
result is -3.
The documentation states:
int
|
I think the issue is that my phone is connected to the Mavic Air via wifi, and that the rtmp stream is trying to resolve the DNS address via the wifi provider (the drone) instead of the cellular data. Does that sound correct? If so, is there a way to fix it?
Full code of the method:
private void setupVideoStream() {
String liveShowUrl = "rtmp://not.my.real.address/live/test";
new Thread() {
@Override
public void run() {
DJISDKManager.getInstance().getLiveStreamManager().setLiveUrl(liveShowUrl);
DJISDKManager.getInstance().getLiveStreamManager().setVideoEncodingEnabled(true);
int result = DJISDKManager.getInstance().getLiveStreamManager().startStream();
DJISDKManager.getInstance().getLiveStreamManager().setStartTime();
showToast("startLive:" + result +
"\n isVideoStreamSpeedConfigurable:" + DJISDKManager.getInstance().getLiveStreamManager().isVideoStreamSpeedConfigurable() +
"\n isLiveAudioEnabled:" + DJISDKManager.getInstance().getLiveStreamManager().isLiveAudioEnabled() +
"\n liveVideoFps: " + DJISDKManager.getInstance().getLiveStreamManager().getLiveVideoFps());
}
}.start();
}
-
I am not using DJICodecManager to decode the video. I send the video to my rtmp address and use VLC to try to watch it.
I am using the FPVDrone project and have just modified it by adding a button to start the video stream. The FPVDrone project doesn't have streaming already coded in it. Is there another project that does have RTMP streaming?
Thank you,
Rob
-
Dear Client Thank you for contacting DJI. DJICodecManager.sendDataToDecoder will add the sps/pps to the video. You can read What is the theory of LiveStreamManager? to understand the theory of LiveStreamManager. We have the part of LiveStreamManager in MSDK sample.The link is here. Mobile-SDK-Android/LiveStreamView.java at master · dji-sdk/Mobile-SDK-Android (github.com) Kindly Regards, DJI Developer Support -
FYI I have used an outside app (larix studio) to test my RTMP server set up and it is working. All of my firewall and nat/ip passthrough settings are working. I just can't broadcast the RTMP stream from my app when it is connected to the Mavic via wifi and connected to the cellular network (LTE) with 2 bars.
-
245 means that there was a problem during the initialisation of the LiveStreamManager.You can find out the meaning of some common error codes in this article.What does the startStream() return mean in live stream feature? Internet is needed for live streaming, but when you manipulate the drone through WIFI, can the mobile device be connected to the internet through LTE? You can try to communicate with the drone by using the remote control and then use LTE for live streaming. -
Ok, I did what you suggested and it worked. I connected my phone to the remote control and the phone connected to my server via wifi, so I can send the rtmp stream from the drone, though my phone, to the RTMP server. I didn't think I would need the controller since my phone can connect to the drone directly via the drone's wifi hotspot, but that would then take all internet requests. So I switched the drone back into controller mode, used the USB cable to attach the phone to the drone, and the phone used it's wifi radio to connect to my home wifi router. Thank you.
Please sign in to leave a comment.
Comments
9 comments