If you are compiling within the context of the framework, you could simply include the relevant header files and create the MPEG4Writer
object directly. A very good example for this is the command line utility recordVideo
as can be observed from this file.
If you wish to write a separate application, then you need to link with libstagefright.so
and include the relevant header files and their path.
Note: If you wish to work with the standard MPEG4Writer
, it's source i.e. source of the MPEG4Writer
which would be an encoder should be modeled as a MediaSource
. The writer pulls the metadata
and actual bitstream through the read
method and hence, it is recommended to employ a standard built-in object such as OMXCodec
or ACodec
for the encoder.