minimum TargetKbps for CBR HW h264 encoding

minimum TargetKbps for CBR HW h264 encoding

I was playing around with the encoder paramters, and noticed that when I set TargetKbps below a certain threshold, I'll getMFX_WRN_INCOMPATIBLE_VIDEO_PARAM.

I'm encoding 1920x1088 @ 30Hz progressive.

Here are my settings: mfx.CodecId = MFX_CODEC_AVC; mfx.CodecProfile = MFX_PROFILE_AVC_HIGH; mfx.CodecLevel = MFX_LEVEL_AVC_42;mfx.RateControlMethod = MFX_RATECONTROL_CBR;mfx.TargetKbps =1503;

If I set mfx.TargetKbps to 1504 or above, the encoder initializes correctly, but if I set it to 1503 or below, it returns the above warning.

The environment:Intel Media SDK 2012 v3.0.774.38156Intel HD Graphics 3000 v8.15.10.2656Windows 7 SP1 x64

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,
Media SDK does limit the maximum compression ratio to 500x.
So for your case (1920x1080@30fps) the minimum bit rate is calculated as follows:1920 * 1080 * 1.5bpp * 30fps * 8bit / 500 ~= 1500 Kbps
For any bit rate selected below the minimum bit rate, Media SDK will adjust the actual bit rate and return the warning you encountered.

Regards,Petter

I see. That makes perfect sense. Thanks!

Hi Petter,

I might be missing something obvious, but why do you multiply by 8 bits in that calculation? As far as I can see all those numbers are in bits and nothing is in bytes.

Thanks,
Farhad

Hi Farhad,

NV12 color format represents one pixel by 1.5 bytes (12 bits). Since bitrate is commonly represented using bps (bits per second) multiplying by 8, as in the example, gives the bps. Without multiplying by 8 you'd get the bitrate in bytes per second.

Regards,Petter

Hi Petter,

Thanks for the quick reply. I had missed that the 1.5 bpp was the pre-compression pixel size in which case 1.5 bytes per pixel makes sense. I had assumed it was 1.5 bits per pixel.

Cheers,
Farhad

Leave a Comment

Please sign in to add a comment. Not a member? Join today