title: kVTCompressionPropertyKey_DataRateLimits property not being respected by hardware encoder, macOS
body: <p>I am working on a macOS project that uses hardware acceleration for video encoding, using VideoToolbox. I have tried controlling the bitrate using <code>kVTCompressionPropertyKey_AverageBitRate</code> and <code>kVTCompressionPropertyKey_DataRateLimits</code>, but after many attempts it still frequently overshoots the target bitrate. </p>
  
  <p><strong>Is <code>kVTCompressionPropertyKey_DataRateLimits</code> respected on macOS?</strong></p>
  
  <p>When I use <code>VTSessionCopySupportedPropertyDictionary</code> to get the supported properties on my compression session, DataRateLimits shows up in the dictionary, and I have set it on the compression session without error. But then if I try to actually get the value of it using</p>
  
  <pre><code>CFTypeRef value = nullptr;
  result = VTSessionCopyProperty(m_compressionSessionRef, (__bridge CFStringRef)key, kCFAllocatorDefault, &amp;value);
  </code></pre>
  
  <p>where <code>key</code> is DataRateLimits, as taken from the dictionary, it returns an error that the property is unsupported. <em>But on iOS, it returns successfully</em>.</p>
  
  <p>This seems pretty serious, and does not appear limited to my machine. If it's truly not supported, that would help explain the volatility of my encoding bitrate. However, in months of working on this project and researching VideoToolbox, I have not seen anything about this not being supported by the hardware encoder on macOS. I would think such a defect would be a big issue. Does anyone have any insight here? Thank you!</p>
  
  <p>Update: 8/5
  Note: SDKs targeted are recent (macOS-10.14.x, iOS-12.x). I see this issue on multiple hardware models with varying versions of macOS (10.11-10.14), though all are MacBook Pros, going as far back as 2013/2014, as well as recent touch models 2017/2018. For iOS, I don't have a lot of data, but I see DataRateLimits appears as expected on 12.3.1, and on iPhone 7 and iPhone X. Bottom line, the OS version and hardware doesn't seem to matter; it works on phones, but not laptops.</p>