Codecs import/export in MP4Box

MP4Box allows you to import or export data from your multiplexed files, without modifying their contents. Simple, isn’t it? It is because MP4Box hides you many details that are to no interest for 99% of the users, but allows your files to be compatible with the standards.

However, did you know that a codec raw stream is stored differently when carried alone, in the ISOBMF (MP4) container, or in the MPEG2-TS container? A good example is the leading H264/AVC codec. It is not carried the same way when extracted alone (as a vector of NALUs – Network Abstraction Layer Units) or when multiplexed. And even multiplexed, it will appear under different formats:

  • Annex B (ISO 14496/10, MPEG4 part 10) defines a bitstream format. It allows H264 to be packages in containers which may not separation properly the NALUs, such as MPEG2-TS (ISO 13818/1, MPEG2 part 1).
  • ISOBMF (ISO 14496/15, MPEG4 part 15) defines it own format. The bitstream startcode is replaced by the size of the NALU and the descriptors (SPS/PPS are stored either in the decoder configuration of the video track or in a separate parameter set sample).

All these possibilities make modern multimedia tools very efficient, but also difficult to handle.

MP4Box simplifies the process for you and automatically detects the appropriate format. Sometimes MP4Box won’t cover your specific use-case, and you will need to make a addition to GPAC or to build your own tool based on libgpac, the core library of GPAC. libgpac handles both import and export, exposed through the MP4Box interface, which allows to cover most of the possible use-cases!

Leave a Reply

Your email address will not be published. Required fields are marked *

css.php