Post

Replies

Boosts

Views

Activity

Reply to iOS17 VideoToolBox video encode h264 file set average bitrate not work?
I used CMSampleBufferCreateForImageBuffer to create CMSampleBufferRef from CVPixelBufferRef. Then use VTCompressionSessionEncodeFrame to encode CMSampleBufferRef. This may cause the LOW bitrate on iOS17. So I changed the way, directly encode the CVPixelBufferRef instead of CMSampleBufferRef. OSStatus status = VTCompressionSessionEncodeFrame(compressionSession, **pixelBuffer,** kCMTimeInvalid, kCMTimeInvalid, (__bridge CFDictionaryRef)properties, (__bridge_retained void *)timeNumber, NULL); then the encoded file has the desired bitrate.
Nov ’23