Hey gang -
Reference this thread as to the basis of my ask. I'm trying to understand how many Videotoolbox h.264 hardware encoders that MacOS is presenting to the user. On my Mac Pro, I see two. On my Macbook Pro (2018 w/Radeon GPU), I only see one. Forum user casperes1996 took the C program that I linked in my post, ran it on his iMac, and reported back his results. What I'd like to do is get a small collection of other Mac Pro users to do the same. I already know what the Radeon Pro Vega II MPX module looks like, so I don't need another one of those reported. If anyone has any other GPU installed in their system (or sets of GPUs), I'd appreciate the data.
And it's easy. I'll 'splain what needs to be done. First, open a text editor of your choice, and cut and paste the following C code into it. It's all there, so you can easily see what it's doing: querying the Apple Videotoolbox and barfing out all of the encoders available.
start here ---8<---
end here ---8<---
Save it as a file called list.c in your home folder. Then pop open a Terminal.app (or iTerm, or whatever terminal you use) and compile it with GCC, assuming you have the XCode command line tools installed:
You don't need to sudo before that. You can do it as your normal user. Now you should have a small Mac binary in your home folder called list. Run it from the command line:
And you should get a big ol' list of encoders.
Now, I'm specifically interested in the h.264 hardware encoders; the rest aren't a concern right now. Scroll through the output and look for entries that appear like this:
Ignore the entries that have (SW) in parens, or any other CODEC. Just the H.264 (HW) ones. What I'd like to know is:
Reference this thread as to the basis of my ask. I'm trying to understand how many Videotoolbox h.264 hardware encoders that MacOS is presenting to the user. On my Mac Pro, I see two. On my Macbook Pro (2018 w/Radeon GPU), I only see one. Forum user casperes1996 took the C program that I linked in my post, ran it on his iMac, and reported back his results. What I'd like to do is get a small collection of other Mac Pro users to do the same. I already know what the Radeon Pro Vega II MPX module looks like, so I don't need another one of those reported. If anyone has any other GPU installed in their system (or sets of GPUs), I'd appreciate the data.
And it's easy. I'll 'splain what needs to be done. First, open a text editor of your choice, and cut and paste the following C code into it. It's all there, so you can easily see what it's doing: querying the Apple Videotoolbox and barfing out all of the encoders available.
start here ---8<---
C:
#include <stdio.h>
#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);
}
Save it as a file called list.c in your home folder. Then pop open a Terminal.app (or iTerm, or whatever terminal you use) and compile it with GCC, assuming you have the XCode command line tools installed:
Code:
gcc -O2 list.c -o list -framework CoreServices -framework VideoToolbox
You don't need to sudo before that. You can do it as your normal user. Now you should have a small Mac binary in your home folder called list. Run it from the command line:
Code:
./list
And you should get a big ol' list of encoders.
Now, I'm specifically interested in the h.264 hardware encoders; the rest aren't a concern right now. Scroll through the output and look for entries that appear like this:
Code:
Name: Apple H.264 (HW)
Display Name: Apple H.264 (HW)
Id: com.apple.videotoolbox.videoencoder.h264.gva
=========================
Ignore the entries that have (SW) in parens, or any other CODEC. Just the H.264 (HW) ones. What I'd like to know is:
- What card(s) do you have in your Mac?
- How many H.264 (HW) entries do you see?
- What are their Id: lines?