MP4v2
Functions
MP4v2 Track Properties

Functions

const char * MP4GetTrackType (MP4FileHandle hFile, MP4TrackId trackId)
 Get the track type. More...
 
const char * MP4GetTrackMediaDataName (MP4FileHandle hFile, MP4TrackId trackId)
 Get the name of the track's media data atom. More...
 
bool MP4GetTrackMediaDataOriginalFormat (MP4FileHandle hFile, MP4TrackId trackId, char *originalFormat, uint32_t buflen)
 Get the name of an encrypted track's original media data atom. More...
 
MP4Duration MP4GetTrackDuration (MP4FileHandle hFile, MP4TrackId trackId)
 Get the duration of a track. More...
 
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)
 Get the encoding type of an MPEG-4 audio track. More...
 
uint8_t MP4GetTrackEsdsObjectTypeId (MP4FileHandle hFile, MP4TrackId trackId)
 Get the encoding object type id from a track's esds atom. More...
 
MP4Duration MP4GetTrackFixedSampleDuration (MP4FileHandle hFile, MP4TrackId trackId)
 Get the fixed duration of samples in a track. More...
 
uint32_t MP4GetTrackBitRate (MP4FileHandle hFile, MP4TrackId trackId)
 Get the average bit rate in bits per second of the specified track. More...
 
bool MP4GetTrackVideoMetadata (MP4FileHandle hFile, MP4TrackId trackId, uint8_t **ppConfig, uint32_t *pConfigSize)
 
bool MP4GetTrackESConfiguration (MP4FileHandle hFile, MP4TrackId trackId, uint8_t **ppConfig, uint32_t *pConfigSize)
 Get the elementary stream (ES) configuration of a track. More...
 
bool MP4SetTrackESConfiguration (MP4FileHandle hFile, MP4TrackId trackId, const uint8_t *pConfig, uint32_t configSize)
 Set the elementary stream (ES) configuration of a track. 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)
 
void MP4FreeH264SeqPictHeaders (uint8_t **pSeqHeaders, uint32_t *pSeqHeaderSize, uint8_t **pPictHeader, uint32_t *pPictHeaderSize)
 Frees the memory allocated by MP4GetTrackH264SeqPictHeaders. More...
 
bool MP4GetTrackH264LengthSize (MP4FileHandle hFile, MP4TrackId trackId, uint32_t *pLength)
 
MP4SampleId MP4GetTrackNumberOfSamples (MP4FileHandle hFile, MP4TrackId trackId)
 Get the number of samples in a track. More...
 
uint16_t MP4GetTrackVideoWidth (MP4FileHandle hFile, MP4TrackId trackId)
 Get the video width in pixels of the specified video track. More...
 
uint16_t MP4GetTrackVideoHeight (MP4FileHandle hFile, MP4TrackId trackId)
 Get the video height in pixels of the specified video track. More...
 
double MP4GetTrackVideoFrameRate (MP4FileHandle hFile, MP4TrackId trackId)
 Get the video frame rate of the specified video track. More...
 
int MP4GetTrackAudioChannels (MP4FileHandle hFile, MP4TrackId trackId)
 Get the number of channels of the specified audio track. More...
 
bool MP4IsIsmaCrypMediaTrack (MP4FileHandle hFile, MP4TrackId trackId)
 Check whether a track is ISMACrypt encrypted. More...
 
bool MP4HaveTrackAtom (MP4FileHandle hFile, MP4TrackId trackId, const char *atomName)
 Check for presence of a track atom. More...
 
bool MP4GetTrackIntegerProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, uint64_t *retVal)
 Get the value of an integer property for a track. More...
 
bool MP4GetTrackFloatProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, float *retVal)
 Get the value of a float property for a track. More...
 
bool MP4GetTrackStringProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, const char **retVal)
 Get the value of a string property for a track. More...
 
bool MP4GetTrackBytesProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, uint8_t **ppValue, uint32_t *pValueSize)
 Get the value of a bytes property for a track. More...
 
bool MP4SetTrackIntegerProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, int64_t value)
 Set the value of an integer property for a track. More...
 
bool MP4SetTrackFloatProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, float value)
 Set the value of a float property for a track. More...
 
bool MP4SetTrackStringProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, const char *value)
 Set the value of a string property for a track. More...
 
bool MP4SetTrackBytesProperty (MP4FileHandle hFile, MP4TrackId trackId, const char *propName, const uint8_t *pValue, uint32_t valueSize)
 Set the value of a bytes property for a track. More...
 

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.

◆ MP4GetTrackAudioChannels()

int MP4GetTrackAudioChannels ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the number of channels of the specified audio track.

MP4GetTrackAudioChannels returns the number of audio channels in the specified track in the mp4 file.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the number of audio channels is desired.
Returns
Upon success, the number of audio channels of the track. Upon an error, -1.

◆ MP4GetTrackAudioMpeg4Type()

uint8_t MP4GetTrackAudioMpeg4Type ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the encoding type of an MPEG-4 audio track.

MP4GetTrackAudioMpeg4Type returns the MPEG-4 encoding type of the specified MPEG-4 audio track in the mp4 file. If an mp4 audio track has type MP4_MPEG4_AUDIO_TYPE, this call can be used to determine which specific MPEG-4 audio encoding is contained in the track.

Known MPEG-4 audio encoding types are:

Type Description
MP4_MPEG4_AAC_MAIN_AUDIO_TYPE MPEG-4 AAC Main profile
MP4_MPEG4_AAC_LC_AUDIO_TYPE MPEG-4 AAC Low Complexity profile
MP4_MPEG4_AAC_SSR_AUDIO_TYPE MPEG-4 AAC SSR profile
MP4_MPEG4_AAC_LTP_AUDIO_TYPE MPEG-4 AAC Long Term Prediction profile
MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE MPEG-4 AAC Scalable
MP4_MPEG4_CELP_AUDIO_TYPE MPEG-4 CELP
MP4_MPEG4_HVXC_AUDIO_TYPE MPEG-4 HVXC
MP4_MPEG4_TTSI_AUDIO_TYPE MPEG-4 Text To Speech
MP4_MPEG4_MAIN_SYNTHETIC_AUDIO_TYPE MPEG-4 Main Synthetic profile
MP4_MPEG4_WAVETABLE_AUDIO_TYPE MPEG-4 Wavetable Synthesis profile
MP4_MPEG4_MIDI_AUDIO_TYPE MPEG-4 MIDI profile
MP4_MPEG4_ALGORITHMIC_FX_AUDIO_TYPE MPEG-4 Algorithmic Synthesis and Audio FX profile

Note: This information is retrieved from the audio track ES configuration.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the MPEG-4 audio type is desired.
Returns
Upon success, the MPEG-4 audio type of the track. Upon error, MP4_MPEG4_INVALID_AUDIO_TYPE is returned.
See also
MP4GetTrackAudioType()

◆ MP4GetTrackBitRate()

uint32_t MP4GetTrackBitRate ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the average bit rate in bits per second of the specified track.

MP4GetTrackBitRate returns the average bit rate in bits per second in the specified track in the mp4 file.

Note: hint tracks will not return their bit rate via this mechanism.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the bit rate is desired.
Returns
Upon success, the average bit rate in bits per second of the track. Upon an error, 0.

◆ MP4GetTrackBytesProperty()

bool MP4GetTrackBytesProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
uint8_t **  ppValue,
uint32_t *  pValueSize 
)

Get the value of a bytes property for a track.

MP4GetTrackBytesProperty determines the value of the bytes property identified by propName, e.g. "tkhd.matrix", for the track identified by trackId. 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
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to get.
ppValuepointer to a variable to receive the memory location containing the property bytes.
pValueSizepointer to a variable to receive the length of the property bytes value.
Returns
true (1) on success, false (0) otherwise.

◆ MP4GetTrackDuration()

MP4Duration MP4GetTrackDuration ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the duration of a track.

MP4GetTrackDuration returns the total duration of all the samples in the specified track in the mp4 file.

Caveat: The value is in units of the track time scale.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the duration is desired.
Returns
The duration in track time scale units of the track in the mp4 file.

◆ MP4GetTrackESConfiguration()

bool MP4GetTrackESConfiguration ( MP4FileHandle  hFile,
MP4TrackId  trackId,
uint8_t **  ppConfig,
uint32_t *  pConfigSize 
)

Get the elementary stream (ES) configuration of a track.

MP4GetTrackESConfiguration returns the elementary stream (ES) configuration of the specified track in the mp4 file. This information is codec specific and contains the configuration necessary for the given codec to decode the samples in the track.

Caveat: the returned block of memory has been allocated by the library. The caller may safely modify the value without effecting the library, but the caller takes responsiblity for freeing the memory with MP4Free().

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the ES configuration is desired.
ppConfigspecifies a pointer to a pointer variable that will be given the address of the configuration information.
pConfigSizespecifies a pointer to a variable to hold the size of the ES configuration information.
Returns
Upon success, *ppConfig will point to a newly allocated block of memory with the ES configuration, and *pConfigSize will indicated the number of bytes of the ES configuration. Upon error, *ppConfig will be NULL, and *pConfigSize will be 0.
See also
MP4SetTrackESConfiguration()

◆ MP4GetTrackEsdsObjectTypeId()

uint8_t MP4GetTrackEsdsObjectTypeId ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the encoding object type id from a track's esds atom.

MP4GetTrackEsdsObjectTypeId returns the encoding object type of the specified audio or video track in the mp4 file.

Known audio object types are:

Type Description
MP4_MPEG1_AUDIO_TYPE MPEG-1 Audio Layers I, II, & III
MP4_MPEG2_AUDIO_TYPE MPEG-2 low bitrate extensions to MPEG-1 Audio
MP4_MP3_AUDIO_TYPE is an alias for this value
MP4_MPEG2_AAC_MAIN_AUDIO_TYPE MPEG-2 AAC Main profile
MP4_MPEG2_AAC_LC_AUDIO_TYPE MPEG-2 AAC Low Complexity profile
MP4_MPEG2_AAC_SSR_AUDIO_TYPE MPEG-2 AAC SSR profile
MP4_MPEG4_AUDIO_TYPE MPEG-4 Audio, includes MPEG-4 extensions to AAC
MP4_PRIVATE_AUDIO_TYPE User private type

Known video object types are:

Type Description
MP4_MPEG1_VIDEO_TYPE MPEG-1 Video
MP4_MPEG2_SIMPLE_VIDEO_TYPE MPEG-2 Simple Profile Video
MP4_MPEG2_MAIN_VIDEO_TYPE MPEG-2 Main Profile Video (Broadcast/DVD)
MP4_MPEG2_SNR_VIDEO_TYPE MPEG-2 SNR Profile Video
MP4_MPEG2_SPATIAL_VIDEO_TYPE MPEG-2 Spatial Scalability Profile Video
MP4_MPEG2_HIGH_VIDEO_TYPE MPEG-2 High Profile Video (HDTV)
MP4_MPEG2_442_VIDEO_TYPE MPEG-2 442 Profile Video (Studio)
MP4_MPEG4_VIDEO_TYPE MPEG-4 Video
MP4_JPEG_VIDEO_TYPE JPEG stills or motion JPEG
MP4_PRIVATE_VIDEO_TYPE User private type
Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the encoding object type is desired.
Returns
Upon success, the encoding object type of the track. Upon error, MP4_INVALID_AUDIO_TYPE is returned.

◆ MP4GetTrackFixedSampleDuration()

MP4Duration MP4GetTrackFixedSampleDuration ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the fixed duration of samples in a track.

MP4GetTrackFixedSampleDuration returns the duration of samples in the specified track in the mp4 file, if this value is fixed for all samples. This is typically the case for audio tracks and video tracks. If the track samples have variable duration, then MP4_INVALID_DURATION is returned.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track to which the operation applies.
Returns
Upon success, the number of fixed duration of the samples in the track in track time scale units. Upon an error, MP4_INVALID_DURATION.

◆ MP4GetTrackFloatProperty()

bool MP4GetTrackFloatProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
float *  retVal 
)

Get the value of a float property for a track.

MP4GetTrackFloatProperty determines the value of the float property identified by propName, e.g. "tkhd.volume", for the track identified by trackId. The value is stored in the variable pointed to by retVal.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to get.
retValpointer to a variable to receive the return value.
Returns
true (1) on success, false (0) otherwise.

◆ MP4GetTrackIntegerProperty()

bool MP4GetTrackIntegerProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
uint64_t *  retVal 
)

Get the value of an integer property for a track.

MP4GetTrackIntegerProperty determines the value of the integer property identified by propName, e.g. "tkhd.layer", for the track identified by trackId. The value is stored in the variable pointed to by retVal.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to get.
retValpointer to a variable to receive the return value.
Returns
true (1) on success, false (0) otherwise.

◆ 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.

◆ MP4GetTrackMediaDataName()

const char* MP4GetTrackMediaDataName ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the name of the track's media data atom.

MP4GetTrackMediaDataName returns the four character name of the specified track's media data atom, i.e. the child atom of the track's stsd atom.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the media data atom name is desired.
Returns
The name of the track's media data atom or NULL in case of an error.

◆ MP4GetTrackMediaDataOriginalFormat()

bool MP4GetTrackMediaDataOriginalFormat ( MP4FileHandle  hFile,
MP4TrackId  trackId,
char *  originalFormat,
uint32_t  buflen 
)

Get the name of an encrypted track's original media data atom.

MP4GetTrackMediaDataOriginalFormat is used to get the original media data atom name if a track has been encrypted. The track identified by trackId must be an encrypted track with encv as the media data name returned by MP4GetTrackMediaDataName.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the encoded track for which the original media data atom name is desired.
originalFormatspecifies a buffer to receive the original media data atom name.
buflenspecifies the size of the buffer pointed to by originalFormat.
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.

The memory to store the track name is allocated by the library, so the caller is responsible for freeing it with MP4Free().

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
namepointer to a variable to receive the track name.
Returns
true on success, false on failure.

◆ MP4GetTrackNumberOfSamples()

MP4SampleId MP4GetTrackNumberOfSamples ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the number of samples in a track.

MP4GetTrackNumberOfSamples returns the number of samples in the specified track in the mp4 file. Sample id's are the consecutive sequence of numbers from 1 to the total number of samples, i.e. 1-based indexing, not 0-based indexing.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the number of samples is desired.
Returns
Upon success, the number of samples in the track. Upon an error, 0.

◆ MP4GetTrackStringProperty()

bool MP4GetTrackStringProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
const char **  retVal 
)

Get the value of a string property for a track.

MP4GetTrackStringProperty determines the value of the string property identified by propName, e.g. "udta.hnti.sdp .sdpText", for the track identified by trackId. The value is stored in the variable pointed to by retVal.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to get.
retValpointer to a variable to receive the return value.
Returns
true (1) on success, false (0) otherwise.

◆ 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:

@li #MP4_OD_TRACK_TYPE
@li #MP4_SCENE_TRACK_TYPE
@li #MP4_AUDIO_TRACK_TYPE
@li #MP4_VIDEO_TRACK_TYPE
@li #MP4_HINT_TRACK_TYPE
@li #MP4_CNTL_TRACK_TYPE
@li #MP4_TEXT_TRACK_TYPE
@li #MP4_CLOCK_TRACK_TYPE
@li #MP4_MPEG7_TRACK_TYPE
@li #MP4_OCI_TRACK_TYPE
@li #MP4_IPMP_TRACK_TYPE
@li #MP4_MPEGJ_TRACK_TYPE
Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
Returns
On success, a string indicating track type. On failure, NULL.

◆ MP4GetTrackVideoFrameRate()

double MP4GetTrackVideoFrameRate ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the video frame rate of the specified video track.

MP4GetTrackVideoFrameRate returns the frame rate of the video in the specified track in the mp4 file. If the video is variable rate, the average frame rate is returned.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the video frame rate is desired.
Returns
Upon success, the number of video frames per second of the track. Upon an error, 0.

◆ MP4GetTrackVideoHeight()

uint16_t MP4GetTrackVideoHeight ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the video height in pixels of the specified video track.

MP4GetTrackVideoHeight returns the height of the video in pixels in the specified track in the mp4 file.

Caveat: Not all mp4 implementations set this value accurately. The mp4 specification states that the authoritative values are contained in the track ES configuration which is video encoding specific, and hence not interpretable by the mp4 library.

If the value of 240 is returned, care should be taken to verify the accuracy of this value since this is the default value in the mp4 specification.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the video height is desired.
Returns
Upon success, the number of pixels of the video height in the track. Upon an error, 0.
See also
MP4GetTrackVideoWidth()
MP4GetTrackESConfiguration()

◆ MP4GetTrackVideoWidth()

uint16_t MP4GetTrackVideoWidth ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Get the video width in pixels of the specified video track.

MP4GetTrackVideoWidth returns the width of the video in pixels in the specified track in the mp4 file.

Caveat: Not all mp4 implementations set this value accurately. The mp4 specification states that the authoritative values are contained in the track ES configuration which is video encoding specific, and hence not interpretable by the mp4 library.

If the value of 320 is returned, care should be taken to verify the accuracy of this value since this is the default value in the mp4 specification.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the video width is desired.
Returns
Upon success, the number of pixels of the video width in the track. Upon an error, 0.
See also
MP4GetTrackVideoHeight()
MP4GetTrackESConfiguration()

◆ MP4HaveTrackAtom()

bool MP4HaveTrackAtom ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  atomName 
)

Check for presence of a track atom.

MP4HaveTrackAtom checks for the presence of the track atom passed in atomName. atomName can specify an atom path to check for atoms that are not direct children of the trak atom, e.g. "mdia.minf.stbl".

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
atomNamename of the atom to check for.
Returns
true (1) if the atom is present, false (0) otherwise.

◆ MP4IsIsmaCrypMediaTrack()

bool MP4IsIsmaCrypMediaTrack ( MP4FileHandle  hFile,
MP4TrackId  trackId 
)

Check whether a track is ISMACrypt encrypted.

MP4IsIsmaCrypMediaTrack checks whether the specified track is encrypted using ISMACrypt.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdspecifies the track for which the information is desired.
Returns
true (1) if the track is ISMACrypt encrypted, false (0) otherwise.

◆ MP4SetTrackBytesProperty()

bool MP4SetTrackBytesProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
const uint8_t *  pValue,
uint32_t  valueSize 
)

Set the value of a bytes property for a track.

MP4SetTrackBytesProperty sets the value of the bytes property identified by propName, e.g. "tkhd.matrix", for the track identified by trackId.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to set.
pValuepointer the bytes representing the new value of the property.
valueSizethe size of the bytes value pointed to by pValue.
Returns
true (1) on success, false (0) otherwise.

◆ MP4SetTrackESConfiguration()

bool MP4SetTrackESConfiguration ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const uint8_t *  pConfig,
uint32_t  configSize 
)

Set the elementary stream (ES) configuration of a track.

MP4SetTrackESConfiguration sets the elementary stream (ES) configuration of the specified track in the mp4 file. This information is codec specific and contains the configuration necessary for the given codec to decode the samples in the track.

Parameters
hFilespecifies the mp4 file to which the operation applies.
trackIdthe track to which the operation applies.
pConfigspecifies a pointer to the ES configuration information.
configSizespecifies the size of the ES configuration information.
Returns
Upon success, true (1). Upon an error, false (0).
See also
MP4GetTrackESConfiguration()

◆ MP4SetTrackFloatProperty()

bool MP4SetTrackFloatProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
float  value 
)

Set the value of a float property for a track.

MP4SetTrackFloatProperty sets the value of the float property identified by propName, e.g. "tkhd.volume", for the track identified by trackId.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to set.
valuethe new value of the property.
Returns
true (1) on success, false (0) otherwise.

◆ MP4SetTrackIntegerProperty()

bool MP4SetTrackIntegerProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
int64_t  value 
)

Set the value of an integer property for a track.

MP4SetTrackIntegerProperty sets the value of the integer property identified by propName, e.g. "tkhd.layer", for the track identified by trackId.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to set.
valuethe new value of the property.
Returns
true (1) on success, false (0) otherwise.

◆ 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.
namethe name to set as the track name.
Returns
true on success, false on failure.

◆ MP4SetTrackStringProperty()

bool MP4SetTrackStringProperty ( MP4FileHandle  hFile,
MP4TrackId  trackId,
const char *  propName,
const char *  value 
)

Set the value of a string property for a track.

MP4SetTrackStringProperty sets the value of the string property identified by propName, e.g. "udta.hnti.sdp .sdpText", for the track identified by trackId.

Parameters
hFilehandle of file for operation.
trackIdid of track for operation.
propNamepath to the property to set.
valuethe new value of the property.
Returns
true (1) on success, false (0) otherwise.

◆ 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.
valuedesired time scale for the track.
Returns
true on success, false on failure.