WebRTC-iOS
WebRTC-iOS copied to clipboard
iPhone 11 pro videocall freezes
I noticed that with the iPhone 11 pro the video freezes after about 15 seconds while with an iPhone 7 everything works fine.
Lowering the quality of the video call in WebRTCClient.swift instead it also works well on the iPhone 11 pro.
the change i made is change:
let format = (RTCCameraVideoCapturer.supportedFormats(for: frontCamera).sorted { (f1, f2) -> Bool in
let width1 = CMVideoFormatDescriptionGetDimensions(f1.formatDescription).width
let width2 = CMVideoFormatDescriptionGetDimensions(f2.formatDescription).width
return width1 < width2
}).**last**,
whit:
let format = (RTCCameraVideoCapturer.supportedFormats(for: frontCamera).sorted { (f1, f2) -> Bool in
let width1 = CMVideoFormatDescriptionGetDimensions(f1.formatDescription).width
let width2 = CMVideoFormatDescriptionGetDimensions(f2.formatDescription).width
return width1 < width2
}).**first**,
Hey thanks for the input. there is already a similar issue with similar solution.
I think changing last to first will select the lowest resolution. Would it hurt the picture quality? Can you check and compare?
Yes, the image quality deteriorates, surely with a little work you can understand what causes this bug and then solve it. If I had to find the solution, I'll post it here.