[FFmpeg-devel] [crop support for matroska demuxer, V3 1/3] libavcodec: Add crop related fields to structure AVCodecContext and AVCodecParameters.

Anton Khirnov anton at khirnov.net
Wed Oct 12 20:08:15 EEST 2022


Quoting James Almer (2022-10-11 14:51:34)
> On 10/11/2022 9:43 AM, Timo Rothenpieler wrote:
> > I really don't like seeing this in avcodec.
> > Why does an encoder or decoder need to care about this, given it's 
> > container level information?
> > 
> > Do you plan on implementing cropping support into all the encoders?
> > This should be handled via an avfilter, which might get the cropping 
> > info from the demuxer via site data or something.
> 
> There's logic in decode.c to apply bitstream level cropping (like in 
> h264). This could be extended to also apply container level cropping 
> exported as packet side data, like you suggested.

That logic is essentially just calling av_frame_apply_cropping().
Callers can just as easily do this themselves; adding a bunch of new
fields and a system of policies seems like unnecessary complexity that
cannot provide all the flexibility one might want anyway.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list