dji-sdk / Mobile-SDK-iOS

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

Can't see FPV camera video from M300 RTK with sample app #407

Open seungbeom-son opened 3 years ago

seungbeom-son commented 3 years ago

I installed swift sample project with my own Bundle identifier & DJISDKAppKey.

It successfully launched and detected my aircraft, M300 RTK.

But, when I moved to FPV page, I could not get video from the M300 RTK.

What should I do to get video stream from FPV camera.

In addition, I also need to get video from the payload camera (H20) at the same time.

How can I do this.

IMG_0001

IMG_0002

dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #41390:

Dear Customer,

Thank you for contacting DJI. For the M300RTK, need to assignSource and setupFrameControlHandler. Please refer to the attachment to implement it.

Thanks,

Luce Luo DJI Developer Support
CameraFPVViewController.swift

Matheus193dn commented 3 years ago

Hi, Can you try my solution? https://github.com/dji-sdk/Mobile-SDK-iOS/issues/413

HimanshuChowdharyIndia commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #41390:

Dear Customer,

Thank you for contacting DJI. For the M300RTK, need to assignSource and setupFrameControlHandler. Please refer to the attachment to implement it.

Thanks,

Luce Luo DJI Developer Support CameraFPVViewController.swift

Hi..

I have tried your solution.. It is not working..

I am really in trouble.. I am not able to assign source for M300 - using OcusyncLink. when I try to assign it gives me error. Please see below.

I have tried various combinations: Primary - Secondary channel - error code

  1. FPV - LEFT - 1008
  2. FPV - TOP -1008
  3. FPV - RIGHT -1008
  4. FPV - FPV -1005
  5. TOP - FPV - 1008
  6. LEFT - FPV - 1008
  7. RIGHT - FPV - 1008
  8. MAIN - FPV - 1005
  9. FPV - MAIN - 1005

I believe because of that I am not getting feed from drone..

Please help me out..

Best Regards, Himanshu

Matheus193dn commented 3 years ago

@HimanshuChowdharyIndia Hi, Can you show me your source code when you fetch m300 camera? Also, please update to the latest firmware of drone and propo.

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia Hi, Can you show me your source code when you fetch m300 camera? Also, please update to the latest firmware of drone and propo.

Hi,

I have updated M300 latest firmware.. I am using 4.14 DJI sdk..

I believe nimble is not attached with M300.. That is why while fetching camera it gives me nil value.. It also give nil camera list.

please see fetch camera code below.. It is same as provided in sample app..

fileprivate func fetchCamera() -> DJICamera? { guard let product = DJISDKManager.product() else { return nil } if product is DJIAircraft || product is DJIHandheld { return product.camera } return nil }

Best Regards, Himanshu

Matheus193dn commented 3 years ago

@HimanshuChowdharyIndia M300 can't work like normal camera, it uses ocusynclink to fetch data and decode it by using VideoAdapter(you can find it in FPV folder of DJISample). It also needs to set enable for hardware decode

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia M300 can't work like normal camera, it uses ocusynclink to fetch data and decode it by using VideoAdapter(you can find it in FPV folder of DJISample). It also needs to set enable for hardware decode

@Matheus193dn I have gone through the documentation and I understands that initially we need to assign source as given in sample app (https://github.com/dji-sdk/Mobile-SDK-iOS.git).. I am following this sample code strictly... In fact I tried Sample code.. I am not getting any video..

HimanshuChowdharyIndia commented 3 years ago

@Matheus193dn

I am following same as expected in below mentioned file CameraFPVViewController.txt

CameraFPVViewController.txt

Please help me out to figure out where I am wrong..

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia M300 can't work like normal camera, it uses ocusynclink to fetch data and decode it by using VideoAdapter(you can find it in FPV folder of DJISample). It also needs to set enable for hardware decode

@Matheus193dn Please tell me when I need to enable hardware decode... Before starting DJIPreviewer Instance or after??

Matheus193dn commented 3 years ago

@HimanshuChowdharyIndia You can try my worked sample code below, i cloned from dji sample so you can download whole project and then replace with your dji key https://github.com/Matheus193dn/Mobile-SDK-iOS/blob/master/Sample%20Code/SwiftSampleCode/DJISDKSwiftDemo/Camera/fpv/CameraFPVViewController.swift

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia You can try my worked sample code below, i cloned from dji sample so you can download whole project and then replace with your dji key https://github.com/Matheus193dn/Mobile-SDK-iOS/blob/master/Sample%20Code/SwiftSampleCode/DJISDKSwiftDemo/Camera/fpv/CameraFPVViewController.swift

@Matheus193dn FPV video is not coming in sample code you have shared.. I have added my DJI app key.. Then moved to FPV after getting connected with M300... I am not able to see video.. I clicked HardwareDecode.. Still I am not getting video..

Matheus193dn commented 3 years ago

@HimanshuChowdharyIndia do you have any android device, if you have one, plz get DJI Pilot App. Just confirm that your camera still working.

P/S:

image

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia do you have any android device, if you have one, plz get DJI Pilot App. Just confirm that your camera still working.

P/S: I no longer work with DJI drone Project, but i will try my best to help you. image

@Matheus193dn We have tested on Android device (Sample app and our app) and we are getting feed.. In Android the way is pretty different..

Matheus193dn commented 3 years ago

@HimanshuChowdharyIndia So how i can help you directly now?

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia do you have any android device, if you have one, plz get DJI Pilot App. Just confirm that your camera still working. P/S: I no longer work with DJI drone Project, but i will try my best to help you. image

@Matheus193dn We have tested on Android device (Sample app and our app) and we are getting feed.. In Android the way is pretty different..

@Matheus193dn DJI Pilot for iOS has also Video issues while using with M300..

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia So how i can help you directly now?

@Matheus193dn As per my knowledge DJI Pilot and Sample App provided by DJI and You are not showing video.. If Possible please help me by providing Sample App which confirms that it will show Video Feed (FPV) from M300 RTK.. That will help me A lot..

Thanks a lot for your support.. Himanshu

Matheus193dn commented 3 years ago

@HimanshuChowdharyIndia How i can contact directly with you, because i no longer work in drone project. Do you use teamviewer or zoom? I can help you debug it.

HimanshuChowdharyIndia commented 3 years ago

@HimanshuChowdharyIndia How i can contact directly with you, because i no longer work in drone project. Do you use teamviewer or zoom? I can help you debug it.

Sorry for late reply.. Please contact me on my email id : hchowdhary@flyanra.com .. We can exchange meeting detail via email.. Thank you..

brien-crean commented 3 years ago

I had the same issue and it seems when there is no payload camera attached it's just not possible to view the fpv video feed because assignSource requires two valid channels to be passed. Once I connected a payload camera as the leftCamera the code linked by @Matheus193dn worked just fine