Can someone enlighten me on what the status is of aspect ratio in theora is ? The ti structure has aspect_num and _den values, which I assume give the intended display aspect ratio (e.g. 4/3). The sample files on the bittorrent seem to say both values are 0 for all files. I'd think it should at least be made impossible to have a 0 as the denominator. The library doesn't check the values at all on encode_init. I can provide a patch if this needs to be fixed. The example encoder states in its comments that if you don't set the aspect denominator, the default of "0" is used (!) The spec.py file seems to say that aspect ratio "is not used yet". I'm a bit confused, and I'm trying to add proper aspect ratio support to GStreamer at the moment. What should I be doing ? Thomas Dave/Dina : future TV today ! - http://www.davedina.org/ <-*- thomas (dot) apestaart (dot) org -*-> Smelled you on my hand for days I can't wash away your scent I'm a dog and you're a bitch <-*- thomas (at) apestaart (dot) org -*-> URGent, best radio on the net - 24/7 ! - http://urgent.fm/
In my directshow filters right now i just set them to 0. It doesn't seem to present a division by zero error anywhere. Somewhere in libtheora it sets them to something meaningful, i think. Zen. ----- Original Message ----- From: "Thomas Vander Stichele" <thomas@apestaart.org> To: "Theora Development" <theora-dev@xiph.org> Sent: Wednesday, July 14, 2004 8:10 PM Subject: [Theora-dev] aspect ratio ?> Can someone enlighten me on what the status is of aspect ratio in theora > is ? > > The ti structure has aspect_num and _den values, which I assume give the > intended display aspect ratio (e.g. 4/3). > > The sample files on the bittorrent seem to say both values are 0 for all > files. I'd think it should at least be made impossible to have a 0 as > the denominator. > > The library doesn't check the values at all on encode_init. I can > provide a patch if this needs to be fixed. > > The example encoder states in its comments that if you don't set the > aspect denominator, the default of "0" is used (!) > > The spec.py file seems to say that aspect ratio "is not used yet". > > I'm a bit confused, and I'm trying to add proper aspect ratio support to > GStreamer at the moment. What should I be doing ? > > Thomas > > Dave/Dina : future TV today ! - http://www.davedina.org/ > <-*- thomas (dot) apestaart (dot) org -*-> > Smelled you on my hand for days > I can't wash away your scent > I'm a dog and you're a bitch > <-*- thomas (at) apestaart (dot) org -*-> > URGent, best radio on the net - 24/7 ! - http://urgent.fm/ > > > _______________________________________________ > Theora-dev mailing list > Theora-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/theora-dev > >
ti.aspect_numerator and ti.aspect_denominator hold the pixel aspect ratio. cvs versions of mplayer and vlc decode this the right way. ffmpeg2theora encodes files that use these values. nice table on aspect ratio: http://www.mir.com/DMG/aspect.html#reftable if ti.aspect_numerator and ti.aspect_denominator are 0 they are ignored and no scaling is done by the players. in mplayer the scaling is done like this: if(sh->aspect==0.0 && context->inf.aspect_denominator!=0){ sh->aspect = (float)(context->inf.aspect_numerator * context->inf.width)/ (context->inf.aspect_denominator * context->inf.height); } j
<1089811034.25780.7.camel@x30> Message-ID: <1089813740.25780.13.camel@x30> its also in the theora spec(http://svn.xiph.org/trunk/theora/doc/spec/) you can find a compiled pdf at http://v2v.cc/~j/Theora_I_spec.pdf 6.2. IDENTIFICATION HEADER DECODE [xpdf page 63ff] PARN Integer 24 No The pixel aspect-ratio numerator. PARD Integer 24 No The pixel aspect-ratio denominator. ... 13. Read a 24-bit unsigned integer as PARN. 14. Read a 24-bit unsigned integer as PARD. Together with PARN, these specify the aspect ratio of the pixels within a frame, defined as the ratio of the physical width of a pixel to its physical height. This is given by the ratio PARN : PARD. Either of these fields MAY be zero, in which case the pixel aspect ratio defaults to 1 : 1. j
<1089811034.25780.7.camel@x30> <1089813740.25780.13.camel@x30> Message-ID: <20040714150022.GA386@ghostscript.com> On Wed, Jul 14, 2004 at 04:02:20PM +0200, j@thing.net wrote:> 13. Read a 24-bit unsigned integer as PARN. > 14. Read a 24-bit unsigned integer as PARD. Together with PARN, > these specify the aspect ratio of the pixels within a frame, defined as > the ratio of the physical width of a pixel to its physical height. This > is given by the ratio PARN : PARD. Either of these fields MAY be > zero, in which case the pixel aspect ratio defaults to 1 : 1.FWIW, I'd rather a value of 0 or */0 indicate 'unknown', as in: Either of these fields MAY be zero, indicating that the pixel aspect ratio is 'unknown' and the decoder MAY default to 1:1 or attempt to guess based on other information available to it. Perhaps the second MAY should be a SHOULD? -r