Setcoordinateresolution & ar questions
#1
lo,

for the past few days i've been working on a nice script to present and watch streams from a french tv channel website..

this is my first python/xbmc script so i had to familiarize myself with all this and started my study with the very nice ooba script..

now that i have many things in place including some gfx layout, i was working on a way to make the display as compatible as possible with both 4/3 and 16/9, not that the layout is full of things but well just wanted to make it right for everyone..

i'm not really into video resolution and stuff like that so i don't really know what is exactly overscan and pixel ratio but i made sure to stick to the source pictures aspect ratios everytime i was adding a controlimage for that picture..

i made two different bg image, one version 4/3 (720x576) and one 16/9 (955/540). i'm not sure what picture sizes to use exactly as i first used a 720x540 bg image to fit a 4/3 display and then a 720x576 and i didn't see much difference, there should be a diffrence, right ?..

anyways, i use the recent setcoordinateresolution(pal_4x3) method to let xbmc handle controls resizing..
and as explained in the related thread, i set all my control positions and sizes to fit a pal_4x3 resolution..

my results so far are quite weird..
in 16/9 my 16/9 bg image looks just fine but in 4/3 my 4/3 bg image seems to be strectched verticaly..

on the other hand some controlimage i use to display pictures with a 4/3 ar are properly displayed in 4/3 but are stretched horizontaly in 16/9...

as for my controllists i'm not sure there's something different with them but in both cases they seem okay and use the proper space..


so first i wanted to know if i had to adapt my controlimage sizes to keep a proper display both in 16/9 and 4/3..

my first guess was that setcoordinateresolution would take care of that but apparently it does not, or not exactly..

my 4/3 ar pictures should look 4/3 both in 4/3 and 16/9 display, right ?

and then what would be the problem with my 4/3 background image ? i don't know what happens to it but it really looks stretched verticaly, whatever picture version i use (720x540 or 720x576)..

thx.

.dvbm
Reply
#2
there's two different issues here - let's split them up.

first, the resolution between pal4x3 and pal16x9 is identical - same number of pixels. the difference ofcourse is the aspect ratio of the pixels.

setcoordinateresolution() tells xbmc how to scale the position and width coordinates. it will not do anything in the case of pal vs pal16x9 - the resolution is identical, so nothing will be changed at all. so, images will look stretched in the 16x9 mode if you design them all for 4x3. this matters with some things, but not with others.

to get around this stretching, there is an option for the controlimage to force it to keep the aspect ratio of the source file. this does not in anyway alter the size of the bounding box you specify (posx, posy, width, height). what it does alter is the size of the image inside the bounding box. normally, xbmc stretches the image to fill the bounding box. if you specify the flag to keep the aspect ratio, then it will resize the image so that it fits inside the bounding box - it will be centered as large as possible while still keeping the aspect ratio.

this is useful for things such as thumbnails of pictures and so on - it's not particularly useful for background images, as you generally want background images to fill the bounding box you specify. instead, if you really wish to preserve some aspect of the background, you should do a separate image for the background on 4x3 and on 16x9, or you should do the background as a common image, and split off the bit that needs the ar kept as a transparent overlay image.

hope this helps - please let me know if there's anything you don't understand.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
thx jmarshall

i have a better idea of what's going on.
indeed i'll have to deal with the pixel ratio for some of my controlimage objects..

i haven't found that controlimage property you're talking about to make it keep the source image ar..
is it something added recently ?

i'm using the following documentation http://home.no.net/thor918/xbmc/xbmcgui....ntrolimage

i don't have a hd cable for my xbox so i can't make many tests to check that my layout is maintained by setcoordinateresolution between resolutions.
i'll test with ntsc/pal but i'm not sure it would be very representative of the resolution gap when switching from pal/ntsc to 720p or 1080i..

thx a lot for your help.
Reply
#4
maybe the keepaspectratio function isn't available to python (not everything is)

if that's the case, then you'll need to use the getresolution function to grab the current resolution, and scale the critical images from that (unless you find a dev with the time to add the function call in!Wink

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
okay thx

i'll take care of the controlimage ar myself then
don't have to many devs on my buddy list so... couldn't event find a xbmc python scripter on irc..

for the moment i'm trying to understand why that dom property .nodevalue refuses to return the text inside my xml nodes..
works fine in that settingsmgr lib but can't get it to work in my own script function..

thx again

.dvbm
Reply

Logout Mark Read Team Forum Stats Members Help
Setcoordinateresolution & ar questions0