Video Resolution
#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
Reply
#2
<visible>stringcompare(ListItem.VideoResolution,720)</visible>

Does not work for you?
My skins:

Amber
Quartz

Reply
#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"
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#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...
Reply
#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
Reply
#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!
Reply
#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
Reply
#8
>>X<<' 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!
Reply
#9
Returning 720 HD for 720x592 is maybe worth fixing in XBMC. It's little silly, IMHO.
My skins:

Amber
Quartz

Reply
#10
Agreed!
Reply
#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?
Reply
#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
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#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...
Reply
#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.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#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?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply

Logout Mark Read Team Forum Stats Members Help
Video Resolution0