Video Resolution

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Eddage Offline
Senior Member
Posts: 184
Joined: Jul 2011
Reputation: 4
Location: Bristol, England
Post: #1
I was just wondering how XBMC reads the video resolution of the files?

Obviously if the pixel width is 1080, 720, 576, 540 or 490 then it's obvious but I have some videos that I've encoded with handbrake that have come out as 720x592 instead of 720x576 (not sure why, they've all come from the same dvd source). XBMC then returns these as 720 and so makes it look like they are HD, when they aren't.

At the moment I'm guessing that XBMC displays anything with a pixel width over 576 as 720, is there any way to change this or am I going to have to re-encode these videos to actually have them read as SD, like they really are?

Thanks
find quote
pecinko Offline
Donor
Posts: 3,671
Joined: Dec 2008
Reputation: 48
Location: Prague / Belgrade
Post: #2
<visible>stringcompare(ListItem.VideoResolution,720)</visible>

Does not work for you?

My skins:

Amber
Quartz

find quote
ronie Offline
Team-XBMC Member
Posts: 8,985
Joined: Jan 2009
Reputation: 147
Post: #3
Eddage Wrote:I was just wondering how XBMC reads the video resolution of the files?

to find out, you'll have to check the source-code.
the logic is defined in utils/StreamDetails.cpp

PHP Code:
if (iWidth == || iHeight == 0)
    return 
"";

  else if (
iWidth <= 720 && iHeight <= 480)
    return 
"480";
  
// 720x576 (PAL) (768 when rescaled for square pixels)
  
else if (iWidth <= 768 && iHeight <= 576)
    return 
"576";
  
// 960x540 (sometimes 544 which is multiple of 16)
  
else if (iWidth <= 960 && iHeight <= 544)
    return 
"540";
  
// 1280x720
  
else if (iWidth <= 1280 && iHeight <= 720)
    return 
"720";
  
// 1920x1080
  
else
    return 
"1080"

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Eddage Offline
Senior Member
Posts: 184
Joined: Jul 2011
Reputation: 4
Location: Bristol, England
Post: #4
pecinko Wrote:<visible>stringcompare(ListItem.VideoResolution,720)</visible>

Does not work for you?

This is what my resolution flag code looks like...

[HTML]
<control type="image"> <!--resolution flag-->
<posx>130</posx>
<posy>171</posy>
<width>65</width>
<height>43</height>
<include>AudioFlagsVars</include>
<texture>$INFO[ListItem.VideoResolution,flags/resolution/,.png]</texture>
</control>[/HTML]

So as long as XBMC itself is saying that a file with a resolution of 720x594 is 720 then it will always show the 720 flag. I'm not sure how that visible tag would work.

ronie Wrote:to find out, you'll have to check the source-code.
the logic is defined in utils/StreamDetails.cpp

PHP Code:
if (iWidth == || iHeight == 0)
    return 
"";

  else if (
iWidth <= 720 && iHeight <= 480)
    return 
"480";
  
// 720x576 (PAL) (768 when rescaled for square pixels)
  
else if (iWidth <= 768 && iHeight <= 576)
    return 
"576";
  
// 960x540 (sometimes 544 which is multiple of 16)
  
else if (iWidth <= 960 && iHeight <= 544)
    return 
"540";
  
// 1280x720
  
else if (iWidth <= 1280 && iHeight <= 720)
    return 
"720";
  
// 1920x1080
  
else
    return 
"1080"

So it looks to me like I was right, XBMC is returning a 720x592 as 720, guess I'm just gonna have to re-encode the videos...
find quote
pieh Offline
Team-XBMC Member
Posts: 672
Joined: Aug 2010
Reputation: 13
Location: Poland
Post: #5
you can also make partial nfo file including only some streamdetails - resolution in this case

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

My previous forum/trac nickname: grajen3
find quote
Eddage Offline
Senior Member
Posts: 184
Joined: Jul 2011
Reputation: 4
Location: Bristol, England
Post: #6
pieh Wrote:you can also make partial nfo file including only some streamdetails - resolution in this case

Ah, didn't think to try adding it to the nfo's, I use metabrowser so all my nfo stuff is local anyway!

Thanks pieh, I'll give it a try now!
find quote
>>X<< Offline
Alaska Group
Posts: 2,901
Joined: Jun 2009
Location: On a farm trying to catch a fox
Post: #7
I've tried faking the video resolution in an nfo and as soon as you play the video it reverts again even with "extract video information" turned off in XBMC

Current HTPC Lian-Li PC-C37 • Gigabyte GA-E7AUM-DS2H • Intel C2D E8400 E0 Stepping • OCZ Vertex SSD • 4GB Corsair TwinX XMS2 DDR2 • Corsair HX650W Modular PSU (Free Upgrade) • LG CH08LS10 Blu-Ray Drive • Scythe Big Shuriken • Acousti DustPROOF 70mm Fan
find quote
Eddage Offline
Senior Member
Posts: 184
Joined: Jul 2011
Reputation: 4
Location: Bristol, England
Post: #8
&gt;&gt;X&lt;&lt; Wrote:I've tried faking the video resolution in an nfo and as soon as you play the video it reverts again even with "extract video information" turned off in XBMC

Damn your right, at least I read this after only changing a couple rather than going through everything I needed to change!
find quote
pecinko Offline
Donor
Posts: 3,671
Joined: Dec 2008
Reputation: 48
Location: Prague / Belgrade
Post: #9
Returning 720 HD for 720x592 is maybe worth fixing in XBMC. It's little silly, IMHO.

My skins:

Amber
Quartz

find quote
Eddage Offline
Senior Member
Posts: 184
Joined: Jul 2011
Reputation: 4
Location: Bristol, England
Post: #10
Agreed!
find quote
flabbamann Offline
Junior Member
Posts: 19
Joined: Feb 2013
Reputation: 0
Post: #11
Hi,
i know this thread over two years old, but i just encountered the same problem.

I ripped a TV show DVD box, and some of the dvds are 720*592 and some are 720*576. No idea why.
So some episodes show up as HD and some as SD in xbmc.

Could we just expand the allowed heigth of PAL to 592 while still returning 576? Or would this lead to problems elsewhere?
find quote
ronie Offline
Team-XBMC Member
Posts: 8,985
Joined: Jan 2009
Reputation: 147
Post: #12
(2014-02-07 03:33)flabbamann Wrote:  Hi,
i know this thread over two years old, but i just encountered the same problem.

I ripped a TV show DVD box, and some of the dvds are 720*592 and some are 720*576. No idea why.
So some episodes show up as HD and some as SD in xbmc.

Could we just expand the allowed heigth of PAL to 592 while still returning 576? Or would this lead to problems elsewhere?

changes to the resolution detection are currently being discussed :
http://trac.xbmc.org/ticket/14898

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
flabbamann Offline
Junior Member
Posts: 19
Joined: Feb 2013
Reputation: 0
Post: #13
Ah, great.
Thanks for letting me know.

I am new to the bugtracker, may I subscribe to a bug somehow to get notified about updates? I did not find this option...
find quote
ronie Offline
Team-XBMC Member
Posts: 8,985
Joined: Jan 2009
Reputation: 147
Post: #14
(2014-02-07 21:08)flabbamann Wrote:  Ah, great.
Thanks for letting me know.

I am new to the bugtracker, may I subscribe to a bug somehow to get notified about updates? I did not find this option...

cc'ed you on the ticket. you should receive updates now.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
MacGyver Offline
Fan
Posts: 454
Joined: Jan 2007
Reputation: 1
Location: Weilerbach Germany
Post: #15
I got one for you, a 960x720 video is not registering as 720p, but it would be if your order was reversed. So as it stands now if I want this particular video to register as a 720p (HD), I'm going to have to add at least a singular pixel to the width. Correct? Or do you plan to reorder the check to start with the higher resolutions at the top?

1x Revo 1600, 2x Foxconn NT-330i, 1x ATV1, 1x ATV2 - All running OpenELEC (except the ATV2), and sometimes an old XBOX running 3.0 :)
find quote
Post Reply