Please select Into the mobile phone version | Continue to access the computer ver.
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
2 200
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.
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
Thanks for reply but its seems you are showing the single source(FPV/Main Camera) at time but I need to show the FPV and main camera source at same in different views, But I am unable to make the dual instance of video previewer as its singleton so how can i achieve this Thanks!
2017-9-22 15:55
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