[Ffmpeg-devel] Interleaving audio and video

Roman Shaposhnik rvs
Sun Feb 4 06:57:19 CET 2007


On Fri, 2007-02-02 at 12:05 +0100, Michael Niedermayer wrote:
> > > see av_interleaved_write_frame() (the docs above it)
> > > and AVOutputFormat.interleave_packet()
> > 
> >   I see. Thanks for pointing it out. I guess my followup question 
> > is exactly along the lines of what Baptiste has asked -- should
> > we enforce it somehow ?
> packets MUST be interleaved according to AVOutputFormat.interleave_packet
> i thought the doxygen comments clearly say so but apparently not

  Right. I guess lack of documentation was to some extent responsible
for my confusion. We sure can use a word or two of doxygen, but I guess
the key problem is that one is supposed to know whether to use
av_write_packet() or av_interleaved_write_frame() ahead of time.
Most of examples illustrating how to use FFmpeg's API use 
av_write_packet() exclusively, with the only exception of ffmpeg.c

  Now, there are formats (DV, GXF and may be others) which sort
of require av_interleaved_write_frame() regardless of how well
the incoming stream of packets is interleaved. The reason, as I
figured out by reading the other portion of this thread is 
that somehow av_interleaved_write_frame() gets used to emulate
and actual packetizer.

> > Or perhaps have a flag for AVOutputFormat ?
> i dunno what do we gain from this? making non interleaved mov and avi,
> which are slower to demux due to seeking between streams, and cant be
> streamed over non seekable protocols, it doesnt seem like a good idea

  Sorry, I wasn't clear on this one. Here's the problem I was talking
about: it seems that currently there's nothing preventing clients
from using av_write_packet() for generating GXF files. Same thing
would happen to the DV muxer if I decide to simplify it by using 
the av_interleaved_write_frame() magic instead of an actual packetizer.

  So, where I was driving at was a sort of solution where somehow
muxers like DV and GXF would *mandate* usage of

  An alternative (at least for DV and GXF) would be an actual


More information about the ffmpeg-devel mailing list