MP4Box

Overview

The multimedia packager available in GPAC is called MP4Box.
It can be used for performing many manipulations on multimedia files like AVI, MPG, TS, but mostly on ISO media files (e.g. MP4, 3GP). A complete documentation is available here.

In short, MP4Box can be used:

  • for manipulating ISO files like MP4, 3GP: adding, removing, multiplexing audio, video and presentation data (including subtitles) from different sources and in different formats,
  • for encoding/decoding presentation languages like MPEG-4 XMT or W3C SVG into/from binary formats like MPEG-4 BIFS or LASeR,
  • for performing encryption of streams
  • for attaching metadata to individual streams or to the whole ISO file to produce MPEG-21 compliant or hybrid MPEG-4/MPEG-21 files
  • for preparation of HTTP Adaptive Streaming content,
  • and packaging and tagging the result for streaming, download and playback on different devices (e.g. phones, PDA) or for different software (e.g. iTunes).

It is widely used: by academics, by theĀ video community and is used in many cloud infrastructures for preparation of multimedia files for playback, especially for iTunes/iOS and PlayStation.

Content Packaging

MP4Box can be used to repackage existing content to compliant ISO Media Files (MP4, 3GP, 3G2, OMA DCF). Note however that MP4Box does NOT re-encode audio, video and still image content, external tools shall be used for this purpose.

  • Transforming a DivX file to an MP4 file:
  • Adding a secondary audio track to the previous file:
  • MP4Box can import only parts or specific media from an existing container. To get the supported media that can be imported from a container:
  • To add a single media from a container:

Delivery Setup

MP4Box can be used to prepare files for different delivery protocols, mainly HTTP downloading or RTP streaming.

  • To prepare a file for HTTP download, the following instruction will interleave file data by chunks of 500 milliseconds in order to enable playback while downloading the file (HTTP FastStart):
  • To prepare for RTP, the following instruction will create RTP hint tracks for the file. This enables classic streaming servers like DarwinStreamingServer or QuickTime Streaming Server to deliver the file through RTSP/RTP:

Scene Transcoding

MP4Box can be used to encode MPEG-4 scene descriptions BIFS and LASeR and to decode MPEG-4 scene descriptions BIFS and LASeR.

  • To encode an existing description:

    Note that MP4Box will do its best to encode VRML/X3D to MPEG-4, but that not all tools from X3D or VRML extensions are supported in MPEG-4.

  • To decode an existing BIFS track to a BIFS Text format (VRML-like format)description:
  • To decode an existing BIFS track to XMT-A format:
  • To decode an existing LASeR track to an XSR format (SAF+LASeR Markup Language) description:
  • To decode the first sample of an existing LASeR track to an SVG file: