[Libav-user] Problem using avcodec_decode_video2 for reading HEVC stream

Tilak Varisetty vtilakece at gmail.com
Thu Aug 28 09:33:20 CEST 2014


Hello all,

I am following a discussion about the decoding delays. I am working with
optimizing the delays for our rendering app from ffserver to the webclient
using webm container format. I experience a latency of about 300 to 400
msec from the app via ffm, matroskaenc to the browser via websockets.

Most part of the delay is due to the decoding part of ffmdec; reading the
frame from the ffserver main loop. Changing the FFM_PACKET_SIZE to a higher
value does not help. If anyone has an idea to deal with this, it is highly
appreciated!

Thanks,
Tilak.


On Thu, Aug 28, 2014 at 12:42 AM, Markus Pfundstein <
markuspfundstein86 at gmail.com> wrote:

> ah thank you. didnt know that one. but makes sense yes.
>
> > On 27 aug. 2014, at 23:37, wm4 <nfxjfg at googlemail.com> wrote:
> >
> > On Wed, 27 Aug 2014 19:14:36 +0200
> > Markus Pfundstein <markuspfundstein86 at gmail.com> wrote:
> >
> >> a frame can consist of several packets. thats why you need to call
> av_decode_video2 multiple times until it has a fully decoded frame for you.
> the return values tell you how much data was read.
> >> you should adjust packet.data and packet.size by those values.
> >>
> >> there a a lot of examples out there that show this.
> >
> > In libavcodec/libavformat, a packet consists of exactly one frame (and
> > libavformat goes out of its way to guarantee this). But decoding can
> > incur a delay of several frames. That means, at start of decoding you
> > have to feed the decoder several packets without getting a video frame
> > back, and at end of decoding you need to feed it null packets to get
> > the remaining frames.
> > _______________________________________________
> > Libav-user mailing list
> > Libav-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/libav-user
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140828/b3bd7303/attachment.html>


More information about the Libav-user mailing list