Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

minimum TargetKbps for CBR HW h264 encoding

andrasjpeg
Beginner
466 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
466 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
0 Kudos
andrasjpeg
Beginner
466 Views
I see. That makes perfect sense. Thanks!
0 Kudos
froueint
Beginner
466 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
0 Kudos
Petter_L_Intel
Employee
466 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
0 Kudos
froueint
Beginner
466 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
0 Kudos
Reply