MP4v2 Track Property
Functions
MP4v2 Track Property

Functions

bool MP4HaveTrackAtom (MP4FileHandle hFile, MP4TrackId trackId, const char *atomname)
 
const char * MP4GetTrackType (MP4FileHandle hFile, MP4TrackId trackId)
 Get the track type. More...
 
const char * MP4GetTrackMediaDataName (MP4FileHandle hFile, MP4TrackId trackId)
 
bool MP4GetTrackMediaDataOriginalFormat (MP4FileHandle hFile, MP4TrackId trackId, char *originalFormat, uint32_t buflen)
 
MP4Duration MP4GetTrackDuration (MP4FileHandle hFile, MP4TrackId trackId)
 
uint32_t MP4GetTrackTimeScale (MP4FileHandle hFile, MP4TrackId trackId)
 Get the time scale of a track. More...
 
bool MP4SetTrackTimeScale (MP4FileHandle hFile, MP4TrackId trackId, uint32_t value)
 Set the time scale of a track. More...
 
bool MP4GetTrackLanguage (MP4FileHandle hFile, MP4TrackId trackId, char *code)
 Get ISO-639-2/T language code of a track. More...
 
bool MP4SetTrackLanguage (MP4FileHandle hFile, MP4TrackId trackId, const char *code)
 Set ISO-639-2/T language code of a track. More...
 
bool MP4GetTrackName (MP4FileHandle hFile, MP4TrackId trackId, char **name)
 Get track name. More...
 
bool MP4SetTrackName (MP4FileHandle hFile, MP4TrackId trackId, const char *name)
 Set track name. More...
 
uint8_t MP4GetTrackAudioMpeg4Type (MP4FileHandle hFile, MP4TrackId trackId)
 
uint8_t MP4GetTrackEsdsObjectTypeId (MP4FileHandle hFile, MP4TrackId trackId)
 
MP4Duration MP4GetTrackFixedSampleDuration (MP4FileHandle hFile, MP4TrackId trackId)
 
uint32_t MP4GetTrackBitRate (MP4FileHandle hFile, MP4TrackId trackId)
 
bool MP4GetTrackVideoMetadata (MP4FileHandle hFile, MP4TrackId trackId, uint8_t **ppConfig, uint32_t *pConfigSize)
 
bool MP4GetTrackESConfiguration (MP4FileHandle hFile, MP4TrackId trackId, uint8_t **ppConfig, uint32_t *pConfigSize)
 
bool MP4SetTrackESConfiguration (MP4FileHandle hFile, MP4TrackId trackId, const uint8_t *pConfig, uint32_t configSize)
 
void MP4FreeH264SeqPictHeaders (uint8_t **pSeqHeaders, uint32_t *pSeqHeaderSize, uint8_t **pPictHeader, uint32_t *pPictHeaderSize)
 Frees the memory allocated by MP4GetTrackH264SeqPictHeaders. More...
 
bool MP4GetTrackH264ProfileLevel (MP4FileHandle hFile, MP4TrackId trackId, uint8_t *pProfile, uint8_t *pLevel)
 
bool MP4GetTrackH264SeqPictHeaders (MP4FileHandle hFile, MP4TrackId trackId, uint8_t ***pSeqHeaders, uint32_t **pSeqHeaderSize, uint8_t ***pPictHeader, uint32_t **pPictHeaderSize)
 
bool MP4GetTrackH264LengthSize (MP4FileHandle hFile, MP4TrackId trackId, uint32_t *pLength)
 
MP4SampleId MP4GetTrackNumberOfSamples (MP4FileHandle hFile, MP4TrackId trackId)
 
uint16_t MP4GetTrackVideoWidth (MP4FileHandle hFile, MP4TrackId trackId)
 
uint16_t MP4GetTrackVideoHeight (MP4FileHandle hFile, MP4TrackId trackId)
 
double MP4GetTrackVideoFrameRate (MP4FileHandle hFile, MP4TrackId trackId)
 
int MP4GetTrackAudioChannels (MP4FileHandle hFile, MP4TrackId trackId)
 
bool MP4IsIsmaCrypMediaTrack (MP4FileHandle hFile, MP4TrackId trackId)
 
bool MP4GetTrackIntegerProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, uint64_t *retvalue)
 
bool MP4GetTrackFloatProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, float *ret_value)
 
bool MP4GetTrackStringProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, const char **retvalue)
 
bool MP4GetTrackBytesProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, uint8_t **ppValue, uint32_t *pValueSize)
 
bool MP4SetTrackIntegerProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, int64_t value)
 
bool MP4SetTrackFloatProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, float value)
 
bool MP4SetTrackStringProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, const char *value)
 
bool MP4SetTrackBytesProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, const uint8_t *pValue, uint32_t valueSize)
 

Detailed Description

Function Documentation

◆ MP4FreeH264SeqPictHeaders()

void MP4FreeH264SeqPictHeaders ( uint8_t **  pSeqHeaders,
uint32_t *  pSeqHeaderSize,
uint8_t **  pPictHeader,
uint32_t *  pPictHeaderSize 
)

Frees the memory allocated by MP4GetTrackH264SeqPictHeaders.

MP4FreeH264SeqPictHeaders frees the memory that was allocated by a call to the MP4GetTrackH264SeqPictHeaders function.

When a client application wants to extract the H.264 video data from an MP4 file it will call MP4GetTrackH264SeqPictHeaders to obtain the sequence and picture parameter sets. These parameter sets are required for decoding a sequence of one, or more, coded slices. When the client application is done with the data it must free it. On the Windows platform this cannot be done directly by the client application because the C runtime of the client application and the C runtime of the mp4v2 DLL may be different, which will result in an error at runtime. This function allows the client application to let the mp4v2 DLL free the memory with the appropriate CRT heap manager.

Parameters
pSeqHeaderspointer to an array of SPS pointers.
pSeqHeaderSizepointer to array of SPS sizes.
pPictHeaderpointer to an array of PPS pointers.
pPictHeaderSizepointer to array of PPS sizes.

◆ MP4GetTrackLanguage()

bool MP4GetTrackLanguage ( MP4FileHandle  hFile,
MP4TrackId  trackId,
char *  code 
)

Get ISO-639-2/T language code of a track.

The language code is a 3-char alpha code consisting of lower-case letters.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
codebuffer to hold 3-char+null (4-bytes total).
Returns
true on success, false on failure.

◆ MP4GetTrackName()

bool MP4GetTrackName ( MP4FileHandle  hFile,
MP4TrackId  trackId,
char **  name 
)

Get track name.

MP4GetTrackName gets the name of the track via udta.name property.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
Returns
true on success, false on failure.

◆ MP4GetTrackTimeScale()

uint32_t MP4GetTrackTimeScale ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the time scale of a track.

MP4GetTrackTimeScale returns the time scale of the specified track in the mp4 file. The time scale determines the number of clock ticks per second for this track.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
Returns
timescale (ticks per second) of the track in the mp4 file.

◆ MP4GetTrackType()

const char* MP4GetTrackType ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the track type.

MP4GetTrackType gets the type of the track with the specified track id.

Note: the library does not provide a MP4SetTrackType function, the track type needs to be specified when the track is created, e.g. MP4AddSystemsTrack(MP4_OCI_TRACK_TYPE).

Known track types are:

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
Returns
On success, a string indicating track type. On failure, NULL.

◆ MP4SetTrackLanguage()

bool MP4SetTrackLanguage ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  code 
)

Set ISO-639-2/T language code of a track.

The language code is a 3-char alpha code consisting of lower-case letters.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
code3-char language code.
Returns
true on success, false on failure.

◆ MP4SetTrackName()

bool MP4SetTrackName ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  name 
)

Set track name.

MP4SetTrackName sets the name of the track via udta.name property. The udta atom is created if needed.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
Returns
true on success, false on failure.

◆ MP4SetTrackTimeScale()

bool MP4SetTrackTimeScale ( MP4FileHandle  hFile,
MP4TrackId  trackId,
uint32_t  value 
)

Set the time scale of a track.

MP4SetTrackTimeScale sets the time scale of the specified track in the mp4 file. The time scale determines the number of clock ticks per second for this track.

Typically this value is set once when the track is created. However this call can be used to modify the value if that is desired. Since track sample durations are expressed in units of the track time scale, any change to the time scale value will effect the real time duration of the samples.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
timeScaledesired time scale for the track.
Returns
true on success, false on failure.