title: How to adjust properties in Videotoolbox?
body: <p>I'm now using Videotoolbox to deal with h.264 encoding.</p>
  
  <p>And I found a sample code and it works fine :</p>
  
  <pre><code>    #define VTB_HEIGHT 480
      #define VTB_WIDTH 640
  
      int bitRate = VTB_WIDTH * VTB_HEIGHT * 3 * 4 * 8;
  
      CFNumberRef bitRateRef = CFNumberCreate(kCFAllocatorDefault,
                                              kCFNumberSInt32Type,
                                              &amp;bitRate);
  
      VTSessionSetProperty(encodingSession,
                           kVTCompressionPropertyKey_AverageBitRate,
                           bitRateRef);
  
      CFRelease(bitRateRef);
  
  
      int bitRateLimit = bitRate / 8;
  
      CFNumberRef bitRateLimitRef = CFNumberCreate(kCFAllocatorDefault,
                                                   kCFNumberSInt32Type,
                                                   &amp;bitRateLimit);
  
      VTSessionSetProperty(encodingSession,
                           kVTCompressionPropertyKey_DataRateLimits,
                           bitRateLimitRef);
  
      CFRelease(bitRateLimitRef);
  </code></pre>
  
  <hr>
  
  <p>But these two lines, I don't understand:</p>
  
  <pre><code>int bitRate = VTB_WIDTH * VTB_HEIGHT * 3 * 4 * 8;
  
  int bitRateLimit = bitRate / 8;
  </code></pre>
  
  <p>What's the right way to use them?</p>
  
  <p>hope someone can tell me.</p>
  
  <p>Thanks for your time!</p>