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

Panagiotis Issaris takis.issaris
Wed Sep 13 13:52:26 CEST 2006


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.

 opt.c |   31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

The idea is to follow this patch with one replacing for example "bit_rate" with 
"b" and removing the equally named option definitions from ffmpeg.c.

With friendly regards,
Takis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20060913T133627-ffmpeg-unit_postfixes.diff
Type: text/x-diff
Size: 1167 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060913/ad55548e/attachment.diff>



More information about the ffmpeg-devel mailing list