twilio / video-quickstart-ios

Twilio Video Quickstart for iOS
https://www.twilio.com/docs/api/video
MIT License
457 stars 177 forks source link

Choose VideoFormat error #615

Closed Goule closed 3 years ago

Goule commented 3 years ago

Hello,

Description

I'm trying to force quality for the camera. But I have an error when I'm trying to do it.

How to force a quality up to 720p or 1080p with good network quality?

Code

Code modified from the sample.

let format = VideoFormat()
format.dimensions = CMVideoDimensions(width: 1280, height: 720)
camera!.startCapture(device: backCamera!, format: format) { (captureDevice, videoFormat, error) in
    if let error = error {
        self.logMessage(messageText: "Capture failed with error.\ncode = \((error as NSError).code) error = \(error.localizedDescription)")
    } else {
        self.previewView.shouldMirror = (captureDevice.position == .front)
     }
 }

Expected Behavior

Camera and video of the participant in 720p or 1080p.

Actual Behavior

ERROR:Twilio:[Platform](0x16b8c3000): Fatal runtime capture error: Error Domain=com.twilio.video.capturer.camera Code=1004 "Could not find a valid device format." UserInfo={NSLocalizedFailureReason=Could not find a valid device format.}, code 1004
2021-04-27 11:48:21.365403+0200 VideoQuickStart[3638:287591] Capture failed with error.
code = 1004 error = The operation couldn’t be completed. Could not find a valid device format.

Versions

All relevant version information for the issue.

Video iOS SDK

[e.g. 4.4.0 via SPM]

Xcode

[e.g. 12.5]

iOS Version

[e.g. 14.5]

iOS Device

[e.g. iPhone X with back camera]

Thanks

Goule commented 3 years ago

Moved in https://github.com/twilio/twilio-video-ios/issues/183