[Ffmpeg-devel] Interleaving audio and video

Roman Shaposhnik rvs
Mon Feb 5 03:06:14 CET 2007


Hi

On Mon, 2007-02-05 at 01:35 +0100, Michael Niedermayer wrote:
> >   Hm. In that case personally I don't know of any place I would
> > logically extract this code to. So unless you or Baptiste can
> > take a lead on figuring this out, I guess I would have
> > to keep all of the packetizer code in dvenc.c. I actually
> > have what seems to be a reasonable patch for it to get
> > rid of Fifo and make code faster. Its just that it'll be
> > premature to commit it if we can agree on a common place
> > for such code to be in for all the muxers that require it.
> > All in all, I think I'll wait a couple of days.
> 
> i really dont understand what you want, 

  I guess I was just following Baptiste suggestion that ffmpeg could
benefit from an AVPacketizer. I thought it would be good idea. Here's
how I imagined it would be used by DV: if I can guarantee that all
incoming Audio packets are of a certain predetermined length (something
our imaginary  AVPacketizer would take care of) and are always
interleaved properly (something I can already do if I use 
av_interleaved_write_frame() & co.) that would turn DV muxer into
a trivial reshuffling routine. That would also simplify GXF and
would help it not misuse av_interleaved_write_frame().

  Does it make it clearer ?

> mpeg-ps uses fifos and thats
> what it should use, dv does some sample reshuffle and _missuses_ a
> fifo for this (which because its not supposed to be done that way is
> slow), if you fix dv thats great, but i dont see what code you want 
> to share with any other muxer, cutting and merging packets is exactly
> what a fifo should be used for, iam not aware of another muxer which
> does mandatory sample reshuffle

  Fifo is fine. And just to make sure that I don't misuse it again
my plan to fix DV muxer to reshuffle samples immediately as
they get delivered to me by dv_write_packet() (basically
turning them into DIF blocks and storing these DIF blocks
for later use when I get a video frame for them). Now since I would
need a sort of a circular buffer for taking care of reusing 
DIF blocks I might use Fifo to manage that.

Thanks,
Roman.





More information about the ffmpeg-devel mailing list