How to Create ISOM and MP42 MP4 Files with FFmpeg

This article explains how to configure FFmpeg to produce MP4 containers that strictly adhere to the isom and mp42 major and compatible brand standards. You will learn the exact FFmpeg commands and parameters required to set these container brands, ensuring maximum playback compatibility across both legacy and modern media systems.

Understanding MP4 Brands (ftyp)

Every MP4 container contains a File Type Box (ftyp) at the beginning of the file. This box identifies the specifications the file complies with, categorized into:

The isom brand represents the base ISO Media File Format (ISO/IEC 14496-12), while mp42 represents Version 2 of the MP4 file format (ISO/IEC 14496-14).

FFmpeg Command to Set ISOM and MP42 Brands

By default, FFmpeg’s MP4 muxer writes isom as the major brand. To write a container with mp42 as the major brand and maintain compatibility with isom, you must use the -brand muxer private option.

Command for Re-encoding Video and Audio

If you are encoding a raw file or converting from another format, use the following command:

ffmpeg -i input.mkv -c:v libx264 -c:a aac -brand mp42 output.mp4

Command for Remuxing Without Re-encoding

If your streams are already compatible (e.g., H.264 video and AAC audio) and you only want to change the container brands without quality loss, use stream copying:

ffmpeg -i input.mp4 -c copy -brand mp42 output.mp4

How the -brand Option Works

When you specify -brand mp42 in FFmpeg:

  1. Major Brand is set to mp42.
  2. Compatible Brands are automatically populated as isom, mp42, and other base standards depending on the stream types.

This configuration guarantees that media players expecting the newer mp42 structure can read the file, while older players supporting only the base isom format can still fall back and play the file successfully.

Verifying the Output Brands

To verify that the output MP4 container has been written with the correct brands, you can use ffprobe to inspect the format data:

ffprobe -v error -show_entries format=major_brand,compatible_brands -of default=noprint_wrappers=1 output.mp4

The output should display:

major_brand=mp42
compatible_brands=isommp42