Override aspect ratio in add-on
#1
Hello all,

I'm writing add-on that plays rtmp streams. It is almost done, except for one issue: the streamed video says, that it's DAR is 4:3, but it is not true, it is 16:9. When played as it is, the picture is squashed. How can I override the aspect ratio in plugin?

For now, the users have to use their remotes to change aspect ratio and it is annoying.
Reply
#2
No idea what it does or whether it helps, but I've seen this property in the docs.

http://xbmc.sourceforge.net/python-docs/...l#ListItem

Quote:setProperty(...)
setProperty(key, value) -- Sets a listitem property, similar to an infolabel.

key : string - property name.
value : string or unicode - value of property.

*Note, Key is NOT case sensitive.
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.

Some of these are treated internally by XBMC, such as the 'StartOffset' property, which is
the offset in seconds at which to start playback of an item. Others may be used in the skin
to add extra information, such as 'WatchedCount' for tvshow items

example:
- self.list.getSelectedItem().setProperty('AspectRatio', '1.85 : 1')
- self.list.getSelectedItem().setProperty('StartOffset', '256.4')

I know that StartOffset does indeed start the file at the offset, so AspectRatio may well reformat the file too..
Reply
#3
that's just the info labels. there's no way to override aspect currently.
Reply
#4
Thanks for the info, so I will leave it as it is.
Reply
#5
Hi,

i have a similar Question:
I'm working on my "The Big Pictures"-Script and I am trying to toggle the aspectratio.

I want to toggle through the values "keep" and "scale" - is this possible?

Here are some Code-Snippets of my best try:

Script Code:
Code:
selectedControl = self.getControl(self.CONTROL_IMAGE_LIST)  # = ID 100
            for i in range(selectedControl.size()):
                selectedControl.getListItem(i).setProperty('AspectRatio', 'keep') # I also tried for testing things like '1.85 : 1'
Skin:
Code:
...
<control type="list" id="100">
                <description>Main list of Images</description>
                ...
                <control type="largeimage" id="101">
                    <description>The Picture</description>
                    ...
                    <texture background="true">$INFO[ListItem.Icon]</texture>
                    <aspectratio>scale</aspectratio>
                </control>
                ...
</control>
...

thanks,
sphere
My GitHub. My Add-ons:
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Override aspect ratio in add-on0