All codecs eventually produce a bit stream as their output. The bit stream is either multiplexed and transmitted live or packaged and stored in a file for later use. This is the end product of a coding operation, but just knowing that doesn’t mean we will produce an optimum bit stream.
A challenging aspect of producing the outgoing bit stream is to even out the flow of data so the available bit rate is used fully. The ideal situation is to use every last available bit but not run out of capacity. To do this, you have to develop a kind of “living-on-the-edge” mentality.
Taking the simplest case where I-frames are encoded to produce a bit stream, ...