Thursday, August 04, 2005


Media Format: 3gp vs. Mpeg

In our project, we need a streamable media format. Both 3gp and Mpeg are in this form.

Why streamable? Because in streamable format, we do not have to wait until the recording is complete -- we can already transmit, play or save the recorded data while the recording is in progress. No local buffering is required. And this is what we need.

Implementing Video Recording

RecordControl is one of the more difficult controls to provide since it requires a video encoder, preferably capable of real-time encoding. In addition to encoding the video, it should be capable of encoding any related audio stream and ensure that the resulting file or stream has the audio and video streams interleaved and synchronized for later presentation.

If the source stream is already compressed, synchronized, and streamable, then the RecordControl might only need to copy the original stream from the appropriate point in the media and insert any required headers and footers to the stream. This makes the file complete and playable at a later time. In the case of MPEG, all packet headers must be modified with new timestamps. There might be similar issues with other media types. For example, the QuickTime file format requires an index chunk that contains byte positions of individual frames of video. The MMAPI RI does not provide a RecordControl for the MPEG video player.

Note that recording is an optional part of MMAPI. If an implementation does not support recording, it will return null when the user tries to obtain a RecordControl object by using player.getControl("RecordControl"). An implementation might support recording only for a subset of formats. For example, it might support file writing for a WAVE audio player but not for an MPEG video player.


Post a Comment

<< Home