Camera change on the Mavic 2 Enterprise Advanced

Completed

Comments

7 comments

  • Gerard

    With the following code could I change to the thermal camera?

    Camera camera = FPVDemoApplication.getCameraInstance();
    CameraVideoStreamSource cameraVideoStreamSource = CameraVideoStreamSource.INFRARED_THERMAL; camera.setCameraVideoStreamSource(cameraVideoStreamSource, error -> {
    if (error == null) {
    showToast("Switch Camera Flat Mode Succeeded");
    } else {
    showToast(error.getDescription());
    }
    });

    0
    Comment actions Permalink
  • DJI Developer Support
    Do you want to switch the current lens from infrared lens to visible light lens?
    0
    Comment actions Permalink
  • Gerard

    What I want is to be able to see the live video from the thermal camera or the visual camera on the screen and be able to change it with a button just like the DJI fly app does.
    So if by changing the lens I can do that, then I would like to know how to change the lens. If changing the lens does not change the way I see the video, how can I change from one view to another.

    I made the code that I had previously sent because on the page https://developer.dji.com/api-reference/android-api/Components/Camera/DJICamera.html#djicamera_djicameravideostreamsource_inline, I saw that you could change the way to see the video stream of the Mavic 2 Enterprise Advanced.

    0
    Comment actions Permalink
  • DJI Developer Support
    If you want to be able to see the video of visible light or infrared lens on the screen, you can switch it through the setCameraVideoStreamSource interface. I think the code you wrote can complete the switching.
    0
    Comment actions Permalink
  • Gerard

    Hi,

    I have tried the code that I sent you. But, when I execute it, it tells me that it does not support it. And then my camera doesn't change. That is, it is maintained in mixed vision (thermal medium and visual medium). Do you recommend me to try another solution?

    Thanks

    0
    Comment actions Permalink
  • Gerard

    Hi,

    I solved the problem doing the following code:

    public void switchDisplayModeToVisualOnly() {
    Camera camera = FPVDemoApplication.getCameraInstance();
    assert camera != null;
    camera.getLens(1).setDisplayMode(SettingsDefinitions.DisplayMode.VISUAL_ONLY, new CommonCallbacks.CompletionCallback() {
    @Override
    public void onResult(DJIError djiError) {
    if (djiError == null) {
    showToast("Visual Camera");
    // Cambio al modo de visualización "visual only" (solo visual) exitoso
    } else {
    showToast("Error in camera change");
    // Error al cambiar al modo de visualización "visual only" (solo visual)
    }
    }
    });
    }

    Thanks

    0
    Comment actions Permalink
  • DJI Developer Support
    The way you use setDisplayMode works, you can use this method to switch
    0
    Comment actions Permalink

Please sign in to leave a comment.