YouTube gives you the choice to sort the search results based on Relevance, Newest, Oldest and rating. However, it does not give you the choice to sort the search results based on video Resolution although it is technically possible as we will see later
In mean time, YouTube allows you to click on advanced search options and check on “Show only video with HD feature” but that does not solve the problem since it restrictes the search results to HD videos only and does not sort the search results based on video resolution so you might have the first result in HD format but with lower resolution than the fourth one for example. Same options and restrictions are applied in YouTube APIs
Video resolution and other video technical information are stored in YouTube server and you can notice that once you upload a video into your YouTube accont. Also, those information are attached to the FLV file itself in the file meta-data. That means if you wanna search YouTube based on video resolution you have to either have an access to resolution information in YouTube server (which is not possible in YouTube APIs) or to read the resolution information from FLV file meta-data (which is technically possible with many limitations) as we will see later
In order to read a file meta-data you have to download it to your server first. Downloading time is one of the limitations. imagine a typical number of YouTube search results (say 500). Each file has to be downloaded to your server, extracted meta-data from and re-ranked based on the resolution
YouTube legal agreement does not allow to download and save FLV file. This is another limitation. What about download a file then delete it immediately? Simply I do not know . It is really hard to figure out a legal agreement
Anyway, with all the above limitations I made a demo software that search YouTube based on video resolution. It works perfectly as long as the video results durations are less than four minutes. Otherwise, it will face a server time out issues since it takes too much time to download videos with duration more than four minutes. Try to search for something like “very short video” . That would possibly provide videos with short duration. Also try to reduce the search results using the drop down list
Here is a sample of what you are expected to see,Click Here. You can understand the point when you compare it with what YouTube provide for the same search string, Click Here. Use a non-Internet Explorer browser in order to see the atom feed in its right order
. You will see in the fisrt link that the video results are sotred based on resolution while they are not in the second link
Just give it a try and tell me what do you think.
Here I beg for your patience. The response time is 3 minutes in average. I agree that is not acceptable but this website is just a proof of concept
Last but not Least: Special Thanks to Eng.Md-Rahman from MCRLAB@UOTTAWA





