From 5cb9708403e2e84402ab6391e843f511698ed0b9 Mon Sep 17 00:00:00 2001 From: asseconttecno <64484901+asseconttecno@users.noreply.github.com> Date: Fri, 29 Apr 2022 18:44:30 -0300 Subject: [PATCH] I found the solution, below is the fix for iOS 14.5 for those who need it. --- LFLiveKit/coder/LFHardwareVideoEncoder.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LFLiveKit/coder/LFHardwareVideoEncoder.m b/LFLiveKit/coder/LFHardwareVideoEncoder.m index 6c3d20fe..3d98837f 100755 --- a/LFLiveKit/coder/LFHardwareVideoEncoder.m +++ b/LFLiveKit/coder/LFHardwareVideoEncoder.m @@ -66,7 +66,10 @@ - (void)resetCompressionSession { VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_DataRateLimits, (__bridge CFArrayRef)limit); VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_RealTime, kCFBooleanTrue); VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_ProfileLevel, kVTProfileLevel_H264_Main_AutoLevel); - VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanTrue); + if([[UIDevice currentDevice].systemVersion floatValue] >= 15.4f) + { VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanFalse); } + else { VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanTrue); }, + kCFBooleanTrue); VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_H264EntropyMode, kVTH264EntropyMode_CABAC); VTCompressionSessionPrepareToEncodeFrames(compressionSession);