Hey folks -
I'm a bit clueless about this specific topic, so bear with me please. I make use of the recording/streaming app called OBS Studio on both my Windows and Mac rigs. OBS supports hardware encoding to h.264 for recording and streaming so that you don't have to lean on its internal FFMpeg calls to transcode for you. Big CPU saver there.
I note when I'm attempting to stream to YouTube, for instance, that YT reports back that I'm sending all sorts of wonky bitrates. OBS lets me set a "bitrate" and "bitrate limit", which I have to 50Mbit/sec. YouTube will randomly report back that I'm sending it 70Mbit/sec. Or 90+ Mbit/sec. This is brief, but it happens repeatedly.
Challenge: streaming services hate VBR. And according to the OBS devs I've talked to, they seem to think that Apple's VT encoders only support VBR. Is that true? Is there any way to force CBR so that my Mac only ever sends 50Mbit/sec, no more, no less?
Thanks.
Post
Replies
Boosts
Views
Activity
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. :-)