[FFmpeg-devel] [PATCH 1/3] lavc/avcodec: Add caps for the support of variable dimension encoding

Anton Khirnov anton at khirnov.net
Fri Jun 12 13:15:07 EEST 2020


Quoting Nicolas George (2020-06-09 11:48:19)
> Anton Khirnov (12020-06-08):
> > During the last iteration, I asked how is this preferable to just making
> > a new encoder instance. Don't think I got a sufficient reply.
> 
> How do we know that we can just put the packets of the new instance
> after the packets of the old instance and it will work?

The definition of "work" depends on what you do with the data. It is not
a given that it will be passed into lavf to be muxed into a file.

> 
> It will work for image codecs, of course.
> 
> It will not work for raw video codecs, since the frame size and
> characteristics are global.

And yet the patches specifically concern raw video.

> 
> It may work for some codecs.
> 
> It may work if we generate side data to renew the extra data.
> 
> Clearly, making a new encoder instance is not an universal solution.

There is no universal solution. My point is that creating a new encoder
instance is conceptually simpler and therefore safer than trying to
reinitialize all the codec internals.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list