Complete Communications Engineering

This depends on the H.264 implementation being used.  There are many different implementations of H.264 running on a variety of platforms that allow varying levels of control over the bitrate.  The H.264 specification describes a number of adjustments that can be made to the bitstream that affect its bitrate.  It is up to the H.264 implementation to apply those adjustments to maintain the expected bitrate.  This is not always possible, so the bitrate of an H.264 stream is almost never exact, but it can be close.

Most APIs that wrap the H.264 algorithm will have a way to specify the average bitrate of a stream.  The x264 library has the x264_param_t structure where a rate control method and bitrate can be specified.  OpenH264 has SEncParamExt with similar parameters.  LibAV uses the AVCodecContext structure.  Many other platforms, including Android and iOS have their own APIs that wrap the H.264 algorithm with their own methods of specifying the bitrate.  At the user level, software that uses these H.264 APIs might include user control of the bitrate.  They might also use dynamic bitrate control, in which case the video streaming is supposed to just work without any user intervention.

H264 h.264 Bitrate Control block diagram