{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/tools/utilities/mp4box",
  "collection": "docs",
  "title": "MP4Box",
  "description": "MP4Box, part of GPAC, muxes, edits, fragments and packages MP4 files and creates DASH and HLS presentations without re-encoding.",
  "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/tools/utilities/mp4box.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/tools/utilities/mp4box.md",
  "status": "current",
  "tags": [
    "migrated",
    "mp4",
    "isobmff",
    "gpac",
    "packaging"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "GPAC repository",
      "url": "https://github.com/gpac/gpac",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "GPAC v26.07.0 release",
      "url": "https://github.com/gpac/gpac/releases/tag/v26.07.0",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "GPAC downloads",
      "url": "https://gpac.io/downloads/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "MP4Box general options",
      "url": "https://wiki.gpac.io/MP4Box/mp4box-gen-opts/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "MP4Box import options",
      "url": "https://wiki.gpac.io/MP4Box/mp4box-import-opts/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "MP4Box DASH options",
      "url": "https://wiki.gpac.io/MP4Box/mp4box-dash-opts/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "MP4Box dump and export options",
      "url": "https://wiki.gpac.io/MP4Box/mp4box-dump-opts/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/utilities/mp4box.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/utilities/mp4box.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "Install it",
      "anchor": "install-it"
    },
    {
      "depth": 2,
      "text": "Inspect a file",
      "anchor": "inspect-a-file"
    },
    {
      "depth": 2,
      "text": "Mux streams into MP4",
      "anchor": "mux-streams-into-mp4"
    },
    {
      "depth": 2,
      "text": "Edit, join and extract",
      "anchor": "edit-join-and-extract"
    },
    {
      "depth": 2,
      "text": "Fragment and package for streaming",
      "anchor": "fragment-and-package-for-streaming"
    },
    {
      "depth": 2,
      "text": "Documentation",
      "anchor": "documentation"
    },
    {
      "depth": 2,
      "text": "Related pages",
      "anchor": "related-pages"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/_preamble.md",
      "checksum": "ae3c0e72cc074d8c4b3e91fca9b96d72533f7675133c6a40ee1949b0c9fc007b",
      "bytes": 1013
    },
    {
      "id": "install-it",
      "title": "Install it",
      "depth": 2,
      "anchor": "install-it",
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/#install-it",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/install-it.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/install-it.md",
      "checksum": "6d5fb7757629a2c3dce20bdce8f9648520f366fc4a22d3ecbadcb7d1e44c49c2",
      "bytes": 334
    },
    {
      "id": "inspect-a-file",
      "title": "Inspect a file",
      "depth": 2,
      "anchor": "inspect-a-file",
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/#inspect-a-file",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/inspect-a-file.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/inspect-a-file.md",
      "checksum": "0a4dd057a52cf11d58c8cb9c51838ce5783e1db4cea2d9480c2eb95832bbe145",
      "bytes": 260
    },
    {
      "id": "mux-streams-into-mp4",
      "title": "Mux streams into MP4",
      "depth": 2,
      "anchor": "mux-streams-into-mp4",
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/#mux-streams-into-mp4",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/mux-streams-into-mp4.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/mux-streams-into-mp4.md",
      "checksum": "df77660b92bf09e36144c376f9729ff516be80d4ab7146ec1529ccc75ad5628d",
      "bytes": 730
    },
    {
      "id": "edit-join-and-extract",
      "title": "Edit, join and extract",
      "depth": 2,
      "anchor": "edit-join-and-extract",
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/#edit-join-and-extract",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/edit-join-and-extract.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/edit-join-and-extract.md",
      "checksum": "b75aab0ada349bc12263add52bfa5724c406385b05531b9c9ab81b2f671f11aa",
      "bytes": 547
    },
    {
      "id": "fragment-and-package-for-streaming",
      "title": "Fragment and package for streaming",
      "depth": 2,
      "anchor": "fragment-and-package-for-streaming",
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/#fragment-and-package-for-streaming",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/fragment-and-package-for-streaming.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/fragment-and-package-for-streaming.md",
      "checksum": "35feb290d13d8be7b3d8ba56a4c361c5d53f2e2f1105e34bc2b776013c95cadb",
      "bytes": 958
    },
    {
      "id": "documentation",
      "title": "Documentation",
      "depth": 2,
      "anchor": "documentation",
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/#documentation",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/documentation.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/documentation.md",
      "checksum": "790a3c6c0721d18b61852726c5c0a9c34260ece3cd85519cae573bb3ecbf1d1c",
      "bytes": 197
    },
    {
      "id": "related-pages",
      "title": "Related pages",
      "depth": 2,
      "anchor": "related-pages",
      "canonicalUrl": "https://encode.wiki/tools/utilities/mp4box/#related-pages",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/related-pages.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/utilities/mp4box/related-pages.md",
      "checksum": "0d9f24528bcfa7aaed94ea431aa154ae4b5c6b52fe9cdc54318f12909cba62ba",
      "bytes": 183
    }
  ],
  "outboundReferences": [
    "/containers/isobmff/",
    "/containers/mp4/",
    "/tools/utilities/ffmpeg/",
    "/tools/utilities/mkvtoolnix/",
    "https://github.com/gpac/gpac",
    "https://github.com/gpac/gpac/releases/tag/v26.07.0",
    "https://gpac.io/",
    "https://gpac.io/downloads/",
    "https://wiki.gpac.io/MP4Box/MP4Box/"
  ],
  "checksum": "6f5450ef41dc1f4f41c1ad6ec35a9a0e44ef55c736b00a8a9deae68e6081d564",
  "contentFormat": "markdown",
  "markdown": "> **Repository:** [gpac/gpac](https://github.com/gpac/gpac). GPAC Ultramedia OSS for Video Streaming & Next-Gen Multimedia Transcoding, Packaging & Delivery. Latest release: [v26.07.0](https://github.com/gpac/gpac/releases/tag/v26.07.0), Jul 24, 2026. Last commit: Oct 7, 2026. License: LGPL-2.1. Stars: 3,312.\n\nMP4Box is the command-line MP4 tool from [GPAC](https://gpac.io/), the open-source multimedia framework developed at Télécom Paris. It is to [MP4](/containers/mp4/) roughly what [mkvmerge](/tools/utilities/mkvtoolnix/) is to Matroska: it muxes elementary streams into MP4, edits tracks and metadata, concatenates and splits files, fragments them, and packages them for DASH and HLS streaming. It never re-encodes.\n\nFFmpeg can do much of the basic muxing, but MP4Box gives finer control over the MP4 structure (brands, sample descriptions, edit lists, interleaving, fragmentation) and is a common choice for streaming packaging and for files that must pass strict MP4 validators or hardware players.\n\n## Install it\n\nGPAC publishes installers for Windows and macOS, Linux packages and nightly builds on [gpac.io/downloads](https://gpac.io/downloads/). It is also packaged as `gpac` by most Linux distributions and by Homebrew. MP4Box is installed together with the `gpac` command, which exposes the same framework as a filter pipeline.\n\n## Inspect a file\n\n```sh\nMP4Box -info input.mp4\nMP4Box -diso input.mp4\n```\n\n`-info` lists the brands, tracks, track IDs, codecs, durations and whether the file is fragmented. `-diso` dumps the complete box structure to `input_info.xml` for detailed debugging.\n\n## Mux streams into MP4\n\n```sh\nMP4Box -add video.ivf -add audio.opus -new output.mp4\n```\n\n`-new` creates a new file. Without it, MP4Box **edits the named file in place**, adding to whatever it already contains.\n\nImport options are appended to the file name with `:` and track selectors with `#`:\n\n```sh\nMP4Box -add video.h264:fps=24000/1001 -add audio.m4a:lang=ja -new output.mp4\nMP4Box -add input.mkv#video -add input.mkv#audio -new output.mp4\n```\n\nRaw H.264/HEVC streams carry no timing, so give their frame rate with `:fps=`. `#video`, `#audio` and `#trackID=N` pick tracks from container inputs. Other useful import options are `:name=` (track title), `:delay=` (in milliseconds) and `:dur=` (import only part of the stream).\n\n## Edit, join and extract\n\n```sh\nMP4Box -lang 2=ja input.mp4                  # set the language of track ID 2, in place\nMP4Box -rem 3 input.mp4                      # remove track ID 3, in place\nMP4Box -cat part1.mp4 -cat part2.mp4 -new joined.mp4\nMP4Box -raw 1 input.mp4                      # extract track ID 1 as a raw stream\nMP4Box -split 300 input.mp4                  # split into 300-second pieces at keyframes\n```\n\nTrack IDs come from `-info` and usually start at 1. `-cat` requires the same codec and compatible settings in every part.\n\n## Fragment and package for streaming\n\n```sh\nMP4Box -frag 2000 input.mp4 -out fragmented.mp4\nMP4Box -dash 4000 -rap -profile onDemand -out dash/manifest.mpd input.mp4#video input.mp4#audio\nMP4Box -dash 4000 -rap -out hls/master.m3u8 input.mp4#video input.mp4#audio\n```\n\n`-frag` writes a fragmented MP4 with fragments of about the given length in milliseconds. `-dash` sets the segment duration in milliseconds, and `-rap` starts every segment on a keyframe; the manifest type follows the `-out` extension (`.mpd` for DASH, `.m3u8` for HLS). The `onDemand` profile writes one file per track, indexed for byte-range requests.\n\nSegments can only start on keyframes, so encode with a fixed keyframe interval that divides the segment length (for example a keyframe every 2 seconds for 4-second segments). For adaptive streaming with several renditions, all renditions need their keyframes at the same timestamps; pass every rendition to the same `-dash` command.\n\n## Documentation\n\nThe [MP4Box documentation](https://wiki.gpac.io/MP4Box/MP4Box/) on the GPAC wiki covers every option; `MP4Box -h import`, `-h dash` and `-h dump` print the same sections offline.\n\n## Related pages\n\n- [MP4](/containers/mp4/) and [ISO Base Media File Format](/containers/isobmff/)\n- [FFmpeg](/tools/utilities/ffmpeg/) and [MKVToolNix](/tools/utilities/mkvtoolnix/)\n"
}
