[Libav-user] Switching codecs from encode to playback on the fly

Alex Cohn alexcohn at netvision.net.il
Sun May 6 20:04:34 CEST 2012


On May 6, 2012 7:32 PM, "Bruce Wheaton" <bruce at spearmorgan.com> wrote:
>
> On May 5, 2012, at 9:16 PM, Alex Cohn wrote:
>
> > On May 6, 2012 6:28 AM, "Bruce Wheaton" <bruce at spearmorgan.com> wrote:
> > >
> > > Is it possible to open codecs for encoding, and use them to encode a
complete piece, then, on the fly (when the complete clip had already been
encoded) switch over and use them to decompress the same media?
> > >
> > > I'm flexible on which codecs, although I like MP4 for being LGPL and
good at multi-threading.
> > >
> >
> > To the best of my knowledge, encoders and decoders are completely
separate. But nothing can prevent you from creating both at initialization
time, and using the encoder or decoder whenever you need that.
> >
> Thanks. I wasn't really aware of that distinction. Ah, I see.
avcodec_find_decoder versus avcodec_find_encoder.
>
> Then I suppose the question becomes, can I use the same AVFormatContext
with encoders and decoders… and use the same AVStreams?
>
> Bruce

They were never designed for such reuse; but even if you could, what kind
of profit would you gain? These objects are negligebly small compared to
video data you must cache anyway.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120506/9bc86990/attachment.html>


More information about the Libav-user mailing list