dji-sdk / Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Other
576 stars 255 forks source link

Mini 2 Swift no video feed #506

Open hdrpano opened 2 years ago

hdrpano commented 2 years ago

As you know me I don't update issues but always solutions

The Mini 2 needs some modification in the swift SDK 4.16 version to show the video feed:

add this it the VideoPrewierAdapter

    } else if camera == DJICameraDisplayNameMavicMiniCamera {
        return ._MavicMini
    } else if camera == DJICameraDisplayNameDJIMini2Camera {
        return ._DJIMini2
    }

add this in the StartViewController

    self.adapter = VideoPreviewerAdapter.init()
    self.adapter?.start()
    adapter?.setupFrameControlHandler()

The DJI Mini 2 needs the setupFrameControlHandler()

dji-dev commented 2 years ago

Agent comment from DJI SDK in Zendesk ticket #61586:

尊敬的开发者,感谢您联系DJI 大疆创新 由于github不是我们主要的咨询渠道,您的问题可能跟进不及时。我们建议您通过填写表单( https://djisdksupport.zendesk.com/hc/zh-cn/requests/new )向我们反馈问题。或者您也可以在论坛发帖,与其它开发者交流。论坛链接:https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

Dear developer, thank you for contacting DJI. Since github is not our main consultation channel, your questions may not be followed up in time. We recommend that you fill in the form (https://djisdksupport.zendesk.com/hc/en-us/requests/new) to report problems to us. Or you can post in the forum to communicate with other developers. Forum link: https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

°°°

aero-jet commented 2 years ago

Thanks for this @hdrpano .

I was able to make the modifications and get it showing in the Mobile-SDK-iOS sample app.

However, I'm using DJI's UXSDK for iOS in my own app and I can't see the video feed in the DUXDefaultLayoutViewController. I updated the UXSDk to the latest version.

Is that something that DJI will need to update in the UXSDK before it starts working? I'll probably open an issue there if that's the case.

DJI-William commented 2 years ago

We will update the iOS Swift demo soon.

YaroTs commented 2 years ago

@aero-jet

Have you tried to set FrameControlHandler for default DJIVideoPreviewer when using DUXDefaultLayoutViewController?

So, something like that is required:

`let feed = DJISDKManager.videoFeeder()?.primaryVideoFeed

let previewer = DJIVideoPreviewer.instance() previewer?.frameControlHandler = self`

I would like to have support of Mini 2 in my app, but unfortunately, i don't have this model to test whether such approach works.

hdrpano commented 2 years ago

I will test that for you.

Am 21.03.2022 um 10:08 schrieb Yaroslav Tsimokha @.***>:

 @aero-jet

Have you tried to set FrameControlHandler for default DJIVideoPreviewer when using DUXDefaultLayoutViewController?

So, something like that is required:

`let feed = DJISDKManager.videoFeeder()?.primaryVideoFeed

let previewer = DJIVideoPreviewer.instance() previewer?.frameControlHandler = self`

I would like to have support of Mini 2 in my app, but unfortunately, i don't have this model to test whether such approach works.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

lhuanyu commented 2 years ago

We will update the iOS Swift demo soon.

DUXFPVViewController also doesn't work with Mini 2. Will the UXSDK be updated?

DJI-William commented 2 years ago

We will update the iOS Swift demo soon.

DUXFPVViewController also doesn't work with Mini 2. Will the UXSDK be updated?

Yes, we will update iOS UXSDK later.

lhuanyu commented 2 years ago

Thanks for this @hdrpano .

I was able to make the modifications and get it showing in the Mobile-SDK-iOS sample app.

However, I'm using DJI's UXSDK for iOS in my own app and I can't see the video feed in the DUXDefaultLayoutViewController. I updated the UXSDk to the latest version.

Is that something that DJI will need to update in the UXSDK before it starts working? I'll probably open an issue there if that's the case.

Because DJIUXSDK is actually using VideoPreviewerSDKAdapter from the demo. A possible solution is to swizzle the + (H264EncoderType)getDataSourceWithCameraName:(NSString *)cameraName andIsAircraft:(BOOL)isAircraft of VideoPreviewerSDKAdapter with:

+ (H264EncoderType)mini_getDataSourceWithCameraName:(NSString *)cameraName andIsAircraft:(BOOL)isAircraft {
    if([cameraName isEqualToString:DJICameraDisplayNameMavicMiniCamera]) {
        return H264EncoderType_MavicMini;
    }
    else if ([cameraName isEqualToString:DJICameraDisplayNameDJIMini2Camera]) {
        return H264EncoderType_DJIMini2;
    }

    return [self mini_getDataSourceWithCameraName:cameraName andIsAircraft:isAircraft];
}
hdrpano commented 1 year ago

DJI needs to update the UXSDK before it works with the Mini 2. The video feed and the set camera mode won‘t work with the actual version.

Am 17.03.2022 um 04:40 schrieb Jeffrey Leung @.***>:

 Thanks for this @hdrpano .

I was able to make the modifications and get it showing in the Mobile-SDK-iOS sample app.

However, I'm using DJI's UXSDK for iOS in my own app and I can't see the video feed in the DUXDefaultLayoutViewController. I updated the UXSDk to the latest version.

Is that something that DJI will need to update in the UXSDK before it starts working? I'll probably open an issue there if that's the case.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.