Re: audio/video chunk sequence in avi file

Burkhard Plaum <[email protected]> Thu, 08 May 2008 10:24:38 +0200
Newsgroups gmane.comp.video.mjpeg.devel
Message-ID <[email protected]>
Hi,

Gerry Fan schrieb:
> When I look at the mjpg avi file, audio and video are interleaved in 
> movi. What is the rule for the audio and video chunk sequence?  is it 
> like this:
>  audio_chunk  for one period ( say x seconds )
>  video_chunk1
>  video_chunk2
>  ....
>  all video_chunks for the play time equavlent to the previous 
> audio_chunk ( x second )
>  
>  audio_chunk2
>  video_chunks
> .... ( all video_chunks for play time equavelent to audio_chunk2)
>  
>  
> in other words, video chunks will not be encoded to place in avi 
> file where it is ahead of its corresponding audio chunk. Is this correct?

There is no such rule. Audio chunks vary from one video frame duration up to
1 second or so. I even saw an AVI file (DivX), which had all video chunks
followed by all audio chunks. When I encode AVIs or Quicktime, I make
the audio chunks about 0.5 seconds long.

Shorter audio chunks make seeking more efficient, longer audio chunks decrease
the overhead. Software decoders usually never have problems, hardware decoders
(like DivX players) might screw up, if the required buffer size becomes to large.

Burkhard

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone