[FFmpeg-devel] [PATCH] Ensure scaled video is divisible by n

Lars Kiesow lkiesow at uos.de
Wed Jul 3 19:11:06 EEST 2019


On Wed, 3 Jul 2019 18:04:26 +0200
Paul B Mahol <onemda at gmail.com> wrote:

> On 7/3/19, Lars Kiesow <lkiesow at uos.de> wrote:
> > Hi Paul,
> >  
> >> >      { "force_original_aspect_ratio", "decrease or increase w/h
> >> > if necessary to keep the original AR",
> >> > OFFSET(force_original_aspect_ratio), AV_OPT_TYPE_INT, { .i64 =
> >> > 0}, 0, 2, FLAGS, "force_oar" },
> >> > +    { "force_divisible_by", "enforce that the output resolution
> >> > is divisible by a defined integer", OFFSET(force_divisible_by),
> >> > AV_OPT_TYPE_INT, { .i64 = 1}, 0, 256, FLAGS, "force_oar" },  
> >>
> >> Are you sure you need "force_oar" ?
> >> If not, move it bellow 3 lines.  
> >
> > I'm honestly not sure since I don't know what it's used for ;-)
> >
> > From the AVOption Struct docs, I assumed that this should have the
> > same value as in force_original_aspect_ratio since it's used in the
> > same context. But it does work without and I can remove it if you
> > want me to. Should I?  
> 
> Yes, Look at belllow 3 lines, they have "force_oar" at end, because
> that gives special meaning to values.
> 
> Your option should not have these.
> 
> To confirm these, run "ffmpeg -h filter=scale" before and after you
> removed it.

Oh, got it makes sense. Thanks.
Will update the patch.


More information about the ffmpeg-devel mailing list