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

Video capture fails on iOS 18.1.1 with error "The camera's active format is unsupported by this session" #10

Closed
shepeliev opened this issue Nov 28, 2024 · 2 comments

Comments

@shepeliev
Copy link

Attempting to start video capture using the camera on iOS 18.1.1 fails with the error: The camera's active format is unsupported by this session.

This issue occurs in the 125.6422.05 and 125.6422.06 releases.
However, the 125.6422.04 release works as expected.

Environment

iPhone 13 Pro Max
iOS 18.1.1
iOS WebRTC SDK: 125.6422.06

Logs

(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:206 -[RTCCameraVideoCapturer startCaptureWithDevice:format:fps:completionHandler:]_block_invoke): startCaptureWithDevice <AVCaptureDeviceFormat: 0x3021ec340 'vide'/'420v' 1280x 720, { 1-120 fps}, photo dims:{1280x720}, fov:73.292, binned, supports vis (max strength:Low), max zoom:64.50 (upscales @1.43), ISO:23.0-920.0, SS:0.000022-1.000000, system exposure bias range:-2.0-2.0, supports Portrait Effect, supports Studio Lighting, supports Reactions> @ 30 fps
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:399 -[RTCCameraVideoCapturer handleCaptureSessionRuntimeError:]): Capture session runtime error: Error Domain=AVFoundationErrorDomain Code=-11873 "Cannot Record" UserInfo={NSLocalizedDescription=Cannot Record, AVErrorDeviceKey=<AVCaptureFigVideoDevice: 0x10a1fb000 [Front Camera][com.apple.avfoundation.avcapturedevice.built-in_video:1]>, NSLocalizedRecoverySuggestion=Reset the camera to a supported active format, then restart the session., NSLocalizedFailureReason=The camera's active format is unsupported by this session.}
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:435 -[RTCCameraVideoCapturer handleFatalError]_block_invoke): Attempting to recover from fatal capture error.
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:447 -[RTCCameraVideoCapturer handleNonFatalError]_block_invoke): Restarting capture session after error.
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:399 -[RTCCameraVideoCapturer handleCaptureSessionRuntimeError:]): Capture session runtime error: Error Domain=AVFoundationErrorDomain Code=-11873 "Cannot Record" UserInfo={NSLocalizedDescription=Cannot Record, AVErrorDeviceKey=<AVCaptureFigVideoDevice: 0x10a1fb000 [Front Camera][com.apple.avfoundation.avcapturedevice.built-in_video:1]>, NSLocalizedRecoverySuggestion=Reset the camera to a supported active format, then restart the session., NSLocalizedFailureReason=The camera's active format is unsupported by this session.}
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:439 -[RTCCameraVideoCapturer handleFatalError]_block_invoke): Previous fatal error recovery failed.
@cloudwebrtc
Copy link
Member

I think you need to filter out the parts that the device does not support when enumerating the formats like this:
https://github.com/flutter-webrtc/flutter-webrtc/blob/main/common/darwin/Classes/FlutterRTCMediaStream.m#L938-L942

@shepeliev
Copy link
Author

@cloudwebrtc thanks. It works.

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