Sorting by Video Quality or Smart Playlist Filter by Width and Height
#1
I've searched the forum, wiki and other resources outside the xbmc domain and can't get to have an answer to my request...

I just want to sort my videos/films by quality (480p,720p,1080p) or even better make a Smart Playlist where the filter is the quality or dimensions of the video. In the wiki there isn't a comprehensive list of the available filter fields that could be used to make the filter. Can anyone of the development team point me in the right direction ? I am developing a MOD to the Alaska Revisited Skin and one of the main features is the ability to create submenus for different HD content.

Thank's to all
Reply
#2
So since I was waiting for some help, I continued to search for more info and finally got something. I've made a Smart Playlist throw playlist editor inside XBMC, there you can choose the video resolution filter :

ex:

rule -> video resolution is 720 it gives every 720p film in library


BUT...


if you choose to get the hits sorted by video resolution it simply doesn't work, you select the playlist and nothing happens... maybe a bug?


Either way the perfect solution for me was to simply sort the films list throw the regular sort capability in XBMC... why is possibly to filter by it in a Smart Playlist and not sort by it by default ? Is there a method call passing a parameter where I can pass the field "video resolution" has the sort by entity? Because in the background what the filter and sort of smart playlist is doing is calling XBMC framework to do it...
Reply
#3
The reason is because the resolution information is stored in a separate table. You can only order by things which are in the "view" and video resolution isn't joined into the view for two reasons:
1) It significantly slows the query, making it very slow to navigate.
2) Files could contain multiple video/audio streams and you can only join one to the view.

I would imagine you could only join the first video stream resolution, but it is still slow. The workaround being to create separate playlists for the 3 resolutions.

There's another smaller issue I'll mention solely out of completeness, the resolution isn't stored as 720/1080/etc, it is actually calculated based off the width of frame and the closest standard is chosen for display. If you chose to sort by resolution then name, it may be confusing that all the 720 material may not be in name order assuming they have slightly different frame widths.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#4
Hi, thanks for your response.
I've seen myself the data model of XBMC and it's true that the stream information is in separate table, where I disagree with you is in the assumption that it will be slower... It's just a case of a Union between two tables that already relate with one another, and you will not have a performance degradation when browsing throw the library because the list is populated with the items already sorted. Another thing is the multiple stream you refer to, in fact that is a problem but I don't remember the last time I had a multi-stream video in my hard drive.... so... is it really a problem?

I'm looking in another way of possibly have what I want... in a video library, in the case FILMS you can choose to filter information by genre, director, etc... my next goal is to get implemented the video quality of the streams, FHD Films, HD Films, SD Films etc... the same will be true for TV shows.


About the values stored in the DB as two separate values for the width and height... When you filter base in video resolution in the SmartPlaylists the value is the final frame aspect (720,1080) and not the width or height on the video frame so the property of the class video should return already a transformed value with final video resolution in standard format.


Sorry for my English, some things are hard to translate Smile
Reply
#5
fireball.pt Wrote:Hi, thanks for your response.
I've seen myself the data model of XBMC and it's true that the stream information is in separate table, where I disagree with you is in the assumption that it will be slower... It's just a case of a Union between two tables that already relate with one another, and you will not have a performance degradation when browsing throw the library because the list is populated with the items already sorted.
I actually tested joining the StreamDetails table into the view query back when I added it but I think I must have tried something else because you're right the performance isn't all that bad. At the time though, loading a 1000 item library would take a long time and it added a significant overhead to add the table to the join. That does not appear to be the case now.
Quote:Another thing is the multiple stream you refer to, in fact that is a problem but I don't remember the last time I had a multi-stream video in my hard drive.... so... is it really a problem?
I dunno, Anime people are crazy people so I'm sure there is some vocal XBMC user who would complain that their Animes are showing up multiple times and posting in every thread about it. Smile The can be remedied by using a sub-select though, at a small performance penalty and with the limitation that only one item can be returned from a subselect expression.
Quote:I'm looking in another way of possibly have what I want... in a video library, in the case FILMS you can choose to filter information by genre, director, etc... my next goal is to get implemented the video quality of the streams, FHD Films, HD Films, SD Films etc... the same will be true for TV shows.
That might be a better idea. I think... they run separate preset queries so that wouldn't interfere with the main list. I could be wrong about that though.

Quote:About the values stored in the DB as two separate values for the width and height... When you filter base in video resolution in the SmartPlaylists the value is the final frame aspect (720,1080) and not the width or height on the video frame so the property of the class video should return already a transformed value with final video resolution in standard format.
The streamdetails class returns a transformed value but the database does not. It is my clever code which makes it seem like the smartplaylist does what you're expecting! The query does a ...
Code:
WHERE idFile IN (SELECT DISTINCT idFile FROM StreamDetails WHERE iVideoWidth
  ... >= X and iVideoWidth <= Y)
  ... < X and iVideoWidth > Y)
  ... < X)
  ... > Y)
^^^^ Selected depending on your comparison selected
and if you just has the raw iVideoWidth in your view (which you would get from a simple join or subselect, you only get the videowidth, not the quantized resolution you're expecting. They will be sorted all funky in an order roughly representing their HD-ness.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Sorting by Video Quality or Smart Playlist Filter by Width and Height0