Hey folks -
While working with OBS Studio, I noticed that when it's running on my 2019 Mac Pro 7,1, it lists two hardware h.264 encoders available. If I check that same version of OBS on my 2018-era Macbook Pro (with discrete AMD GPU), it only lists a single harrdware h.264 encoder.
My Mac Pro has the single AMD Radeon Pro Vega II GPU (not the dual). It's not really clear why the API is presenting two hardware encoders, and if there are actually any differences between the two.
One of the OBS devs wrote me a quick-and-dirty C program to dump out the list of encoders. The program looks like:
#include <stdlib.h>
#include <CoreFoundation/CoreFoundation.h>
#include <VideoToolbox/VideoToolbox.h>
#include <VideoToolbox/VTVideoEncoderList.h>
#include <CoreMedia/CoreMedia.h>
int main() {
CFArrayRef encoder_list;
VTCopyVideoEncoderList(NULL, &encoder_list);
CFIndex size = CFArrayGetCount(encoder_list);
for (CFIndex i = 0; i < size; i++) {
CFDictionaryRef encoder_dict = CFArrayGetValueAtIndex(encoder_list, i);
#define VT_PRINT(key, name) \
CFStringRef name##_ref = CFDictionaryGetValue(encoder_dict, key); \
CFIndex name##_len = CFStringGetLength(name##_ref); \
char *name = malloc(name##_len + 1); \
memset(name, 0, name##_len + 1); \
CFStringGetFileSystemRepresentation(name##_ref, name, name##_len);
VT_PRINT(kVTVideoEncoderList_EncoderName, name);
printf("Name: %s\n", name);
VT_PRINT(kVTVideoEncoderList_DisplayName, dn);
printf("Display Name: %s\n", dn);
VT_PRINT(kVTVideoEncoderList_EncoderID, id);
printf("Id: %s\n", id);
printf("=========================\n");
}
CFRelease(encoder_list);
exit(0);
}
Executing that on my Mac Pro, I see, among the output:
Name: Apple H.264 (HW)
Display Name: Apple H.264 (HW)
Id: com.apple.videotoolbox.videoencoder.h264.gva.100000abc
=========================
Name: Apple H.264 (HW)
Display Name: Apple H.264 (HW)
Id: com.apple.videotoolbox.videoencoder.h264.gva
When I run it on the laptop:
=========================
Name: Apple H.264 (HW)
Display Name: Apple H.264 (HW)
Id: com.apple.videotoolbox.videoencoder.h264.gva
My question is: what's the difference between those two hardware encoders listed for the Mac Pro?
Thanks for any guidance. :-)