Functions to operate with ISOMovie/MP4Movie objects. More...
Functions | |
ISOErr | MJ2SetMovieMatrix (ISOMovie theMovie, u32 matrix[9]) |
This sets the matrix of the overall movie. | |
ISOErr | MJ2GetMovieMatrix (ISOMovie theMovie, u32 outMatrix[9]) |
This returns the overall transformation matrix for the movie. | |
ISOErr | MJ2SetMoviePreferredRate (ISOMovie theMovie, u32 rate) |
This sets the rate of the movie (the normal and default rate is 1.0). | |
ISOErr | MJ2GetMoviePreferredRate (ISOMovie theMovie, u32 *outRate) |
This returns the currently set movie preferred rate. | |
ISOErr | MJ2SetMoviePreferredVolume (ISOMovie theMovie, s16 volume) |
This sets the normal volume of the movie. | |
ISOErr | MJ2GetMoviePreferredVolume (ISOMovie theMovie, s16 *outVolume) |
This returns the movie volume setting. | |
ISOErr | MJ2NewMovie (ISOMovie *outMovie) |
Creates a new empty Motion JPEG 2000 Movie in memory. | |
ISOErr | New3GPPMovie (ISOMovie *outMovie, u16 release) |
Creates a new empty 3GPP Movie in memory, and sets the brand to the indicated release (4, 5 or 6). | |
ISOErr | ISOWriteMovieToFile (ISOMovie theMovie, const char *filename) |
Writes the in-memory Movie to a file. | |
ISOErr | ISOSetMovieBrand (ISOMovie theMovie, u32 brand, u32 minorversion) |
Sets the Movie’s major brand. | |
ISOErr | ISOSetMovieCompatibleBrand (ISOMovie theMovie, u32 brand) |
Adds a minor brand into the compatible brands list of the Movie. | |
ISOErr | ISOGetMovieBrand (ISOMovie theMovie, u32 *brand, u32 *minorversion) |
Returns the Movie’s major brand and minor version. | |
ISOErr | ISOIsMovieCompatibleBrand (ISOMovie theMovie, u32 brand) |
If the brand is a compatible brand of the movie, this returns MP4NoErr, otherwise it returns MP4NotFoundErr. | |
MP4Err | MP4DisposeMovie (MP4Movie theMovie) |
This function releases any resources owned by the Movie. | |
MP4Err | MP4GetMovieDuration (MP4Movie theMovie, u64 *outDuration) |
This calculates and returns the movie duration as recorded in the movie header. | |
MP4Err | MP4GetMovieInitialObjectDescriptor (MP4Movie theMovie, MP4Handle outDescriptorH) |
Retrieves the initial object descriptor from a Movie and places it into a Handle. | |
MP4Err | MP4GetMovieInitialObjectDescriptorUsingSLConfig (MP4Movie theMovie, MP4SLConfig slconfig, MP4Handle outDescriptorH) |
Retrieves the initial object descriptor from a Movie. | |
MP4Err | MP4GetMovieIODInlineProfileFlag (MP4Movie theMovie, u8 *outFlag) |
Queries the setting of includeInlineProfileLevelFlag from the movie's initial object descriptor. | |
MP4Err | MP4GetMovieProfilesAndLevels (MP4Movie theMovie, u8 *outOD, u8 *outScene, u8 *outAudio, u8 *outVisual, u8 *outGraphics) |
Use this to obtain the profiles and levels from a Movie's initial object descriptor. | |
MP4Err | MP4GetMovieTimeScale (MP4Movie theMovie, u32 *outTimeScale) |
Use this to obtain the time scale of a Movie. | |
MP4Err | MP4GetMovieTrack (MP4Movie theMovie, u32 trackID, MP4Track *outTrack) |
Use this to obtain a track given its track ID. | |
MP4Err | MP4AddAtomToMovie (MP4Movie theMovie, MP4GenericAtom the_atom) |
Adds the given atom to the movie. | |
MP4Err | MP4NewMovie (MP4Movie *outMovie, u32 initialODID, u8 OD_profileAndLevel, u8 scene_profileAndLevel, u8 audio_profileAndLevel, u8 visual_profileAndLevel, u8 graphics_profileAndLevel) |
Creates a new empty Movie in memory. | |
MP4Err | MP4NewMovieFromHandle (MP4Movie *outMovie, MP4Handle movieH, u32 newMovieFlags) |
Parses a movie ‘file’ in the handle and creates a Movie in memory from this file. | |
MP4Err | NewMPEG21 (MP4Movie *outMovie) |
Creates a new empty MPEG-21 ‘movie’ in memory. | |
MP4Err | ISONewMetaMovie (MP4Movie *outMovie, u32 handlertype, u32 brand, u32 minorversion) |
Like NewMPEG21() but allows you to specify the meta handlertype, and the major brand and minor version of that brand. | |
MP4Err | MP4SetMovieIODInlineProfileFlag (MP4Movie theMovie, u8 theFlag) |
Indicates that the given track is to be considered as the initial BIFS track. | |
MP4Err | MP4SetMovieTimeScale (MP4Movie theMovie, u32 timeScale) |
Sets the Movie’s time scale. | |
MP4Err | MP4OpenMovieFile (MP4Movie *theMovie, const char *movieURL, int openMovieFlags) |
Opens a movie file and creates a Movie in memory from this file. | |
MP4Err | MP4PutMovieIntoHandle (MP4Movie theMovie, MP4Handle movieH) |
Places the movie and its media samples into a handle. | |
MP4Err | MP4WriteMovieToFile (MP4Movie theMovie, const char *filename) |
See ISOWriteMovieToFile() | |
MP4Err | ISOStartMovieFragment (MP4Movie theMovie) |
This starts a new movie fragment. | |
MP4Err | ISOAddDelayToTrackFragmentDecodeTime (MP4Movie theMovie, u32 delay) |
Add delay to track fragment decode time. | |
MP4Err | ISOSetCompositonToDecodePropertiesForFragments (MP4Movie theMovie, u32 trackID, s32 compositionToDTSShift, s32 leastDecodeToDisplayDelta, s32 greatestDecodeToDisplayDelta, s32 compositionStartTime, s32 compositionEndTime) |
Sets the compositon to decode parameters for a specific track. | |
Functions to operate with ISOMovie/MP4Movie objects.
Add delay to track fragment decode time.
Setting the delay parameter to other than zero, a delay will be introduced, which will add a time offset to the track fragment decode time.
theMovie | input movie object |
delay | delay value |
ISOErr ISOGetMovieBrand | ( | ISOMovie | theMovie, |
u32 * | brand, | ||
u32 * | minorversion | ||
) |
Returns the Movie’s major brand and minor version.
theMovie | input movie object |
brand | output brand |
minorversion | output minor version |
ISOErr ISOIsMovieCompatibleBrand | ( | ISOMovie | theMovie, |
u32 | brand | ||
) |
If the brand is a compatible brand of the movie, this returns MP4NoErr, otherwise it returns MP4NotFoundErr.
theMovie | input movie object |
brand | brand value to check |
Like NewMPEG21() but allows you to specify the meta handlertype, and the major brand and minor version of that brand.
outMovie | output movie object |
handlertype | Handler type |
brand | Brand |
minorversion | Minor version |
MP4Err ISOSetCompositonToDecodePropertiesForFragments | ( | MP4Movie | theMovie, |
u32 | trackID, | ||
s32 | compositionToDTSShift, | ||
s32 | leastDecodeToDisplayDelta, | ||
s32 | greatestDecodeToDisplayDelta, | ||
s32 | compositionStartTime, | ||
s32 | compositionEndTime | ||
) |
Sets the compositon to decode parameters for a specific track.
They have to be calculated and added before calling the first ISOStartMovieFragment() and cannot be changed later.
theMovie | input movie object |
trackID | input track ID |
compositionToDTSShift | composition to decoding time shift |
leastDecodeToDisplayDelta | least decode to display delta |
greatestDecodeToDisplayDelta | greatest decode to display delta |
compositionStartTime | composition start time |
compositionEndTime | composition end time |
ISOErr ISOSetMovieBrand | ( | ISOMovie | theMovie, |
u32 | brand, | ||
u32 | minorversion | ||
) |
Sets the Movie’s major brand.
Also inserts the major brand into the compatible brands list. This function is not normally needed; the brand is set by the appropriate movie-creation function.
theMovie | input movie object |
brand | brand value to set |
minorversion | minor version |
ISOErr ISOSetMovieCompatibleBrand | ( | ISOMovie | theMovie, |
u32 | brand | ||
) |
Adds a minor brand into the compatible brands list of the Movie.
The following brands have defined constants in the headers, though of course you may use MP4_FOUR_CHAR_CODE() also.
Brand | Description |
---|---|
JP2JPEG2000Brand | brand for JPEG-2000 |
MJ2JPEG2000Brand | brand for Motion JPEG-2000 |
ISOQuickTimeBrand | brand for QuickTime |
ISOMpeg4V1Brand | brand for MPEG-4 version 1 |
ISOMpeg4V2Brand | brand for MPEG-4 version 2 |
ISOISOBrand | conforming brand for all files |
ISOISO2Brand | conforming brand for all files |
ISO3GP4Brand | 3GPP Release 4 |
ISO3GP5Brand | 3GPP Release 5 |
ISO3GP6Brand | 3GPP Release 6 |
ISOMPEG21Brand | MPEG-21 |
theMovie | input movie object |
brand | brand value to set |
This starts a new movie fragment.
Before calling this, you should create a normal movie, up to the point you would write it to the file, and you should set the track fragment defaults on the tracks to which you want to add samples. After calling this, you should only add samples, and write the file out. Each call to this function starts a new fragment. For example, you might call this function after ISOEndMediaEdits, and then insert some more samples into the track(s).
theMovie | input movie object |
ISOErr ISOWriteMovieToFile | ( | ISOMovie | theMovie, |
const char * | filename | ||
) |
Writes the in-memory Movie to a file.
The file given by filename is created, written, and closed.
theMovie | input movie object |
filename | file name |
ISOErr MJ2GetMovieMatrix | ( | ISOMovie | theMovie, |
u32 | outMatrix[9] | ||
) |
This returns the overall transformation matrix for the movie.
theMovie | input movie object |
matrix | output matrix |
ISOErr MJ2GetMoviePreferredRate | ( | ISOMovie | theMovie, |
u32 * | outRate | ||
) |
This returns the currently set movie preferred rate.
theMovie | input movie object |
outRate | output preferred rate |
ISOErr MJ2GetMoviePreferredVolume | ( | ISOMovie | theMovie, |
s16 * | outVolume | ||
) |
This returns the movie volume setting.
theMovie | input movie object |
outVolume | output volume |
ISOErr MJ2NewMovie | ( | ISOMovie * | outMovie | ) |
Creates a new empty Motion JPEG 2000 Movie in memory.
outMovie | output movie object |
ISOErr MJ2SetMovieMatrix | ( | ISOMovie | theMovie, |
u32 | matrix[9] | ||
) |
This sets the matrix of the overall movie.
The default matrix is the unity matrix, if none has been set.
theMovie | input movie object |
matrix | input matrix |
ISOErr MJ2SetMoviePreferredRate | ( | ISOMovie | theMovie, |
u32 | rate | ||
) |
This sets the rate of the movie (the normal and default rate is 1.0).
theMovie | input movie object |
rate | input rate represented as a 16.16 fixed-point number |
ISOErr MJ2SetMoviePreferredVolume | ( | ISOMovie | theMovie, |
s16 | volume | ||
) |
This sets the normal volume of the movie.
theMovie | input movie object |
volume | input volume value. The normal, default, value is 1.0. The volume is expressed as an 8.8 fixed-point number. |
MP4Err MP4AddAtomToMovie | ( | MP4Movie | theMovie, |
MP4GenericAtom | the_atom | ||
) |
Adds the given atom to the movie.
theMovie | input movie object |
the_atom | new atom to add to the movie object |
This function releases any resources owned by the Movie.
theMovie | Movie object to kill |
This calculates and returns the movie duration as recorded in the movie header.
It is the maximum track duration, expressed in units of the movie’s timescale. Get the timescale using the MP4GetMovieTimeScale().
theMovie | input movie object |
outDuration | output duration in movie's timescale. |
Retrieves the initial object descriptor from a Movie and places it into a Handle.
theMovie | input movie object |
outDescriptorH | output handle with the data |
MP4Err MP4GetMovieInitialObjectDescriptorUsingSLConfig | ( | MP4Movie | theMovie, |
MP4SLConfig | slconfig, | ||
MP4Handle | outDescriptorH | ||
) |
Retrieves the initial object descriptor from a Movie.
Similar to MP4GetMovieInitialObjectDescriptor() but with additional MP4SLConfig parameter.
theMovie | input movie object |
slconfig | input MP4SLConfig configuration object |
outDescriptorH | output handle with the data |
Queries the setting of includeInlineProfileLevelFlag from the movie's initial object descriptor.
theMovie | input movie object |
outFlag | output flags |
MP4Err MP4GetMovieProfilesAndLevels | ( | MP4Movie | theMovie, |
u8 * | outOD, | ||
u8 * | outScene, | ||
u8 * | outAudio, | ||
u8 * | outVisual, | ||
u8 * | outGraphics | ||
) |
Use this to obtain the profiles and levels from a Movie's initial object descriptor.
You may pass in null for parameters that don't care to read.
theMovie | input movie object |
outOD | output object descriptor profile and level |
outScene | output scene profile and level |
outAudio | output audio profile and level |
outVisual | output visual profile and level |
outGraphics | output graphics profile and level |
Use this to obtain the time scale of a Movie.
theMovie | input movie object |
outTimeScale | output value for timescale |
Use this to obtain a track given its track ID.
theMovie | input movie object |
trackID | track ID |
outTrack | output track object |
MP4Err MP4NewMovie | ( | MP4Movie * | outMovie, |
u32 | initialODID, | ||
u8 | OD_profileAndLevel, | ||
u8 | scene_profileAndLevel, | ||
u8 | audio_profileAndLevel, | ||
u8 | visual_profileAndLevel, | ||
u8 | graphics_profileAndLevel | ||
) |
Creates a new empty Movie in memory.
You may assign an initial object descriptor ID and profile and level indications that describe the presentation you are making. The profile and level definitions are detailed in the MPEG-4 Systems specification.
If you provide zero as the initialODID, then no object descriptor is created. Such files can be used as the target of an ES URL, or standalone. Similarly if you provide zero for all the profiles, then the IOD atom will contain an object descriptor, not an initial object descriptor; these files can also be useful on occasion.
outMovie | output movie object |
initialODID | initial object descriptor. If 0, then no object descriptor is created. |
OD_profileAndLevel | Object descriptor profile and level |
scene_profileAndLevel | scene profile and level |
audio_profileAndLevel | audio profile and level |
visual_profileAndLevel | visual profile and level |
graphics_profileAndLevel | graphics profile and level |
Parses a movie ‘file’ in the handle and creates a Movie in memory from this file.
outMovie | output movie object |
movieH | input movie handle |
newMovieFlags | is ordinarily set to MP4OpenMovieNormal, but if you set it to MP4OpenMovieDebug a parse tree will be printed to standard output while the movie is parsed |
Opens a movie file and creates a Movie in memory from this file.
theMovie | output movie object |
movieURL | pathname or a file URL. |
openMovieFlags | is ordinarily set to MP4OpenMovieNormal, but if you set it to MP4OpenMovieDebug a parse tree will be printed to standard output while the movie is parsed |
Places the movie and its media samples into a handle.
theMovie | input movie object |
movieH | output handle with the data from theMovie |
Indicates that the given track is to be considered as the initial BIFS track.
This information is placed into the Movie's initial object descriptor.
theMovie | |
theBIFSTrack |
Indicates that the given track is to be considered as the initial Object Descriptor stream track.
This information is placed into the Movie's initial object descriptor.
theMovie | |
theODTrack |
Sets the includeInlineProfileLevelFlag in the movie's initial object descriptor.
theMovie | input movie object |
theFlag | profile and level flag |
Sets the Movie’s time scale.
theMovie | input movie object |
timeScale | timescale value |
ISOErr New3GPPMovie | ( | ISOMovie * | outMovie, |
u16 | release | ||
) |
Creates a new empty 3GPP Movie in memory, and sets the brand to the indicated release (4, 5 or 6).
outMovie | output movie object |
release | release brand (4, 5 or 6). |
Creates a new empty MPEG-21 ‘movie’ in memory.
Actually it creates an MPEG-21 file with a meta-atom but no movie atom. You will probably want to get the meta-atom reference ISOGetFileMeta to add items etc.
outMovie | output movie object |