VideoToolbox regression with iOS 15.4

Hi We use VideoToolbox to encode our videos and upload them on our servers. But since iOS 15.4, all videos uploaded have a really bad quality. It is because the bitrate is very low. Apparently, when we create ou VTCompressionSessionRef object, we have to change the kVTCompressionPropertyKey_DataRateLimits and put it much higher than before, but if we put it too high, it does not work either. It is very weird.

Has someone the same problem ?

Best regards

I have problem in VideoToolbox with 15.4 too. The problem is the bitrate of the streaming is much more higher than 15.3. Could you share your VTCompressionSessionRef with me? The low bitrate is what i want.

Hello, I want a 4 Mbs bitrate, before 15.4, this code used to work, now it doesn't :

status = VTSessionSetProperty( compressionSession, kVTCompressionPropertyKey_RealTime, kCFBooleanTrue ); status = VTSessionSetProperty( compressionSession, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanFalse );

int compressionBitrate = 4 * 1024 * 1024; float kLimitToAverageBitRateFactor = 1.5f;

status = VTSessionSetProperty( compressionSession, kVTCompressionPropertyKey_AverageBitRate, (__bridge CFTypeRef)@( compressionBitrate ) );

int64_t dataLimitBytesPerSecondValue = compressionBitrate * kLimitToAverageBitRateFactor / 8; CFNumberRef bytesPerSecond = CFNumberCreate( kCFAllocatorDefault, kCFNumberSInt64Type, &dataLimitBytesPerSecondValue ); int64_t oneSecondValue = 1; CFNumberRef oneSecond = CFNumberCreate( kCFAllocatorDefault, kCFNumberSInt64Type, &oneSecondValue ); const void *nums[2] = { bytesPerSecond, oneSecond }; CFArrayRef dataRateLimits = CFArrayCreate( nil, nums, 2, &kCFTypeArrayCallBacks );

status = VTSessionSetProperty( processObjC->compressionSession, kVTCompressionPropertyKey_DataRateLimits, dataRateLimits );

I have problem in VideoToolbox with macOS 12.3 too. 

We are having a frame rate issue using Open WebRTC Toolkit, which might be related. Until 15.3.1 everything was fine. The issue is being discussed here (including some useful graphs): https://github.com/open-webrtc-toolkit/owt-client-native/issues/589

I encountered the same problem, and finnaly I found the reason behind the problem after varied tries, maybe useful for you.

In my case, if the VideoToolbox encoder receives continuous two frames at least with the same pts, the encoder will decline output bitrate very quickly..

it's ok: pts: 0, 0.2, 0.4, 0.6, 0.8 ....

it's bad (two frame with the same pts 0.4) pts: 0, 0.2, 0.4, 0.4, 0.6, 0.8 ....

You may check pts of the frames passed to the encoder whether or not the same, if so, discard the later one or update the pts of the later.

VideoToolbox regression with iOS 15.4
 
 
Q