[Libav-user] h264,h265: maximum referenced frames vs. GOP size

Hendrik Leppkes h.leppkes at gmail.com
Fri Sep 11 13:35:39 CEST 2015

On Fri, Sep 11, 2015 at 1:15 PM, Heiner Mueller <ffmpeg at mxwendler.net> wrote:
>>>> i found this in the DXVA code, and i would like
>>>> to optimize it a bit:
>>> Then please send your tested patch (made with git
>>> format-patch) to the development mailing list
>>> where it can be reviewed.
>> I can save you the trouble though. First of all, gop_size is an
>> encoding parameter, and not useful here at all.
>> Secondly, there is unfortunately no parameter that conveys this
>> information that is both (1) accurate, and (2) known early enough to
>> be useful.
> Yes, i was asking for the correctness of this assumption.
> So the assumption is not correct =/
> If we decode 4K video, saving four surfaces is a considerable
> amount of memory. Is there a later point where we can re-set the
> amount of surfaces? We can check for I-frame distances, but
> this does not guarantee that we find the maximum - this may change
> at any time in the stream i think.

You cannot change the number of reference frames available without
re-creating the entire decoder and invalidating all old references,
which would result in a serious playback disruption.
I'm afraid there is no real 100% solution here.

- Hendrik

More information about the Libav-user mailing list