Wednesday, April 11, 2012

Self synchronization Explicit AV synchronization in Stagefright

Self Synchronization or Explicit AV synchronization:
This is used in any file format. while creating AVI/MPEG4 file,
audio and video encoder data wont be written as such.
Encoded Video and audio frames are written to the file based on interleaving.
AudioFrame: A0 A1 A2
VideoFrame: V0 V1 V2
After interleaving, the data will be as like this: V0 A0 V1 A1 V2 A2
Interleaved data is written into file.
Interleaving can be based on number of frames or duration. Let us say
inteleaved duration is for 1 seconds.
Android stagefright is supporting this interleaved duration. Until
interleave duration is reached, MPEG4Writer will buffers data
in list. Once the interleaved duration is reached, it will be
signalled to MPEG4WriterThread.
MPEG4 Writer thread will write the queued samples in to the file.

No comments: