Please select Into the mobile phone version | Continue to access the computer ver.
Close
You need to log in before you can reply       Login | Register now

[iOS] Show FPV and Main Camera Feeds in different UIView in case of Dual Camera Drone.

Author: erabhishek 2017-9-5 20:05
1 43
I want to show seperate feeds from FPV camera and main camera in different views is it possible throught Video Previewer? I don't see any methods to assign different views in video previewer it just takes single view, Also I want to make sure if Primary feed is for main camera and secondary feed is for FPV camera? as I do not have dual camera drone so I can not verify this, neither I find any documentation about the same. Please help how can I achieve this Thanks.
Reply
Replies
requestdirect0
Last edited by requestdirect0 In 2017-9-8 14:01 Editor

I have a single video panel, but it has a button to switch between fpv and main video streams. We have an M200 aircraft that has both an FPV camera and X4s camera attached to it. As you pointed out, there is no sample code anywhere to show how to do this, but with much banging of head against the wall, I got some code working.

I am using Android, but assume it would be similar in iOS.

What I do to switch streams is quite simple,

- Call the switchSource method of the DJICodecManager class. Pass in UsbAccessoryService.VideoStreamSource.fpv for the fpv camera or UsbAccessoryService.VideoStreamSource.Camera for the main camera

- Then get the index of fpv or main camera stream by calling UsbAccessoryService.VideoStreamSource.Camera.getIndex() or UsbAccessoryService.VideoStreamSource.fpv.getIndex()

- Then set the VideoFeeder.VideoDataCallback() onto this new stream at the given index. VideoFeeder.getInstance().getVideoFeeds().get(index).setCallback(yourVideoDataCallback);

I usually set the callback of the previous video feed to null before doing this to avoid any problems when switching streams.

This is working fine for me on the M200 with a single textureview for displaying video. If you wanted to show both cameras at once, I would assume you could have multiple textureviews in your layout, but I haven't tried that.
2017-9-8 06:16
You need to log in before you can reply Login | Register now

Quick Reply Back to top Back to list
Quick Reply Back to top Back to list