[MPlayer-dev-eng] [PATCH] Be more liberal in supported libavcodec aspect ratio configuration.

Daniel Pittman daniel at rimspace.net
Tue Nov 19 03:47:41 CET 2002


At present the libavcodec output option for mencoder allows the aspect
ratio of an encoded (mpeg4, at least) sequence to be specified.

This is very nice for storing transcoded MPEG4 streams and television
captures, since it uses hardware scaling on display to resize the image,
and doesn't use more bits like pre-scaling does.

The user interface to it is rather hostile, though, since it demands
that the (limited set of) aspect ratios be specified to the full
precision of a float on the system.

My patch makes this a lot more liberal, accepting the "user friendly"
idea of what the aspect ratio is rather than the exact mathematical
definition.

So, rather than 1.33333333333333, 1.33 is considered valid. This is ...
nicer, IMO.

When selecting the ranges to accept, I considered the common value given
for the aspect ratio, on DVD covers and websites, as well as the exact
floating point values formerly given in the code.

Both values should now be accepted and stored correctly in the
libavcodec state.

I tested this and it works correctly with '-lavcopts aspect=1.33', for
example, where it previously said that 'aspect 1.3300000000' was not
known.

       Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 1069 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20021119/f8c2ea62/attachment.bin>
-------------- next part --------------

-- 
Interestingly, most Unix utilities have a command line option which will cause
the system to rip the user's legs off and beat them to death with the soggy
ends. This is often the default behaviour.
        -- Bruce Murphy


More information about the MPlayer-dev-eng mailing list