[FFmpeg-devel] [PATCH 06/12] fftools/ffmpeg_dec: apply cropping manually

Anton Khirnov anton at khirnov.net
Sat Mar 23 09:20:21 EET 2024


Quoting James Almer (2024-03-23 03:53:26)
> On 3/22/2024 5:28 PM, Anton Khirnov wrote:
> > lavfi does not require aligned buffers, so we can safely apply top/left
> > cropping by any amount, without passing any special flags to lavc.
> > Longer term, an even better solution would probably be auto-inserting
> > the crop filter (or its hwaccel versions) as needed.
> 
> It's what i did in my container cropping set. One problem with it is 
> that the cropping filter doesn't look at cropping values in input frames 
> but at filter options instead, and will in fact *add* cropping values to 
> the output frames if you pass it something it can't handle, like hwaccel 
> formats.

The idea is that ffmpeg_filter would set up the crop filter, then remove
the values from the frame. The crop filter then either actually performs
cropping or adds them back.

> And for that matter, cropping fields in frames should be handled by 
> encoders, or by the generic encoding code in some form. Right now they 
> are outright ignored.

Sure I guess. Patches welcome?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list