Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.

minimum TargetKbps for CBR HW h264 encoding

andrasjpeg
Beginner
206 Views
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.38156
Intel HD Graphics 3000 v8.15.10.2656
Windows 7 SP1 x64
0 Kudos
5 Replies
Petter_L_Intel
Employee
206 Views
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
andrasjpeg
Beginner
206 Views
I see. That makes perfect sense. Thanks!
froueint
Beginner
206 Views
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
Petter_L_Intel
Employee
206 Views
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
froueint
Beginner
206 Views
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
Reply