dji-sdk / Mobile-SDK-iOS

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

How do you get the camera details from the video feed? #229

Open Nitaym opened 6 years ago

Nitaym commented 6 years ago

Using M210, M200, Inspire 2 you can select the video streams you wish to receive, and listening on DJIVideoFeedSourceListener gives you info on the available streams. I need a way to connect the video stream (DJIVideoFeed) to the camera details (DJICamera). Namely, to know which video stream relates to which camera.

Is this possible?

I'm using SDK 4.4

XietongLU commented 6 years ago

Could you try DJIVideoFeedPhysicalSource?

Nitaym commented 6 years ago

Hi,

DJIVideoFeedPhysicalSource gives the video source, but not the name of the camera. For example, one might have a ZenmuseXT either as DJIVideoFeedPhysicalSourceMainCamera, DJIVideoFeedPhysicalSourceLeftCamera, or DJIVideoFeedPhysicalSourceRightCamera. Depending on drone and configuration.

Thanks Nitay

Nitaym commented 6 years ago

Hi,

Is there any update on this?

Thanks Nitay

XietongLU commented 6 years ago

@Nitaym you are right. By design, the physical source is used to determine the source of the video feed. If you need to know the detail of camera, you should access DJICamera.

Nitaym commented 6 years ago

@XietongLU Thanks for you answer. My question is how do I know which video feed is which camera. For drones like Inspire 2, M210 you have 2-3 video feeds. I'd like to know the camera details of each video feed.

Currently I have a list of video feeds, and a list of DJICamera - But I don't know which video feed is coming from which camera.

XietongLU commented 6 years ago

I am afraid that you have to base on some context for the aircraft: for example, M210 has two DJICamera instances. The DJIVideoFeedPhysicalSourceLeftCamera is for DJICamera with index 0 and DJIVideoFeedPhysicalSourceRightCamera is for DJICamera with index 1. The reason that we don't provide the interface for this information is in some cases, a physical source doesn't map to any DJICamera instances (FPVCamera).

Nitaym commented 6 years ago

Okay, I will try and experiment with this. Thanks

lijia6745 commented 5 years ago

Did you resolve your issue with new version? if not, pls report the issue to dev@dji.com it's the official channel to request DJI SDK support now.

antonm76 commented 4 years ago

Hello! This issue is very important and it's so pity DJI SDK is that cumbersome and unclear in terms of setting up video feed desired. In or application our primary goal is to stream live video feed and let user an option to switch between FPV and other camera/cameras (if available). There are so many ways to control cameras, it is possible to set bandwidth allocation for main and left cameras in DJILightbridgeLink, it is also possible to assign sources to primary and secondary channels in DJIOcuSyncLink and allocate bandwidth there. As developers the only method we need is to be able to setup video feed to get video from particular camera (fpv and/or any other from the cameras array). Guys, if you have any plans to make this task easier for developers, that would be super awesome!