[Ffmpeg-devel] [PATCH] Allowing (k,M,G and B) unit postfixes

Rich Felker dalias
Thu Sep 14 04:20:18 CEST 2006


On Thu, Sep 14, 2006 at 12:37:08AM +0200, Michael Niedermayer wrote:
> Hi
> 
> On Wed, Sep 13, 2006 at 01:52:26PM +0200, Panagiotis Issaris wrote:
> > Hi,
> > 
> > The attached patch allows parameter values (AVOptions) to use the 'k', 'M', 'G'
> > and 'B' postfixes. Specifying '700k' would mean 700 kbits, while '700kB' would
> > mean 700 kbytes. This eases using the -bit_rate parameter which uses bits as
> > its unit. I've used the SI units, keeping the case intact. If someone prefers
> > all lowercase postfixes, similar to the option names, I can ofcourse adapt this.
> > 
> > Furthermore, I've used the SI unit values, k==1000 and not k==1024. I wasn't sure
> > about this, as I thought for networking and bitrates that was a good idea, but
> > for storage sizes, I think the Ki==1024 ("kibi") units are also being used.
> 
> iam a little unsure about the upper/lowwer case and kibibit (every time i read
> about these gigibit units i somehow want to vomit ...)

Agree totally. Kabefaszom, kabibits! :))

> maybe we could have lowwer case for one and upper case for the other
> or we just follow all the standard comitees and add kiB, MiB and GiB
> after all using k to mean 2 things is just wrong and theres no real standard
> which say k=1024 ...

What about just omitting the 1024-based units? They're generally
irrelevant in codec settings anyway... That would make both the SI
fanboys and us happy.

Rich





More information about the ffmpeg-devel mailing list