Bitrate modes set how closely a target bitrate is maintained over time in a stream. Bitrate modes are mostly configured on encoders, but some muxers can be configured to add data padding in order to maintain a constant target bitrate. There are 3 main modes of encoding: variable, true constant, and constrained constant.
Table of Contents:
- Variable Bitrate (VBR)
- Constant Bitrate (CBR)
- TS Muxer Bitrate Modes
- Expected Decoder Latencies
- Example Configurations
Variable Bitrate (VBR)
Variable bitrate will still maintain a target bitrate but allows for fluctuations in the bitrate to handle sections of the AV content requiring more or less information. While less predictable for network usage and buffering, it provides better quality compression and more efficient network or storage usage. For example, when encoding black or static video, little information is needed to encode it. VBR will take this into account and use less data rather than maintaining the target bitrate.
Constant Bitrate (CBR)
True CBR
True CBR will have little to no fluctuations in real bitrate vs target. It’s the opposite of VBR in that it’s very predictable for network usage and buffering, but will be less efficient. A dynamic section of content will forcefully be compressed to maintain a target bitrate and won’t look as good, but static content will be stored with more data than necessary and waste network bandwidth.
None of our encoders do true CBR and instead do constrained, but our TS muxer is capable of doing true CBR by inserting null packets to maintain the target bitrate.
Constrained CBR
Constrained CBR is the middle ground between VBR and true CBR. The bitrate is allowed to have some fluctuation like VBR, but it will be more constrained to the target bitrate. It’s more predictable than VBR, but doesn’t sacrifice as much efficiency/quality as true CBR.
TS Muxer Bitrate Modes
Most muxers produce a stream with variable bitrate, but our TS muxer in Unicast, Multicast, RTSP, SRT, and Zixi Out is capable of true CBR. You cannot set the bitrate mode directly on the muxer, so to get true CBR, each video and audio profile/encoder feeding the Output must be configured in CBR mode. If even one encode is VBR, then the muxer will do VBR.
Strict CBR
Some profiles/encoders have a strict constant bitrate mode (in software versions >V10.2.1). This mode doesn’t affect the profile/encoder so much as it affects the TS muxer. If the muxer is in CBR mode and at least one profile/encoder feeding the muxer is in strict constant bitrate, then the muxer will go in a strict CBR mode. Because of this, if a video profile/encoder is set to Strict Constant Bitrate and the audio profile/encoder is set to Constant Bitrate, the muxed output will assume a strict CBR mode.
This mode will improve PCR accuracy and ETSI TR 101 290 analysis, but it will increase decoder latency, i.e. the time the decoder buffers data before starting playback.
Expected Decoder Latencies:
- Non-Strict CBR: 300ms
- Strict CBR on LiveEdge® Node: 700ms
- Strict CBR on LiveEdge® Max: 1600ms
To understand why there are differences in decoder latency, some technical background is needed. Strict mode controls the offset of PCR from DTS, or another way to look at it is the demux bit buffer size. The offset of PCR and DTS within a transport stream dictates how much a demux will buffer up data before sending to decode (first PCR starts the clock and decode starts when the clock reaches the first DTS). This is very important for CBR mux, which will be transmitted at a constant rate. If a bitrate is not true CBR, then fluctuations could cause the decoder to under/overflow. A bitrate spike will need to be transmitted over a longer period of time, and a large enough bit buffer is needed to prevent decoder starvation. Each product’s video profile/encoder CBR implementation behaves differently, so they require different bit buffer sizes.
Example Configurations:
A few example configurations have been provided below for your reference. In the given example, it is assumed that the output being used has one video profile/encoder and two audio profiles/encoders attached to it. If the muxer is in CBR mode and at least one profile/encoder feeding the muxer is in strict constant bitrate, then the muxer will go in a strict CBR mode. Because of this, if a video profile/encoder is set to Strict Constant Bitrate and both audio profiles/encoders are set to Constant Bitrate, the muxed output will assume a strict CBR mode.
Video Profile/Encoder | Audio Profile/Encoder 1 | Audio Profile/Encoder 2 | Output Bitrate Mode |
VBR | VBR | VBR | VBR |
CBR |
VBR | VBR | VBR |
Strict CBR |
VBR | CBR | VBR |
VBR | CBR | VBR | VBR |
CBR | CBR | VBR | VBR |
Strict CBR | CBR | VBR | VBR |
CBR | CBR | CBR | CBR |
Strict CBR | CBR | CBR | Strict CBR |