Skip to content

Creating an example of IPMPX MP4 file

Dimitri Podborski edited this page Sep 17, 2020 · 1 revision

This example illustrates a possible scenario using the current IPMP related functions. It opens an existing MP4 Movie that contains and AAC audio, BIFS and Object Descriptors (OD) Tracks. It copies all the Tracks in a new MP4 Movie by adding IPMPX meta-data and protecting the audio samples.

In a nutshell, there are few things to do:

  • #include MP4Movies.h
  • Link with libisomediafile
  • Open the existing source Movie
  • Create a new destination Movie
  • Open Track and edit Media for each elementary stream
  • Copy samples for each Media from the source Movie to the destination one
  • Apply the protection on the audio samples
  • Add the IPMP_DescriptorPointer to the audio Sample Description (i.e. ES_Descriptor)
  • Add the IPMP_ToolDescriptorUpdate command in the OD elementary stream
  • End Media edits for each Media
  • Insert each Media into its track
  • Add the IPMP Tool List in the Initial Object Descriptor
  • Write the destination Movie to a file

This is demonstrated in the the protectAudioMovie sample code present in the protectAudioMovie.c file.

Important things to note from the protectAudioMovie sample code:

  • This is just one use scenario of the new IMPX related functions in the API
  • The amado.mp4 test file should be present in the directory of the executable file. If not, please add it or change the MP4 file name in the source code
  • Profiles and levels of the new Movie are equal to those of the source one. The constants used are those from the Systems part of MPEG-4.
  • The protectSample() function does nothing : any protection method should be added here.
  • The IPMP Tool used to protect the audio Track is identified by the ipmpToolID parameter that should be transmitted by a future Regulation Authority (RA).
  • The IPMP_ToolDecsriptorUpdate command is added to the only one Object Descriptor access unit present in the file and used for the audio decoder settings.
  • Even if this example uses IPMP Extensions (Amendment 3 in preparation for ISO/IEC 14496 1:2001), a level of compatibility exists with the IPMP Hooks framework documented in the original ISO/IEC 14496 1:2001.