ISOBMFF
ISO Base Media File Format Reference Software Documentation
 
Loading...
Searching...
No Matches
Sample Description functions

Sample Description functions, General, AVC, Metadata, etc. More...

Functions

ISOErr ISONewAVCSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u32 length_size, MP4Handle first_sps, MP4Handle first_pps, MP4Handle first_spsext)
 Create a new AVC sample entry.
 
ISOErr ISOAddVCSampleDescriptionPS (MP4Handle sampleEntryH, MP4Handle ps, u32 where)
 This adds another parameter set (which is not, in fact, inspected), to the configuration.
 
ISOErr ISOGetAVCSampleDescription (MP4Handle sampleEntryH, u32 *dataReferenceIndex, u32 *length_size, u32 *sps_count, u32 *pss_count, u32 *spsext_count)
 Gets the basic parameters of the AVC sample entry.
 
ISOErr ISOGetVCSampleDescriptionPS (MP4Handle sampleEntryH, MP4Handle ps, u32 where, u32 index)
 Gets an AVC parameter set, placing it in the given handle.
 
ISOErr ISOGetHEVCSampleDescriptionPS (MP4Handle sampleEntryH, MP4Handle ps, u32 where, u32 index)
 Gets a HEVC parameter set, placing it in the given handle.
 
ISOErr ISOGetRESVSampleDescriptionPS (MP4Handle sampleEntryH, MP4Handle ps, u32 where, u32 index)
 Gets a restricted video parameter set (AVC or HEVC), placing it in the given handle.
 
ISOErr ISOGetNALUnitLength (MP4Handle sampleEntryH, u32 *out)
 Get the NALUnitLength size in bytes.
 
ISOErr ISOGetRESVOriginalFormat (MP4Handle sampleEntryH, u32 *outOrigFmt)
 Get the four character code of the original un-transformed sample entry.
 
ISOErr ISOGetRESVSchemeType (MP4Handle sampleEntryH, u32 *schemeType, u32 *schemeVersion, char **schemeURI)
 Get scheme_type and scheme_version from the SchemeTypeBox in resv.
 
ISOErr ISOGetRESVSchemeInfoAtom (MP4Handle sampleEntryH, u32 atomType, MP4Handle outAtom)
 Get the box from the SchemeInformationBox in resv.
 
ISOErr ISONewHEVCSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u32 length_size, MP4Handle first_sps, MP4Handle first_pps, MP4Handle first_vps)
 Create a new HEVC sample entry.
 
ISOErr ISONewVVCSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u32 length_size, MP4Handle first_sps, MP4Handle first_pps)
 Create a new VVC sample entry.
 
ISOErr ISOGetVVCSampleDescription (MP4Handle sampleEntryH, u32 *dataReferenceIndex, u32 *length_size, u32 naluType, u32 *count)
 Gets the basic parameters of the VVC sample entry.
 
ISOErr ISOGetVVCNaluNums (MP4Handle sampleEntryH, u32 where, u32 *num_nalus)
 Gets a VVC parameter set, placing it in the given handle.
 
ISOErr ISOGetVVCSampleDescriptionPS (MP4Handle sampleEntryH, MP4Handle ps, u32 where, u32 index)
 Gets a VVC parameter set, placing it in the given handle.
 
ISOErr ISOAddVVCSampleDescriptionPS (MP4Handle sampleEntryH, MP4Handle ps, u32 where)
 This adds another parameter set (which is not, in fact, inspected), to the configuration.
 
ISOErr ISONewVVCSubpicSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u32 width, u32 height, u32 length_size)
 Create a new VVC subpicture (vvs1) sample entry.
 
ISOErr ISOGetVVCSubpicSampleDescription (MP4Handle sampleEntryH, u32 *dataReferenceIndex, u32 *length_size)
 Gets the length size of the VVC subpicture sample entry.
 
MP4Err ISOAddBitrateToSampleDescription (MP4Handle sampleEntryH, u8 is_3GPP, u32 buffersizeDB, u32 maxBitrate, u32 avgBitrate)
 Add a bitrate atom to a sample entry (description).
 
MP4Err ISONewH263SampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u32 vendor, u8 decoder_version, u8 H263_level, u8 H263_profile)
 Creates a new H.263 video sample description according to the 3GPP specifications.
 
MP4Err ISONewAMRSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u8 is_WB, u32 vendor, u8 decoder_version, u16 mode_set, u8 mode_change_period, u8 frames_per_sample)
 Creates a new AMR audio sample description according to the 3GPP specifications.
 
MP4Err ISONewAMRWPSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u32 vendor, u8 decoder_version)
 Creates a new AMR wideband plus audio sample description according to the 3GPP spec.
 
MP4Err MP4GetMediaSampleDescription (MP4Media theMedia, u32 index, MP4Handle outDescriptionH, u32 *outDataReferenceIndex)
 This returns the sample description at the given index, with the data reference index that is associated with it.
 
MP4Err ISONewGeneralSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, u32 sampleEntryType, MP4GenericAtom extensionAtom)
 Create a basic sample description that can be used for calls to MP4AddMediaSamples().
 
MP4Err ISOAddAtomToSampleDescription (MP4Handle sampleEntryH, MP4GenericAtom extensionAtom)
 Add an arbitrary atom to a sample entry (description).
 
MP4Err ISOGetAtomFromSampleDescription (MP4Handle sampleEntryH, u32 atomType, MP4GenericAtom *outAtom)
 Find the atom of the given type and return it.
 
MP4Err ISONewXMLMetaDataSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, char *content_encoding, char *xml_namespace, char *schema_location)
 Make a sample description for a timed XML meta-data track.
 
MP4Err ISONewTextMetaDataSampleDescription (MP4Track theTrack, MP4Handle sampleDescriptionH, u32 dataReferenceIndex, char *content_encoding, char *mime_format)
 Make a sample description for a timed text meta-data track.
 
MP4Err ISOSetSampleDescriptionDimensions (MP4Handle sampleEntryH, u16 width, u16 height)
 This function sets the visual width and height of a sample description.
 
MP4Err ISOSetSampleDescriptionType (MP4Handle sampleEntryH, u32 type)
 (Re)set the type of a sample description.
 
MP4Err ISOGetSampleDescriptionDimensions (MP4Handle sampleEntryH, u16 *width, u16 *height)
 This function gets the visual width and height of a sample description.
 
MP4Err ISOGetSampleDescriptionType (MP4Handle sampleEntryH, u32 *type)
 This function returns the type of a sample description.
 

Detailed Description

Sample Description functions, General, AVC, Metadata, etc.

Function Documentation

◆ ISOAddAtomToSampleDescription()

MP4Err ISOAddAtomToSampleDescription ( MP4Handle  sampleEntryH,
MP4GenericAtom  extensionAtom 
)

Add an arbitrary atom to a sample entry (description).

Parameters
sampleEntryHsample entry handle
extensionAtomatom to add to the sample entry

◆ ISOAddVCSampleDescriptionPS()

ISOErr ISOAddVCSampleDescriptionPS ( MP4Handle  sampleEntryH,
MP4Handle  ps,
u32  where 
)

This adds another parameter set (which is not, in fact, inspected), to the configuration.

Parameters
wherecan be AVCsps, AVCpps or AVCspsext.

◆ ISOAddVVCSampleDescriptionPS()

ISOErr ISOAddVVCSampleDescriptionPS ( MP4Handle  sampleEntryH,
MP4Handle  ps,
u32  where 
)

This adds another parameter set (which is not, in fact, inspected), to the configuration.

Parameters
psinput handle which is saving the parameter set.
wherecan be VVC vps, sps, pps, dci, opi, prefix APS, prefix SEI.

◆ ISOGetAtomFromSampleDescription()

MP4Err ISOGetAtomFromSampleDescription ( MP4Handle  sampleEntryH,
u32  atomType,
MP4GenericAtom outAtom 
)

Find the atom of the given type and return it.

Parameters
sampleEntryHsample entry to look into
atomTypeatom type to search for
outAtomoutput atom of a given type

◆ ISOGetHEVCSampleDescriptionPS()

ISOErr ISOGetHEVCSampleDescriptionPS ( MP4Handle  sampleEntryH,
MP4Handle  ps,
u32  where,
u32  index 
)

Gets a HEVC parameter set, placing it in the given handle.

Parameters
sampleEntryHinput sample entry handle
psoutput handle which is holding the parameter set.
wherecan be HEVCvps, HEVCsps or HEVCpps
indexthe indexes start at 1 (1 is the first parameter set in the indicated array).

◆ ISOGetRESVOriginalFormat()

ISOErr ISOGetRESVOriginalFormat ( MP4Handle  sampleEntryH,
u32 *  outOrigFmt 
)

Get the four character code of the original un-transformed sample entry.

Todo:
rename the function to ISOGetOriginalFormat and parse the cinf and sinf as well

◆ ISOGetRESVSampleDescriptionPS()

ISOErr ISOGetRESVSampleDescriptionPS ( MP4Handle  sampleEntryH,
MP4Handle  ps,
u32  where,
u32  index 
)

Gets a restricted video parameter set (AVC or HEVC), placing it in the given handle.

Parameters
sampleEntryHinput sample entry handle
psoutput handle which is holding the parameter set.
wherecan be AVCsps, AVCpps, AVCspsext, HEVCvps, HEVCsps or HEVCpps
indexthe indexes start at 1 (1 is the first parameter set in the indicated array).

◆ ISOGetRESVSchemeInfoAtom()

ISOErr ISOGetRESVSchemeInfoAtom ( MP4Handle  sampleEntryH,
u32  atomType,
MP4Handle  outAtom 
)

Get the box from the SchemeInformationBox in resv.

Parameters
sampleEntryHresv sample entry data
atomTypetype of the atom inside SchemeInformationBox
outAtom[out] data of the found box

◆ ISOGetRESVSchemeType()

ISOErr ISOGetRESVSchemeType ( MP4Handle  sampleEntryH,
u32 *  schemeType,
u32 *  schemeVersion,
char **  schemeURI 
)

Get scheme_type and scheme_version from the SchemeTypeBox in resv.

Parameters
sampleEntryHresv sample entry data
schemeType[out] scheme_type 4CC
schemeVersion[out] scheme_version
schemeURI[out] scheme_uri

◆ ISOGetVCSampleDescriptionPS()

ISOErr ISOGetVCSampleDescriptionPS ( MP4Handle  sampleEntryH,
MP4Handle  ps,
u32  where,
u32  index 
)

Gets an AVC parameter set, placing it in the given handle.

Parameters
sampleEntryHinput sample entry handle
psoutput handle which is holding the parameter set.
wherecan be AVCsps, AVCpps or AVCspsext.
indexthe indexes start at 1 (1 is the first parameter set in the indicated array).

◆ ISOGetVVCNaluNums()

ISOErr ISOGetVVCNaluNums ( MP4Handle  sampleEntryH,
u32  where,
u32 *  num_nalus 
)

Gets a VVC parameter set, placing it in the given handle.

Parameters
sampleEntryHinput sample entry handle
wherecan be VVC vps, sps, pps, dci, opi, prefix APS, prefix SEI.
num_nalusoutput the number of nalus in the corresponding parameter set.

◆ ISOGetVVCSampleDescription()

ISOErr ISOGetVVCSampleDescription ( MP4Handle  sampleEntryH,
u32 *  dataReferenceIndex,
u32 *  length_size,
u32  naluType,
u32 *  count 
)

Gets the basic parameters of the VVC sample entry.

Parameters
sampleEntryHinput sample entry handle
dataReferenceIndexoutput dataReferenceIndex
length_sizeoutput length size: the size of the NAL Unit length field (and must be 1, 2 or 4). The value of length_size = LengthSizeMinusOne + 1
naluTypeinput NAL unit type (must be one of 12, 13, 14, 15, 16, 17, 23)
countoutput the number of nalus with type =
naluType,ifthere is no nalu, output 0

◆ ISOGetVVCSampleDescriptionPS()

ISOErr ISOGetVVCSampleDescriptionPS ( MP4Handle  sampleEntryH,
MP4Handle  ps,
u32  where,
u32  index 
)

Gets a VVC parameter set, placing it in the given handle.

Parameters
sampleEntryHinput sample entry handle
psoutput handle which is holding the parameter set.
wherecan be VVC vps, sps, pps, dci, opi, prefix APS, prefix SEI.
indexthe indexes start at 1 (1 is the first parameter set in the indicated array).

◆ ISOGetVVCSubpicSampleDescription()

ISOErr ISOGetVVCSubpicSampleDescription ( MP4Handle  sampleEntryH,
u32 *  dataReferenceIndex,
u32 *  length_size 
)

Gets the length size of the VVC subpicture sample entry.

Parameters
sampleEntryHinput sample entry handle
dataReferenceIndexoutput dataReferenceIndex
length_sizeoutput length size: the size of the NAL Unit length field (and must be 1, 2 or 4). The value of length_size = LengthSizeMinusOne + 1

◆ ISONewAVCSampleDescription()

ISOErr ISONewAVCSampleDescription ( MP4Track  theTrack,
MP4Handle  sampleDescriptionH,
u32  dataReferenceIndex,
u32  length_size,
MP4Handle  first_sps,
MP4Handle  first_pps,
MP4Handle  first_spsext 
)

Create a new AVC sample entry.

Note
You almost certainly will need to set the sample description width and height, after calling this function.
Parameters
length_sizethe size of the NAL Unit length field (and must be 1, 2 or 4). The value of length_size = lengthSizeMinusOne + 1
first_spsThe sequence parameter set (MUST be passed) used to get the profile, level, etc. It will only be added to the configuration if a picture parameter set is also present.
first_ppspicture parameter set. Can be NULL.
first_spsextsequence extension parameter set, only used if an appropriate profile is used, of course. Can be NULL.

◆ ISONewGeneralSampleDescription()

MP4Err ISONewGeneralSampleDescription ( MP4Track  theTrack,
MP4Handle  sampleDescriptionH,
u32  dataReferenceIndex,
u32  sampleEntryType,
MP4GenericAtom  extensionAtom 
)

Create a basic sample description that can be used for calls to MP4AddMediaSamples().

This will create the proper kind of sample entry atom for the track type.

Parameters
theTrackinput track
sampleDescriptionHThe handle that will contain the new sample description.
dataReferenceIndexThe index of the data reference that describes the media samples. If you haven’t called MP4AddMediaDataReference() this parameter should be set to 1. Otherwise set it to the proper reference index for these samples.
sampleEntryTypeThe four-character-code for the type of sample entry. Use a pre-defined type or the macro MP4_FOUR_CHAR_CODE(), which takes four single character arguments.
extensionAtomYou can supply an extra atom to be placed into the sample entry here.

◆ ISONewHEVCSampleDescription()

ISOErr ISONewHEVCSampleDescription ( MP4Track  theTrack,
MP4Handle  sampleDescriptionH,
u32  dataReferenceIndex,
u32  length_size,
MP4Handle  first_sps,
MP4Handle  first_pps,
MP4Handle  first_vps 
)

Create a new HEVC sample entry.

Parameters
length_sizethe size of the NAL Unit length field (and must be 1, 2 or 4). The value of length_size = lengthSizeMinusOne + 1
first_spsThe sequence parameter set (MUST be passed) used to get the profile, level, etc.
first_ppspicture parameter set.
first_vpsvideo parameter set.

◆ ISONewTextMetaDataSampleDescription()

MP4Err ISONewTextMetaDataSampleDescription ( MP4Track  theTrack,
MP4Handle  sampleDescriptionH,
u32  dataReferenceIndex,
char *  content_encoding,
char *  mime_format 
)

Make a sample description for a timed text meta-data track.

Parameters
theTrack
sampleDescriptionH
dataReferenceIndex
content_encoding
mime_format

◆ ISONewVVCSampleDescription()

ISOErr ISONewVVCSampleDescription ( MP4Track  theTrack,
MP4Handle  sampleDescriptionH,
u32  dataReferenceIndex,
u32  length_size,
MP4Handle  first_sps,
MP4Handle  first_pps 
)

Create a new VVC sample entry.

Note
implement me
Parameters
length_sizethe size of the NAL Unit length field (and must be 1, 2 or 4). The value of length_size = LengthSizeMinusOne + 1
first_spsThe sequence parameter set (MUST be passed) used to get the profile, level, etc. It will only be added to the configuration if a picture parameter set is also present.
otherps implement me

◆ ISONewVVCSubpicSampleDescription()

ISOErr ISONewVVCSubpicSampleDescription ( MP4Track  theTrack,
MP4Handle  sampleDescriptionH,
u32  dataReferenceIndex,
u32  width,
u32  height,
u32  length_size 
)

Create a new VVC subpicture (vvs1) sample entry.

including a NALUconfigAtom (vvnC)

Parameters
widthindicate the width of subpicture
heightindicate the height of subpicture
length_sizethe size of the NAL Unit length field (and must be 1, 2 or 4). The value of length_size = LengthSizeMinusOne + 1

◆ ISONewXMLMetaDataSampleDescription()

MP4Err ISONewXMLMetaDataSampleDescription ( MP4Track  theTrack,
MP4Handle  sampleDescriptionH,
u32  dataReferenceIndex,
char *  content_encoding,
char *  xml_namespace,
char *  schema_location 
)

Make a sample description for a timed XML meta-data track.

Parameters
theTrack
sampleDescriptionH
dataReferenceIndex
content_encoding
xml_namespace
schema_location

◆ ISOSetSampleDescriptionType()

MP4Err ISOSetSampleDescriptionType ( MP4Handle  sampleEntryH,
u32  type 
)

(Re)set the type of a sample description.

Attention
do not set the type away from, and back to, an MPEG-4 type, or the elementary stream descriptor atom will be lost.

◆ MP4GetMediaSampleDescription()

MP4Err MP4GetMediaSampleDescription ( MP4Media  theMedia,
u32  index,
MP4Handle  outDescriptionH,
u32 *  outDataReferenceIndex 
)

This returns the sample description at the given index, with the data reference index that is associated with it.

Parameters
theMediainput media object
indexdescription index starting with 1
outDescriptionHoutput description handle
outDataReferenceIndex
Returns
MP4Err error code