[FFmpeg-devel] [PATCH] parseutils: add support for ms and us suffix for AV_OPT_TYPE_DURATION

Aurelien Jacobs aurel at gnuage.org
Sat Mar 3 00:19:57 EET 2018


On Fri, Mar 02, 2018 at 10:02:58PM +0000, Rostislav Pehlivanov wrote:
> On 2 March 2018 at 21:57, Aurelien Jacobs <aurel at gnuage.org> wrote:
> 
> > On Fri, Mar 02, 2018 at 09:39:48PM +0100, Michael Niedermayer wrote:
> > > On Thu, Mar 01, 2018 at 09:41:20PM +0100, Aurelien Jacobs wrote:
> > > > supported suffixes are:
> > > > - s: seconds (default when no suffix specified)
> > > > - m or ms: milliseconds
> > > > - u or us: microseconds
> > > > ---
> > > >  libavutil/parseutils.c | 15 +++++++++++++--
> > > >  1 file changed, 13 insertions(+), 2 deletions(-)
> > >
> > > can some of this and the si_prefixes related code in eval.c be
> > > factored ?
> >
> > I've had a look at this, but this would increase code complexity
> > in both eval.c and parseutils.c with no advantage, so I deceided not to.
> > Anyway, 'u' and 'm' SI prefix are the only ones that make any sense for
> > AV_OPT_TYPE_DURATION and supporting more prefix than those "thanks" to
> > common code, might add confusion for end user.
> >
> > BTW, while looking at si_prefixes, I noticed that both 'k' and 'K' are
> > supported for meaning "kilo", which is wrong in the SI. Only 'k' is
> > a prefix for "kilo", 'K' is a unit for "Kelvin".
> > Not sure if there is actually a good reason for having 'K', if it is
> > needed for backward compatibility, or if it should be removed...
> >
> > > either way this LGTM
> >
> > Great. Applied.
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> I think that was a bit premature, I really think "m" should be for minutes
> while "ms" should be for milliseconds.

What you (or I) think is not relevant here. We are simply implementing
an internationnal standard that define precisely what those letters mean
so that people all around the world can communicate without ambiguity.

Minute is not an SI unit but still accepted for use along with SI units,
and the standard symbol for minutes is 'min'.
'm' is the prefix for milli and nothing else.

This is detailed here:
https://www.bipm.org/en/publications/si-brochure/table6.html

If you think having support for minute is really useful, I can have a
look at supporting 'min'.


More information about the ffmpeg-devel mailing list