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, tablets) or for different software (e.g. iTunes).
It is widely used: by the video community, by many cloud infrastructures for preparation of multimedia files for playback, especially for iTunes/iOS and PlayStation, and by academics.
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:
1MP4Box -add file.avi new_file.mp4
- Adding a secondary audio track to the previous file:
1MP4Box -add audio2.mp3 new_file.mp4
- MP4Box can import only parts or specific media from an existing container. To get the supported media that can be imported from a container:
123MP4Box -info file.aviMP4Box -info file.mpgMP4Box -info file.ts
- To add a single media from a container:
1MP4Box -add file.mpg#audio new_file.mp4
MP4Box can be used to prepare files for different delivery protocols, mainly HTTP downloading or RTP streaming.
- To prepare a file for simple progressive 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):
1MP4Box -inter 500 file.mp4
- 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:
1MP4Box -hint file.mp4
- To prepare for adaptive streaming (MPEG-DASH), the following instruction will create the DASH manifest and associated files. For more information on DASH see this post:
1MP4Box -dash 1000 file.mp4
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:
1234MP4Box -mp4 scene.btMP4Box -mp4 scene.xmtMP4Box -mp4 scene.wrlMP4Box -mp4 file.svg
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:
1MP4Box -bt file.mp4
- To decode an existing BIFS track to XMT-A format:
1MP4Box -xmt file.mp4
- To decode an existing LASeR track to an XSR format (SAF+LASeR Markup Language) description:
1MP4Box -lsr file.mp4
- To decode the first sample of an existing LASeR track to an SVG file:
1MP4Box -svg file.mp4