Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch camera #2

Open
yaqding opened this issue Mar 9, 2020 · 1 comment
Open

Switch camera #2

yaqding opened this issue Mar 9, 2020 · 1 comment

Comments

@yaqding
Copy link

yaqding commented Mar 9, 2020

Hello Varvrar!

Thanks for you great work! I have used this nice app to recorder data for pose estimation. I was wondering how I could choose different back cameras since there are multiple back cameras from iphone 7. For example, I was trying to use the TelephotoCamera or UltraWideCamera, and based on the apple documentation I need to use AVCaptureDeviceDiscoverySession:

AVCaptureDeviceDiscoverySession *session =
[AVCaptureDeviceDiscoverySession
discoverySessionWithDeviceTypes:AVCaptureDeviceTypeBuiltInUltraWideCamera
mediaType:AVMediaTypeVideo
position:AVCaptureDevicePositionUnspecified];

However, it doesn't work. Could you please give some suggestions?

Thanks!

@Varvrar
Copy link
Owner

Varvrar commented Apr 7, 2020

Hello yaqding!

I can't try to use second back camera now. But I think you should change AVCaptureDevice instead of using AVCaptureDeviceDiscoverySession.

device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

Check apple documentation:
https://developer.apple.com/documentation/avfoundation/avcapturedevice?language=objc

You can try to use different defaultDeviceWithDeviceType.
Like AVCaptureDeviceTypeBuiltInTelephotoCamera or AVCaptureDeviceTypeBuiltInWideAngleCamera.
Or try to get device types in advance using devicesWithMediaType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants