BitrateCraft · Audio and text tracks · bitratecraft.org
Audio Encoders, Mixdown and Routing
In HandBrake the audio configuration is a per-track decision list rather than one global setting. Each row in the audio panel binds a source track to an encoder family, a rate or quality target, a channel layout and a gain offset, and the rows are written to the output in the order they appear. Treating those four properties as independent switches is what makes an audio layout predictable across players, receivers and portable devices.
How a track row is resolved
A row is evaluated at job start in three stages. The source track is first decoded to a linear PCM buffer at its native sample rate. The mixdown matrix then folds that buffer into the requested channel layout, applying the relevant coefficients and any normalisation the operator has enabled. Finally the selected encoder consumes the result while the muxer interleaves the finished frames with the video stream.
Failures are quiet by design. If the matrix expects six channels and the source holds two, the row falls back to the closest layout it can satisfy, so an ambitious surround request can end up written as plain stereo with no error shown. Track order matters for the same reason: the first row is flagged as the default in the container header, and any player that ignores language tags will select it. Put the broadly compatible mix first and the specialised program material second.
Encoder families compared
Each family trades efficiency, compatibility and processing cost differently. The table summarises the practical envelope rather than the theoretical maximum.
| Family | Type | Practical rate band | Container notes |
|---|---|---|---|
| AAC | Lossy, perceptual | 96–256 kbps per stereo pair | Widely accepted in both MP4 and Matroska |
| Opus | Lossy, low latency | 64–192 kbps per stereo pair | Reliable in Matroska; MP4 support varies by player |
| MP3 | Lossy, legacy | 128–320 kbps | Broad support, weakest efficiency of the lossy set |
| Vorbis | Lossy | 96–224 kbps | Matroska and WebM oriented |
| AC-3 | Lossy, multichannel | 384–640 kbps for 5.1 | Both containers; fixed rate bands are expected by amplifiers |
| E-AC-3 | Lossy, multichannel | Higher bands with more overhead | Requires a decoder that advertises the extension |
| FLAC | Lossless | Rate follows the source | Matroska; tolerated but unreliable inside MP4 |
Container compatibility usually decides the shortlist. A lossless row inside MP4 may be accepted by the muxer and still be skipped by a television that expects only AAC. When an output must play everywhere, a lossy compatibility row in first position covers the requirement without discarding the richer tracks behind it.
Bitrate mode and quality mode
Every lossy row offers a rate target, and several families also expose a quality control. A rate target asks the encoder to hold an average across the whole program, which is predictable for planning but blunt: quiet dialogue and dense music are billed at the same rate. Quality mode lets the encoder spend bits where the signal demands them, which is normally the better choice for archival work whose loudness and spectral content vary between chapters. Fixed targets remain useful when the result has to fit a known channel or a fixed storage envelope.
Family behaviour differs. AAC responds smoothly across its quality range and degrades gracefully below 96 kbps per stereo pair. Opus is efficient well below that point and is the sensible choice for speech-heavy material. AC-3 should be left inside its established rate bands, because decoders in older amplifiers accept the presence of the track only when those bands are respected.
Routing map from source to muxer
The diagram below shows how a two-row configuration reaches the output file. Each source track is decoded once, folded by its own matrix, and encoded independently.

Channel mixdown
Mixdown decides how many channels the encoded row carries and which coefficients map the source channels into them. The common targets are mono, stereo, Dolby Pro Logic II, 5.1 and 7.1, plus a pass-through option that copies multichannel content without folding it. Pass-through preserves the original bit-for-bit where the family allows it and costs almost nothing in processing, but it also inherits the source quality, including any artefacts already present.
| Target | Typical use | What to watch |
|---|---|---|
| Mono | Speech archives, narrowband material | Phase cancellation when the source is near dual-mono |
| Stereo | Universal compatibility row | Downmix summation can clip without normalisation |
| Dolby Pro Logic II | Stereo carrier with matrixed rear information | Only meaningful for receivers that decode the matrix |
| 5.1 | Surround program material | Requires a source with at least the same channel count |
| Pass-through | Keeping an existing multichannel mix intact | Container and decoder support must both be confirmed |
Summing multiple channels into fewer ones multiplies the risk of clipping, because six correlated sources can add well above the headroom of a single channel. The normalisation setting exists for that case: it scales the folded result down so the loudest sample stays inside range. It costs a little level, and for material that has already been mastered close to full scale it is the difference between a clean result and audible flat-topping.
Sample rate handling
Sample rate belongs to the output row, not to the source, so a row can resample even when the material is being copied without a mixdown change. Video-derived sources are almost always 48 kHz, and keeping that rate avoids a conversion step and its filter cost. The 44.1 kHz target belongs mainly to music-derived material, while 32 kHz is a legacy television rate and 96 kHz suits archival captures where the extra bandwidth is genuinely present. Resampling does not add information; it only spends processor time and can introduce ringing at the band edge if the ratio is awkward.
Gain and dynamic range
The gain control offsets the row in decibels before encoding. Positive values of roughly three to six decibels recover material mixed for cinema playback; larger values rapidly push peaks into the limiter. Dynamic range compression, where the family supports it, works on the metadata that some decoders honour, so its audible effect depends on the playback chain rather than on the encoded samples themselves. Apply gain first and check the meter before trusting a large offset.
Routing rules worth keeping
- Decide the compatibility row first and place it at the top of the panel.
- Match every mixdown to the smallest source channel count the title actually offers, not the largest in the batch.
- Add surround or lossless rows only when the material justifies them.
- Keep sample rate uniform across all rows so that downstream players never switch streams mid-playback.
- Apply gain before the matrix when a fold is involved, so the limiter sees the summed signal.
- Audit the fallback chain once per batch by checking one short sample of each title class.
Questions that come up
Why did a surround row come out as stereo?
The source title did not carry six discrete channels, so the matrix fell back to the nearest layout it could fill. Confirm the channel count in the title summary before building the row, and set the fallback deliberately rather than accepting the default.
Is a second audio track always worth the space?
It is when the first row is a compatibility mix and the second carries commentary or the original surround field. If both rows target the same layout with the same family, the duplicate consumes space without adding information. Container behaviour is discussed further in the container and muxing reference.
Should gain be corrected per row or per title?
Per row, since rows can draw on different source tracks with different mastering. A batch that shares one offset across every title will over-correct some material and under-correct the rest.
Related reading: the quality and rate factor guide explains how the video half of the same job is configured, and the transcoding glossary defines the mixdown and matrix terms used above.