[theora] [PATCH] splayer aspect ratio + zoom

Markus Meyer meyer at mesw.de
Wed Jul 23 16:15:18 PDT 2003

Many thanks Philip for your detailed explanations!

I have attached a patch for splayer which makes the video picture scale
correctly according to the aspect ratio. I hope it is portable (didn't
try it on Linux yet). I tried to implement the "pixel aspect ratio" so
that only one number (width or height) is changed, and if it is changed,
it is increased.

There is also extended error handling and a "-s" option, which takes a
float and scales the video (e.g. "-s 2" shows the video in double size).

It's actually no rocket science because SDL does the scaling itself ;-)

> This should probably be fixed. My suggestion to anyone who's listening
> is that if the aspect is read from yuv4mpeg file that if either value is
> zero, 1:1 should be used. If the user puts a 0 on the command line,
> refuse to encode.

The patch implements it so that when either numerator or denominator is
zero, the given aspect ratio is ignored, thus preserving the aspect
ratio of the given pixels (f.e. 2:1 for 640x320 video). This could be a
viable interpretation for 0:0, but I still think that the situation
where only one number is zero should be illegal.

> I've implemented aspect scaling in xines theora plugin, and those
> changes should be commited to xine CVS after xine rc1 is released (there
> were alot of other changes which may or may not have introduced subtle
> bugs -- unsuitable to introduce just before rc1). After rc1, you can
> have a look at xine, which I now use to play with theora with aspect
> scaling :)

What I would really be interested in is how you implemented seeking
(positioning inside the stream), because that's the next item on my
feature whish list.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: splayer_aspect_ratio_patch.txt__charset_us-ascii
Type: text/x-patch
Size: 6195 bytes
Desc: splayer_aspect_ratio_patch.txt__charset_us-ascii
Url : http://lists.xiph.org/pipermail/theora/attachments/20030724/6da39912/splayer_aspect_ratio_patch.bin

More information about the Theora mailing list