[FFmpeg-devel] [PATCH, v2 2/4] avc/avcodec: add AV_CODEC_CAP_VARIABLE_DIMENSIONS flag
Fu, Linjie
linjie.fu at intel.com
Thu Feb 27 18:28:51 EET 2020
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Fu,
> Linjie
> Sent: Tuesday, February 18, 2020 23:06
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH, v2 2/4] avc/avcodec: add
> AV_CODEC_CAP_VARIABLE_DIMENSIONS flag
>
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> > Anton Khirnov
> > Sent: Tuesday, February 18, 2020 21:32
> > To: FFmpeg development discussions and patches <ffmpeg-
> > devel at ffmpeg.org>
> > Subject: Re: [FFmpeg-devel] [PATCH, v2 2/4] avc/avcodec: add
> > AV_CODEC_CAP_VARIABLE_DIMENSIONS flag
> >
> > Quoting Michael Niedermayer (2020-02-17 23:38:31)
> > > On Mon, Feb 17, 2020 at 06:28:23PM +0000, Fu, Linjie wrote:
> > >
> > > > > > > https://patchwork.ffmpeg.org/patch/14122/
> > >
> > > iam hesitating because it feeds encoders with changing resolution
> resulting
> > > in potentially undefined behavior ...
> > >
>
> Any suggestions?
>
> > > > > > > https://patchwork.ffmpeg.org/patch/14139/
> > >
> > > long discussion here its not immedeatly clear if anyone was against it
>
> Please help to give some inputs if this would leads to some unexpected
> results from your point of view.
>
> > > Also there is the question about the API, is there anything in the API
> > > documentation that restricts the user app from changing the encoder
> > > input frame dimensions?
> > > This should be documented somewhere if its not ...
> > >
> > > If a flag is added that affects this, it would have to
> > > be documented so someone writing a user app using the encoders
> > > would know if they are allowed to change the resolution.
> > > With just the flag and its documentation a developer could miss
> > > the flag entirely
>
> Since I didn't find the descriptions in doxygen:
> https://ffmpeg.org/doxygen/trunk/group__lavc__encoding.html#ga4fde50
> e2cad4cf3d66d882a7078aeab4
>
> The things should be done seem to be:
>
> [1]. Documentation in API, to declare that encoders require input frame to
> be in constant dimensions, unless the encoders have the capability of
> dynamic resolution encoding [2].
>
> [2]. Documentation in API, to declare this codec flag would affect the restrict
> in [1].
>
> If it's ok, I'll update the patch with the documentations added.
>
Update the patch with API documentations added.
And add checks to make sure it won't result into undefined behavior.
As to the support for more encoders, flush/destroy/reinit the encoder would work,
will investigate more to do this inside specific encoder or in more general ways.
Please help to review, thanks.
- Linjie
More information about the ffmpeg-devel
mailing list