MP4v2

Functions
MP4v2 File Properties

## Functions
bool | MP4HaveAtom (MP4FileHandle hFile, const char *atomName)
| Check for presence of an atom. More...
bool | MP4GetIntegerProperty (MP4FileHandle hFile, const char *propName, uint64_t *retVal)
| Get the value of an integer property. More...
bool | MP4GetFloatProperty (MP4FileHandle hFile, const char *propName, float *retVal)
| Get the value of a float property. More...
bool | MP4GetStringProperty (MP4FileHandle hFile, const char *propName, const char **retVal)
| Get the value of a string property. More...
bool | MP4GetBytesProperty (MP4FileHandle hFile, const char *propName, uint8_t **ppValue, uint32_t *pValueSize)
| Get the value of a bytes property. More...
bool | MP4SetIntegerProperty (MP4FileHandle hFile, const char *propName, int64_t value)
| Set the value of an integer property. More...
bool | MP4SetFloatProperty (MP4FileHandle hFile, const char *propName, float value)
| Set the value of a float property. More...
bool | MP4SetStringProperty (MP4FileHandle hFile, const char *propName, const char *value)
| Set the value of a string property. More...
bool | MP4SetBytesProperty (MP4FileHandle hFile, const char *propName, const uint8_t *pValue, uint32_t valueSize)
| Set the value of a bytes property. More...
MP4Duration | MP4GetDuration (MP4FileHandle hFile)
| Get the duration of the movie (file). More...
uint32_t | MP4GetTimeScale (MP4FileHandle hFile)
| Get the time scale of the movie (file). More...
bool | MP4SetTimeScale (MP4FileHandle hFile, uint32_t value)
| Set the time scale of the movie (file). More...
void | MP4ChangeMovieTimeScale (MP4FileHandle hFile, uint32_t value)
| Change the general timescale of file hFile. More...
uint8_t | MP4GetODProfileLevel (MP4FileHandle hFile)
| Gets the minimum MPEG-4 object descriptor profile and level required to render the contents of the file. More...
bool | MP4SetODProfileLevel (MP4FileHandle hFile, uint8_t value)
| Sets the minimum MPEG-4 object descriptor profile and level required to render the contents of the file. More...
uint8_t | MP4GetSceneProfileLevel (MP4FileHandle hFile)
| Gets the minimum MPEG-4 scene graph profile and level required to render the contents of the file. More...
bool | MP4SetSceneProfileLevel (MP4FileHandle hFile, uint8_t value)
| Sets the minimum MPEG-4 scene graph profile and level required to render the contents of the file. More...
uint8_t | MP4GetVideoProfileLevel (MP4FileHandle hFile, MP4TrackId trackId=MP4_INVALID_TRACK_ID)
| Gets the minimum MPEG-4 video profile and level required to render the contents of the file. More...
void | MP4SetVideoProfileLevel (MP4FileHandle hFile, uint8_t value)
| Sets the minimum MPEG-4 video profile and level required to render the contents of the file. More...
uint8_t | MP4GetAudioProfileLevel (MP4FileHandle hFile)
| Gets the minimum MPEG-4 audio profile and level required to render the contents of the file. More...
void | MP4SetAudioProfileLevel (MP4FileHandle hFile, uint8_t value)
| Sets the minimum MPEG-4 audio profile and level required to render the contents of the file. More...
uint8_t | MP4GetGraphicsProfileLevel (MP4FileHandle hFile)
| Gets the minimum MPEG-4 graphics profile and level required to render the contents of the file. More...
bool | MP4SetGraphicsProfileLevel (MP4FileHandle hFile, uint8_t value)
| Sets the minimum MPEG-4 graphics profile and level required to render the contents of the file. More...

## Detailed Description

## Function Documentation

## ◆ MP4ChangeMovieTimeScale()

void MP4ChangeMovieTimeScale | ( | MP4FileHandle | hFile,
|  | uint32_t | value
| ) |  |

Change the general timescale of file hFile.

This function changes the general timescale of the file hFile to the new timescale value by recalculating all values that depend on the timescale in "moov.mvhd".

If the timescale is already equal to value nothing is done.

Parameters

  hFile | handle of file to change.
  value | the new timescale.

## ◆ MP4GetAudioProfileLevel()

uint8_t MP4GetAudioProfileLevel | ( | MP4FileHandle | hFile | ) |

Gets the minimum MPEG-4 audio profile and level required to render the contents of the file.

MP4GetAudioProfileLevel returns the minimum profile/level of MPEG-4 audio support necessary to render the contents of the file.

Parameters

  hFile | specifies the mp4 file to which the operation applies.

Returns
  The current audio profile/level for the file. See MP4SetAudioProfileLevel() for known values.

See also
  MP4SetAudioProfileLevel()

## ◆ MP4GetBytesProperty()

bool MP4GetBytesProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | uint8_t ** | ppValue,
|  | uint32_t * | pValueSize
| ) |  |

Get the value of a bytes property.

MP4GetBytesProperty determines the value of the bytes property identified by `propName`, e.g. "moov.udta.meta.metadata". The value is stored in a newly allocated buffer the location of which is assigned to the variable pointed to by ppValue. The caller is responsible for freeing the memory with MP4Free().

Parameters

  hFile | handle of file for operation.
  propName | path to the property to get.
  ppValue | pointer to a variable to receive the memory location containing the property bytes.
  pValueSize | pointer to a variable to receive the length of the property bytes value.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4GetDuration()

MP4Duration MP4GetDuration | ( | MP4FileHandle | hFile | ) |

Get the duration of the movie (file).

MP4GetDuration returns the maximum duration of all the tracks in the specified mp4 file.

Caveat: the duration is the movie (file) time scale units.

Parameters

  hFile | specifies the mp4 file to which the operation applies.

Returns
  The duration of the movie (file) in movie (file) time scale units.

See also
  MP4GetTimeScale()
  MP4ConvertFromMovieDuration()

## ◆ MP4GetFloatProperty()

bool MP4GetFloatProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | float * | retVal
| ) |  |

Get the value of a float property.

MP4GetFloatProperty determines the value of the float property identified by `propName`, e.g. "moov.mvhd.rate". The value is stored in the variable pointed to by `retVal`.

Parameters

  hFile | handle of file for operation.
  propName | path to the property to get.
  retVal | pointer to a variable to receive the return value.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4GetGraphicsProfileLevel()

uint8_t MP4GetGraphicsProfileLevel | ( | MP4FileHandle | hFile | ) |

Gets the minimum MPEG-4 graphics profile and level required to render the contents of the file.

MP4GetGraphicsProfileLevel returns the minimum profile/level of MPEG-4 graphics support necessary to render the contents of the file.

Parameters

  hFile | specifies the mp4 file to which the operation applies.

Returns
  The current graphics profile/level for the file. See MP4SetGraphicsProfileLevel() for known values.

See also
  MP4SetGraphicsProfileLevel()

## ◆ MP4GetIntegerProperty()

bool MP4GetIntegerProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | uint64_t * | retVal
| ) |  |

Get the value of an integer property.

MP4GetIntegerProperty determines the value of the integer property identified by `propName`, e.g. "moov.iods.audioProfileLevelId". The value is stored in the variable pointed to by `retVal`.

Parameters

  hFile | handle of file for operation.
  propName | path to the property to get.
  retVal | pointer to a variable to receive the return value.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4GetODProfileLevel()

uint8_t MP4GetODProfileLevel | ( | MP4FileHandle | hFile | ) |

Gets the minimum MPEG-4 object descriptor profile and level required to render the contents of the file.

MP4GetODProfileLevel returns the minimum profile/level of MPEG-4 object descriptor support necessary to render the contents of the file.

Parameters

  hFile | specifies the mp4 file to which the operation applies.

Returns
  The current object descriptor profile/level for the file. See MP4SetODProfileLevel() for known values.

See also
  MP4SetODProfileLevel()

## ◆ MP4GetSceneProfileLevel()

uint8_t MP4GetSceneProfileLevel | ( | MP4FileHandle | hFile | ) |

Gets the minimum MPEG-4 scene graph profile and level required to render the contents of the file.

MP4GetSceneProfileLevel returns the minimum profile/level of MPEG-4 scene graph support necessary to render the contents of the file.

Parameters

  hFile | specifies the mp4 file to which the operation applies.

Returns
  The current scene graph profile/level for the file. See MP4SetSceneProfileLevel() for known values.

See also
  MP4SetSceneProfileLevel()

## ◆ MP4GetStringProperty()

bool MP4GetStringProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | const char ** | retVal
| ) |  |

Get the value of a string property.

MP4GetStringProperty determines the value of the string property identified by `propName`, e.g. "ftyp.majorBrand". The value is stored in the variable pointed to by `retVal`.

Parameters

  hFile | handle of file for operation.
  propName | path to the property to get.
  retVal | pointer to a variable to receive the return value.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4GetTimeScale()

uint32_t MP4GetTimeScale | ( | MP4FileHandle | hFile | ) |

Get the time scale of the movie (file).

MP4GetTimeScale returns the time scale in units of ticks per second for the mp4 file. Caveat: tracks may use the same time scale as the movie or may use their own time scale.

Parameters

  hFile | handle of file for operation.

Returns
  timescale (ticks per second) of the mp4 file.

## ◆ MP4GetVideoProfileLevel()

uint8_t MP4GetVideoProfileLevel | ( | MP4FileHandle | hFile,
|  | MP4TrackId | trackId = `MP4_INVALID_TRACK_ID`
| ) |  |

Gets the minimum MPEG-4 video profile and level required to render the contents of the file.

MP4GetVideoProfileLevel returns the minimum profile/level of MPEG-4 video support necessary to render the contents of the file.

Parameters

  hFile | specifies the mp4 file to which the operation applies.
  trackId | specifies the track for which the profile/level is requested.

Returns
  The current video profile/level for the file/track. See MP4SetVideoProfileLevel() for known values.

See also
  MP4SetVideoProfileLevel()

## ◆ MP4HaveAtom()

bool MP4HaveAtom | ( | MP4FileHandle | hFile,
|  | const char * | atomName
| ) |  |

Check for presence of an atom.

MP4HaveAtom checks for the presence of the atom passed in `atomName`. `atomName` can specify an atom path to check for atoms that are not top level atoms, e.g. "moov.udta.meta.ilst".

Parameters

  hFile | handle of file for operation.
  atomName | name of the atom to check for.

Returns
  true (1) if the atom is present, false (0) otherwise.

## ◆ MP4SetAudioProfileLevel()

void MP4SetAudioProfileLevel | ( | MP4FileHandle | hFile,
|  | uint8_t | value
| ) |  |

Sets the minimum MPEG-4 audio profile and level required to render the contents of the file.

MP4SetAudioProfileLevel sets the minimum profile/level of MPEG-4 audio support necessary to render the contents of the file.

ISO/IEC 14496-1:2001 MPEG-4 Systems defines the following values:

Value | Meaning
--- | ---
0x00 | Reserved
0x01 | Main Profile @ Level 1
0x02 | Main Profile @ Level 2
0x03 | Main Profile @ Level 3
0x04 | Main Profile @ Level 4
0x05 | Scalable Profile @ Level 1
0x06 | Scalable Profile @ Level 2
0x07 | Scalable Profile @ Level 3
0x08 | Scalable Profile @ Level 4
0x09 | Speech Profile @ Level 1
0x0A | Speech Profile @ Level 2
0x0B | Synthesis Profile @ Level 1
0x0C | Synthesis Profile @ Level 2
0x0D | Synthesis Profile @ Level 3
0x0E-0x7F | Reserved
0x80-0xFD | User private
0xFE | No audio profile specified
0xFF | No audio required

Parameters

  hFile | specifies the mp4 file to which the operation applies.
  value | specifies the profile/level to set.

Returns
  Upon success, true (1). Upon an error, false (0).

See also
  MP4GetAudioProfileLevel()

## ◆ MP4SetBytesProperty()

bool MP4SetBytesProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | const uint8_t * | pValue,
|  | uint32_t | valueSize
| ) |  |

Set the value of a bytes property.

MP4SetBytesProperty sets the value of the bytes property identified by `propName`, e.g. "moov.udta.meta.metadata".

Parameters

  hFile | handle of file for operation.
  propName | path to the property to set.
  pValue | pointer the bytes representing the new value of the property.
  valueSize | the size of the bytes value pointed to by pValue.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4SetFloatProperty()

bool MP4SetFloatProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | float | value
| ) |  |

Set the value of a float property.

MP4SetFloatProperty sets the value of the float property identified by `propName`, e.g. "moov.mvhd.rate".

Parameters

  hFile | handle of file for operation.
  propName | path to the property to set.
  value | the new value of the property.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4SetGraphicsProfileLevel()

bool MP4SetGraphicsProfileLevel | ( | MP4FileHandle | hFile,
|  | uint8_t | value
| ) |  |

Sets the minimum MPEG-4 graphics profile and level required to render the contents of the file.

MP4SetGraphicsProfileLevel sets the minimum profile/level of MPEG-4 graphics support necessary to render the contents of the file.

ISO/IEC 14496-1:2001 MPEG-4 Systems defines the following values:

Value | Meaning
--- | ---
0x00 | Reserved
0x01 | Simple 2D Profile @ Level 1
0x02-0x7F | Reserved
0x80-0xFD | User private
0xFE | No graphics profile specified
0xFF | No graphics required

Parameters

  hFile | specifies the mp4 file to which the operation applies.
  value | specifies the profile/level to set.

Returns
  Upon success, true (1). Upon an error, false (0).

See also
  MP4GetGraphicsProfileLevel()

## ◆ MP4SetIntegerProperty()

bool MP4SetIntegerProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | int64_t | value
| ) |  |

Set the value of an integer property.

MP4SetIntegerProperty sets the value of the integer property identified by `propName`, e.g. "moov.iods.audioProfileLevelId".

Parameters

  hFile | handle of file for operation.
  propName | path to the property to set.
  value | the new value of the property.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4SetODProfileLevel()

bool MP4SetODProfileLevel | ( | MP4FileHandle | hFile,
|  | uint8_t | value
| ) |  |

Sets the minimum MPEG-4 object descriptor profile and level required to render the contents of the file.

MP4SetODProfileLevel sets the minimum profile/level of MPEG-4 object descriptor support necessary to render the contents of the file.

ISO/IEC 14496-1:2001 MPEG-4 Systems defines the following values:

Value | Meaning
--- | ---
0x00 | Reserved
0x01-0x7F | Reserved
0x80-0xFD | User private
0xFE | No object descriptor profile specified
0xFF | No object descriptor required

Parameters

  hFile | specifies the mp4 file to which the operation applies.
  value | specifies the profile/level to set.

Returns
  Upon success, true (1). Upon an error, false (0).

See also
  MP4GetODProfileLevel()

## ◆ MP4SetSceneProfileLevel()

bool MP4SetSceneProfileLevel | ( | MP4FileHandle | hFile,
|  | uint8_t | value
| ) |  |

Sets the minimum MPEG-4 scene graph profile and level required to render the contents of the file.

MP4SetSceneProfileLevel sets the minimum profile/level of MPEG-4 scene graph support necessary to render the contents of the file.

ISO/IEC 14496-1:2001 MPEG-4 Systems defines the following values:

Value | Meaning
--- | ---
0x00 | Reserved
0x01 | Simple 2D Profile @ Level 1
0x02-0x7F | Reserved
0x80-0xFD | User private
0xFE | No scene graph profile specified
0xFF | No scene graph required

Parameters

  hFile | specifies the mp4 file to which the operation applies.
  value | specifies the profile/level to set.

Returns
  Upon success, true (1). Upon an error, false (0).

See also
  MP4GetSceneProfileLevel()

## ◆ MP4SetStringProperty()

bool MP4SetStringProperty | ( | MP4FileHandle | hFile,
|  | const char * | propName,
|  | const char * | value
| ) |  |

Set the value of a string property.

MP4SetStringProperty sets the value of the string property identified by `propName`, e.g. "ftyp.majorBrand".

Parameters

  hFile | handle of file for operation.
  propName | path to the property to set.
  value | the new value of the property.

Returns
  true (1) on success, false (0) otherwise.

## ◆ MP4SetTimeScale()

bool MP4SetTimeScale | ( | MP4FileHandle | hFile,
|  | uint32_t | value
| ) |  |

Set the time scale of the movie (file).

MP4SetTimeScale sets the time scale of the mp4 file. The time scale is in the number of clock ticks per second. Caveat: tracks may use the same time scale as the movie or may use their own time scale.

Parameters

  hFile | handle of file for operation.
  value | desired timescale for the movie.

Returns
  On success, true. On failure, false.

## ◆ MP4SetVideoProfileLevel()

void MP4SetVideoProfileLevel | ( | MP4FileHandle | hFile,
|  | uint8_t | value
| ) |  |

Sets the minimum MPEG-4 video profile and level required to render the contents of the file.

MP4SetVideoProfileLevel sets the minimum profile/level of MPEG-4 video support necessary to render the contents of the file.

ISO/IEC 14496-1:2001 MPEG-4 Systems defines the following values:

Value | Meaning
--- | ---
0x00 | Reserved
0x01 | Simple Profile @ Level 3
0x02 | Simple Profile @ Level 2
0x03 | Simple Profile @ Level 1
0x04 | Simple Scalable Profile @ Level 2
0x05 | Simple Scalable Profile @ Level 1
0x06 | Core Profile @ Level 2
0x07 | Core Profile @ Level 1
0x08 | Main Profile @ Level 4
0x09 | Main Profile @ Level 3
0x0A | Main Profile @ Level 2
0x0B | N-Bit Profile @ Level 2
0x0C | Hybrid Profile @ Level 2
0x0D | Hybrid Profile @ Level 1
0x0E | Basic Animated Texture @ Level 2
0x0F | Basic Animated Texture @ Level 1
0x10 | Scalable Texture @ Level 3
0x11 | Scalable Texture @ Level 2
0x12 | Scalable Texture @ Level 1
0x13 | Simple Face Animation @ Level 2
0x14 | Simple Face Animation @ Level 1
0x15-0x7F | Reserved
0x80-0xFD | User private
0xFE | No video profile specified
0xFF | No video required

Parameters

  hFile | specifies the mp4 file to which the operation applies.
  value | specifies the profile/level to set.

Returns
  Upon success, true (1). Upon an error, false (0).

See also
  MP4GetVideoProfileLevel()