[FFmpeg-devel] [PATCH 1/1] avformat/mpegenc.c: vbvsize option

Hendrik Leppkes h.leppkes at gmail.com
Tue Nov 5 19:37:19 EET 2019

On Tue, Nov 5, 2019 at 5:44 PM Gaullier Nicolas
<nicolas.gaullier at cji.paris> wrote:
> >>On Thu, Oct 31, 2019 at 06:04:58PM +0100, Nicolas Gaullier wrote:
> >> Allow the user to set or override the vbv size
> >> ---
> >>  libavformat/mpegenc.c | 6 +++++-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> >This is not the "correct" way to handle this, because one mpeg container
> >can contain many streams and this is just one parameter for the container.
> >while the vbvsize is a parameter per stream.
> FYI, my main concern/use case is to be able to rewrap an input mpg file to a new mpg file while keeping its vbv size.
> This was working back in version 2.8.9, just before codecpar was introduced (ie. regression)...
> My first proposal would be very straightforward : insert a new "rc_buffer_size" field at the end of AVCodecParameters but that would break the ABI?
> Another point is that rc_buffer_size may be carried by stream side_data when encoding, so that would mean two representations for the same information, I don't know if this sounds "correct".
> At the end, do you think amending AVCodecParameters would be acceptable ?
> The fact is, I have no other idea because I don't see anyway how to setup stream side_data from within the codec of the input stream.

Amending codecpar with such specific fields is not acceptable. As you
noted, we already have stream sidedata to carry these particular
values, so you should figure out a way to fill that sidedata from the
origin container, its the only proper way.

- Hendrik

More information about the ffmpeg-devel mailing list