The benefits of b frames

Available in main and high profiles b frames are a means of using a frame or slice using information from the previous and next frames/slices. Ultimately this means that less bits are required to recreate the full frame image which can mean higher quality at lower bit rates.

Usually in an encoder you can use 1, 2 or more b frames used which tell the encoder to insert a certain number of b frames between I or P frames.

In some cases encoders may also allow you to select pyramid b frames (or p frames) what this means is that the encoder will use other b frames as reference for other b frames.

Using bits per pixel

While not an exact metric bits per pixel can be a useful guide in determining the optimal bitrate for a given resolution.

Calculated as: width x height x fps / bitrate.

Now for h264 and similar codecs the result needs to be interpreted based on the content. If your content is quite static you could likely get away with values around 0.1 though if you want reasonable quality with a lot of movement and colour around 0.2 will produce reasonable results. To get quality closer to the source for high action sports e.g. Australian rules football I have used rates in the 0.3 to 0.4 range.