Kodi Community Forum

Full Version: Aspect Ratio not displayed correctly in Movie info
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

I am a relative newbie to xbmc, just starting to rip my blu ray collection on a home grown NAS (ubuntu running zfs for redundancy), and am pretty happy with how things are going. Tested out three skins before settling on transparency. I really like the layout of this skin, and it was the easiest to use out of the ones tested. Have been seeing a problem with the aspect ratio displayed in the info for the movies in my library. I can get them to display in the skin to what is in the .nfo file for the movie if I navigate to the movie info, then hit the refresh button, and select the use local files button..well usually, can't get 2.40:1 formatted movies to display 2.40 in the info, they come up as 2.35 even if the aspect ratio tag is given 2.40 in the .nfo file. It looks like the reason why I can't get 2.40 to display is because of the limited number of defined Aspect Ratio's in the xbmc source as described here: aspect ratio link

The problem crops up after a movie is viewed in xbmc. Once that is done the aspect ratio from the .nfo file is overwritten by xbmc to an incorrect value. If the movie info is refreshed the value in the movie info goes back to what is in the .nfo file. This was identified, and a possible solution provided by a different user earlier in the week in this thread: possible solution link

The fix was to have the skin read the aspect ratio from the folder of file name. Which leads me to my question, can this be done using the transparency skin? And if so how would one go about modifying it to get the aspect ratio value from the folder of file name?

I have a constant height screen setup with my projector, and the projector has various settings saved for each aspect ratio type to get them all to work with the constant height screen. Getting the correct AR in the info of the movies would be much more convenient than rescanning or looking them up on
imdb or HD digest like I do now.

I hope I am not asking too much of a newbie question here.

Thanks,
imo the only sane solution would be to add the missing aspect ratios to xbmc.
i don't think it would be much fun having to rename all your movies :-)


renaming all your files/folders and modify the skin might work though i guess...
you'd need to define an image for each aspect in Includes_MediaFlagsVideo.xml

Code:
<control type="image">
    <posx>68</posx>
    <posy>0</posy>
    <width>64</width>
    <height>48</height>
    <texture>flags/movies/aspectratio/1.33.png</texture>
    <visible>SubString(ListItem.FileName,1.33)<visible>
</control>
(2013-03-11, 23:51)ronie Wrote: [ -> ]imo the only sane solution would be to add the missing aspect ratios to xbmc.
i don't think it would be much fun having to rename all your movies :-)


renaming all your files/folders and modify the skin might work though i guess...
you'd need to define an image for each aspect in Includes_MediaFlagsVideo.xml

<control type="image">
<posx>68</posx>
<posy>0</posy>
<width>64</width>
<height>48</height>
<texture>flags/movies/aspectratio/1.33.png</texture>
<visible>SubString(ListItem.FileName,1.33)<visible>
</control>


Ronie,

I concur with your opinion that adding the missing aspect ratios to xbmc is the way to go...and have already modified the code. The c++ code modification was pretty trivial, the meat of the work is recompiling xbmc from the source, then getting the skin to use the new aspect ratios. So far have a successful compile and binary (using the xbmc-12.0.tar.gz source tarball) for ubuntu 12.04 LTS, working on a MacOsx compile and binary.

After getting a working binary with the added Aspect Ratios, I had problems figuring out how to get Transparency to use them. The file that needs to be modded is:

skin.transparency/720p/Includes_MediaFlagsVideo.xml

Having zero skin programming experience, it was not a pretty task. At first I tried plugging your code suggestion above into the Includes_MediaFlagsVideo.xml file, but it always ended up causing the entire movie info block to come up empty, must have been doing it wrong. Next I tried to trace where the png files for each aspect ratio was stored in Transparency using the "brute force" method of find commands piped to grep commands....again no luck. My bet is it is probably explained in the xml code from Includes_MediaFlagsVideo.xml, but I know nothing about xml syntax, and can't see it even if the location is there. Note I did the exact same mods listed below in the file Includes_MediaFlagsVideoFullScreen.xml, not sure when/if this is used or the mod is needed, but since the aspect ratio lines are the same in both files thought it was best to mod both files.

The way I was able to get things to work in Transparency was to look at how Confluence handled things. I was able to find the location of the aspect ratio png files in the xbmc/addons/skin.confluence/ directories, and displayed 1.37, 2.40, and 2.76 icons using confluence. The file used do display the aspect ratio icons in that skin is IncludesCodecFlagging.xml. The pertinent code snippet is
Code:
<include name="AspectCodecFlaggingConditions">
                <control type="image">
                        <description>Aspectratio Image</description>
                        <width>55</width>
                        <height>35</height>
                        <aspectratio align="right">keep</aspectratio>
                        <texture>$INFO[ListItem.VideoAspect,flagging/aspectratio/,.png]</texture>
                </control>
         </include>


The aspect ratio icons are stored in addons/skin.confluence/media/flagging/aspectratio. By adding png files for the new aspect ratios compiled into xbmc, and having a definition for aspect ratio in the movie.nfo file, the aspect ratios of 2.40, 1.37, and 2.76 would display in the movie info line with an icon.

Since I could not figure out how to do the same using the original transparency skin code, I ended up creating subdirectories in addon/skin.transparency/media that were the same as those in confluence, e.g:
cd addon/skin.transparency/media; mkdir -p flagging/aspectratio

Next populated media/flagging/aspectratio with the png files, and edited the code lines below in addons/skin.transparency/720p/Includes_Media_FlagsVideo.xml from
Code:
<control type="image">                    
                        <posx>68</posx>
                        <posy>0</posy>
                        <width>64</width>
                        <height>48</height>    
                <texture fallback="mediaflag-aspectratio.png">flags/movies/aspectratio/$INFO[ListItem.VideoAspect,,.png]</texture>
  
</control>


to
Code:
<control type="image">
                        <posx>68</posx>
                        <posy>0</posy>
                        <width>64</width>
                        <height>48</height>
                        <texture>$INFO[ListItem.VideoAspect,flagging/aspectratio/,.png]</texture>
</control>


With these changes the correct aspect ratios are displayed when using Transparency. Limited testing of the skin with the mods have not shown any problems. If you have the time I would be interested in getting a detailed explanation of where the original code of Includes_MediaFlagsVideo.xml in Transparency gets its icon/png files to display aspect ratios....can't find those damn things in either the Userdata tree or the xbmc main app installation location. The only place I see aspect ratio png files is in the globalsearch script directory of transparency, but I could not see a tie-in with them and the movie info icons. There may be a more elegant way using your original code to do the same thing.

Some more good news, a successful build for macOsx10.7.5 (Lion) using un-modded code finally completed Big Grin . Going to package it and test out the dmg install file. If it works will build again with the modified cpp code for the new aspect ratios.
If you've got a patch submit it to GitHub - https://github.com/xbmc/xbmc - so we can all benefit.
(2013-03-17, 09:14)mm_half3 Wrote: [ -> ]If you have the time I would be interested in getting a detailed explanation of where the original code of Includes_MediaFlagsVideo.xml in Transparency gets its icon/png files to display aspect ratios....

as you may be able to tell from the original code:
Code:
<texture fallback="mediaflag-aspectratio.png">flags/movies/aspectratio/$INFO[ListItem.VideoAspect,,.png]</texture>

you need to create this folder:
skin.transparency/media/flags/movies/aspectratio/
and store your additional aspect-ratio images there.
(2013-03-17, 14:58)ronie Wrote: [ -> ]
(2013-03-17, 09:14)mm_half3 Wrote: [ -> ]If you have the time I would be interested in getting a detailed explanation of where the original code of Includes_MediaFlagsVideo.xml in Transparency gets its icon/png files to display aspect ratios....

as you may be able to tell from the original code:
Code:
<texture fallback="mediaflag-aspectratio.png">flags/movies/aspectratio/$INFO[ListItem.VideoAspect,,.png]</texture>

you need to create this folder:
skin.transparency/media/flags/movies/aspectratio/
and store your additional aspect-ratio images there.



yeah now that you mention it, it's pretty clearly in the code, your code includes the prefix to $INFO, and has a blank prefix field in the command arguments. It looks like the confluence code uses the prefix field.. Was going to try creating the media/flags/movies/aspectratio directory if using the code from the confluence files did'nt work, but forgot about it after I was able to get the icons to show up with the confluence code, it was early in a.m. Blush

Since the default deployment of the skin does not have the prefix directory or any png files there, where are the png files used for aspect ratios in transparency?
Is there a xbmc system directory prefix it is defaulting to? The only png files in the xbmc system install tree I could cull out with find/grep commands were the confluence ones. Thought that may have been what transparency used, but when I modded the confluence icon location to include new png files, transparency did not pick them up.
(2013-03-17, 20:42)mm_half3 Wrote: [ -> ]Since the default deployment of the skin does not have the prefix directory or any png files there, where are the png files used for aspect ratios in transparency?
Is there a xbmc system directory prefix it is defaulting to? The only png files in the xbmc system install tree I could cull out with find/grep commands were the confluence ones. Thought that may have been what transparency used, but when I modded the confluence icon location to include new png files, transparency did not pick them up.

all images Transparency! uses are packed inside the Textures.xbt file.

should you need the original ones, you can get them from the svn repo:
http://transparency-xbmc.googlecode.com/...pectratio/

a blank image is also included:
https://transparency-xbmc.googlecode.com...iaflag.png
O.k. that clears it up. Thanks for the response, and the work on the skin.
Ronie,

Almost got things working so that the Aspect Ratios are displayed correctly using the modded xbmc binaries. Based on your last post, decided to put the new icons in the Transparency! Textures.xbt file to eliminate the need for the external flags/movies/aspectratio directory, and so the original Transparency! Include_MediaFlagsVideo.xml files could be restored. Used your blank AR icon to create the new ones for 1.37, 2.40, and 2.76. Also modded the 1.78 png to have a small 1.78 text block below the 16:9. Things work perfectly for everything except 2.35 movies. For these movies the value for the Aspect Ratio is being changed to 1.78, when the movie is played. If the movie info is queried when these movies are being played the AR will say 16:9 (the 1.78 AR icon) , same thing after stopping the movie. It seems the player is overwriting the AR value originally pulled from the movie.nfo file, and making it 1.78. Probably related to horizontal black bars being encoded into the movies, but not sure about that. The movies display with a 2.35 AR in the player, and if the movie info is refreshed, the correct 2.35 icon is displayed again. This is not Transparency! related as it happens in confluence as well. Any idea what might be going on? I think xbmc must be storing the AR value somewhere, and when the movie info is refreshed it grabs it from the movie.nfo file, if the AR is defined in there. Then the player must determine what the AR is based on the resolution it reads, but since the black bars are encoded in these movies, the player counts the black bars in it's AR calculation, and changes the value to 1.78. When I get some time may try to trace the xbmc source code to see where the code doing this might be, and see if it can be revised.


Another minor AR icon issue crops up when a movie is playing, if you hover toward the bottom of the player, and get the player buttons to display, the movie flags are displayed also, but the AR icon is a blank icon with an arrow bisecting it. This happens for all movies regardless of the AR. Almost like xbmc does not know where to get the png files to display the AR. Not sure if this is specific to Transparency! or not, since confluence does not display any of the movie flags in the player. Maybe something else that can be fixed by modifying the xbmc source.
yup, xbmc will use the actual AR from the stream once you play it.
it'll overwrite the value in db that was initially taken from the .nfo file.

no idea why the icons don't show up on the video osd.
double-check with an unaltered version of xbmc and transparency!
The unaltered version of xbmc and transparency! is showing the icons in the player. Will troubleshoot it later to see what is causing the problem.

Thanks.
if you made change to Includes_MediaFlagsVideo.xml
you'll have to make the same changes to Includes_MediaFlagsVideoFullScreen.xml

those are used on the video osd.
(2013-03-19, 19:11)ronie Wrote: [ -> ]if you made change to Includes_MediaFlagsVideo.xml
you'll have to make the same changes to Includes_MediaFlagsVideoFullScreen.xml

those are used on the video osd.

Great tip....after adding the new AR png files to the Textures.xml file, I modified the Includes_MediaFlagsVideoFullScreen.xml file with the idea of getting it back to it's original code....left out the prefix you use for the $INFO command, without it understandable the calls would not know what png file to display in the player. The reason calls using MediaFlagsVideo.xml worked is I left a copy of of the original Includes_MediaFlagsVideo.xml file in the 720p directory and just moved it back to in place. Should have grabbed the original FullScreen.xml file from a remote sever, instead of editing it back. With the original file the player is showing the AR png files again.


Been working on a code modification that will stop the player from overwriting scrapped nfo file data, and it looks like I have a successful modded build using a tarball of xbmc-12.0.tar.gz committed at the end of January. This EARLY 2011 THREAD where you and one of the users involved with coding how the VideoPlayer interacts with media flags is what finally got me on the right track, and digging into Application.cpp....so a belated thanks on that Wink

Briefly looked over Application.cpp from a github source download earlier in the week, the file has been updated quite a bit, and I could not easily see a code group that wrote to the xbmc VideoDatabase, like in the tarball source. Opened up a THREAD in the developers forum for comments on how to do the mod on the newer source, but no responses yet. Would prefer to get this mod working with the latest src....maybe after finalizing things using the taraball source.

At first was just looking to disable the writes all together, then decided it would be much better if a user could choose if they want to disable player overwrites, because there could be times when a user can't access a nfo file with good data for media flags, and the flag data from the player is just fine. The way the Application.cpp mod does this is by checking a flag (a file in special://home), and if it is there it bypasses the VideoDatabase writes. Created a very basic add-on python script that when enabled in xbmc, it creates the file checked as a flag in Application.cpp. Next up is investigating python add-scripting, to see if the script can be refined so it will allow the user to choose between disabling VideoPlayer overwrites, or enabling them . I can accomplish this now with two basic add-on scripts, one to disable player overwrites, and another to go back to the default of allowing player overwrites...but a single script with both options is much nicer.

Would like to hear your thoughts on this approach, or a better way of allowing a user to toggle on and off this "feature". The python add-on development forum is probably the best place to post questions on how to do this via a script, but since you have been so helpful (..allright. patient...with some really newbie questions) on this topic from the start, decided to ask here . It also serves as a nice summary to where the subject of this thread is currently at.
just continue in the development thread,
this is getting way off-topic for a skin thread ;-)
(2013-03-17, 09:21)Hitcher Wrote: [ -> ]If you've got a patch submit it to GitHub - https://github.com/xbmc/xbmc - so we can all benefit.


Getting more AR png files was a pretty quick patch, since the pertinent code segment was published before....getting the VideoPlayer to not overwrite info in the nfo file has been more difficult. The coding itself for this is only a few lines, but finding where it was being done at took some time, and it is probably ready also. I read the suggestions on how to get patches committed into github, from the developers forum, and will try to start the process soon for those who might be interested in this.
Pages: 1 2