BitrateCraftHandBrake reference

BitrateCraft · Video pipeline · bitratecraft.org

Disclaimer: Independent technical documentation and configuration guide. Not affiliated with The HandBrake Team. No software downloads hosted

Container Formats and Muxing

The container is the wrapper that holds the encoded video, the audio tracks, subtitles, chapters and timing metadata together and tells a player how to read them. Muxing is the act of writing that wrapper, and it happens after the encoder has finished. Because the wrapper decides what can be carried and how quickly the file can be read, the container choice is not cosmetic: it constrains the tracks you keep and the players that will open the result. HandBrake offers two mainstream containers and a small set of variants, each with a distinct set of capabilities.

What a container actually holds

A container is a directory of tracks plus a timeline. Each track has a codec identifier, a time base, and pieces that are stored as a sequence of chunks. The file also records an index so a player can seek without reading everything.

video trackaudio 1audio 2subtitleschapters and index

MP4 and Matroska side by side

MP4 is the broad-compatibility choice. Matroska is the permissive one. Neither is strictly better; they optimise for different situations.

AspectMP4Matroska
Player supportVery wide, including consumer hardwareWide on software players, patchier on hardware
Video codecsWell-defined subset; some setups need a variant for newer codecsAlmost anything
AudioProven with common compressed families; extra setups for some tracksAccepts nearly every family
SubtitlesCommon text format plus timed text; styled subtitles need burn-inText, styled and bitmap tracks all possible
ChaptersSupported with a conventional naming schemeSupported, with more flexible naming
Fault toleranceA damaged header can strand the fileDesigned to survive partial damage

Chapters

Chapter markers are tiny but they are muxer-level data, so they survive only if the container understands them. Both mainstream formats carry them, and both accept names as well as times. The practical problems are usually upstream: a source with no chapter list, or a list whose times no longer match after a trim. Always confirm that the range mode and the chapter list agree, because a chapter that points beyond the encoded material is either dropped or clamped, depending on the muxer.

Subtitles and muxing

Subtitle handling is the clearest divider between the two formats. MP4 carries a common text format and a timed variant, but it has no room for the styling and positioning used by advanced text formats, so those tracks must either be converted or burned into the picture. Matroska stores advanced text and bitmap subtitle tracks in their native form, which preserves positioning and fonts but limits the devices that can display them. For compatibility-first work, a plain text track is the safest passenger; for preservation, Matroska keeps everything.

Fast-start and file layout

A player needs the index before it can seek, and the index is normally written at the end of the file because the muxer does not know the offsets until every chunk is placed. Fast-start relocates that index to the front in a final rearrangement pass, which lets a player begin reading and seeking immediately instead of pulling the whole file first. Use it whenever the destination is a progressively delivered stream or a player that reads from a slow medium; skip it when the file will only ever be read from fast local storage.

Fast-start is a remux, not a re-encode: the video and audio bytes are copied untouched and only the layout changes. It is therefore cheap and lossless, and it can be applied as a final step without touching encoder settings.

Constraints to check before a run

  1. Confirm every track you intend to keep is accepted by the chosen container.
  2. Decide whether styled subtitles must be preserved or may be converted.
  3. Check that chapter times fall inside the encoded range.
  4. Choose the fast-start option if the file will be streamed or read from slow media.
  5. After the run, verify the track list the player reports rather than trusting the outcome panel alone.

Common questions

Does the container change quality? No. It wraps the same encoded bytes; only compatibility and layout differ.

Can a file be converted between the two later? Yes, by remuxing, provided every track in the source is acceptable to the destination format.

Is fast-start always worth it? Only when sequential reading matters; on local storage it adds a pass with no playback benefit.

Open hard drive with actuator arm across the platters
The container decides how a player walks the file on disk; a front-loaded index removes the need to read to the end first.