I am a bit confused on whether certain Video Toolbox (VT) encoders support hardware acceleration or not.
When I query the list of VT encoders (VTCopyVideoEncoderList(nil,&encoderList)
) on an iPhone 14 Pro device, for avc1
(AVC / H.264) and hevc1
(HEVC / H.265) encoders, the kVTVideoEncoderList_IsHardwareAccelerated
flag is not there, which -based on the documentation found on the VTVideoEncoderList.h
- means that the encoders do not support hardware acceleration:
optional. CFBoolean. If present and set to kCFBooleanTrue, indicates that the encoder is hardware accelerated.
In fact, no encoders from this list return this flag as true
and most of them do not include the flag at all on their dictionaries.
On the other hand, when I create a compression session using the VTCompressionSessionCreate()
and pass the kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder
as true
in the encoder specifications, after querying the kVTCompressionPropertyKey_UsingHardwareAcceleratedVideoEncoder
using the following code, I get a CFBoolean
value of true
for both H.264 and H.265 encoder.
In fact, I get a true
value (for both of the aforementioned encoders) even if I don't specify the kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder
during the creation of the compression session (note here that this flag was introduced in iOS 17.4 ^1).
So the question is: Are those encoders actually hardware accelerated on my device, and if so, why isn't that reflected on the VTCopyVideoEncoderList()
call?