This is from the Official MS Vista Ultimate website.
Last week, we’ve made the Windows DreamScene Content Pack available to owners of Windows Ultimate. The Content Pack will only be downloadable to those who have already installed our Windows DreamScene extra or the DreamScene Preview that we released in February.
After installing the Content Pack, you will see a few new goodies when changing the desktop in the Personalization Control Panel:
As you can see, in addition to the Windows Aurora that was installed along with DreamScene, four new desktops have been added. The Ultimate team has been referring to the new videos as “Bees and Thistles”, “Puddle”, “Moss” and “Orange Plasma,” respectively. We selected these four videos because we think they represent a good cross-section of DreamScene content.
However, in the process of testing the Content Pack, some people noticed that the “Puddle” video did not always have a proper thumbnail, thus making it difficult to determine what the video was without playing it first:
Because no filename or description is displayed, it can be difficult to determine what the video is without playing it. Hovering over the unknown video just displays the mostly useless filename “vid8898.mpg”. (Why we picked those filenames is a whole other blog entry.) Luckily, simply clicking on the unknown video will change the desktop to a live preview of the video, so you can quickly determine what the video is without actually changing the desktop. But this is still not quite as good as if we’d had a thumbnail.
This brought the Ultimate team to an interesting question: why does the Puddle video only sometimes thumbnail correctly, and is there something that can be done to make it thumbnail correctly all the time? To understand why, I first had to understand Windows’ thumbnailing mechanism.
In Windows, thumbnails are created by Shell Extensions. By looking at the appropriate place in the registry, I was able to find the code that is responsible for creating thumbnails for .mpg files. As it turns out, the code that does the thumbnailing for MPEGs is actually part of Windows Movie Maker. The shell extension in the registry is just a little wrapper that invokes RunDLL32 to call the Movie Maker DLL and create the thumbnail. This is interesting.
Also interesting is that the code employs a fixed timeout of 7 seconds to complete thumbnailing each MPEG. If, for some reason, it happens to take more than 7 seconds to determine a suitable thumbnail, the process is terminated and no thumbnail will be created for the video at all. This is the reason some machines failed to create a thumbnail while others succeeded; some machines were not fast enough to finish creating the thumbnail within their 7-second allowance.
So, we now know that faster machines will thumbnail the Puddle movie with no problems, while slower ones will not.
The next question was why only Puddle was affected. Why do all of the other videos show up with proper thumbnails even on painfully slow machines? A few more hours of debugging yielded the answer.
Consider the case where you have a whole folder full of videos that begin with a fade-in from black. If the thumbnailer always just used the first frame for the thumbnail, then all of the thumbnails in the folder would be black rectangles. That’s hardly useful. So, the MPEG thumbnailer contains some smarts to handle videos that start with a fade-in from black or white. Essentially, it looks at the video’s first frame and calculates the average pixel brightness for it. If this value is too dark (or too bright), then it goes on to check each subsequent frame until it finds one that is suitably bright to be used as a thumbnail. If no frame with a suitable brightness is found, then the one that is the brightest will be used. This way, videos that fade-in will have their first reasonably-bright frame used for their thumbnail.
So the problem with Puddle is that the entire video is too dark. The thumbnailer has to render (and calculate the brightness of) every single frame of the movie because it never finds one bright enough to meet its criteria. The other videos all have a suitably bright first frame, so the thumbnailer terminates almost immediately. But because it has to process the entire Puddle video, it takes much longer to process it so it is much more likely to take more than 7 seconds and be aborted.
Essentially, there can be one of three possible outcomes when Windows creates a thumbnail for an MPEG file:
The video contained a suitably bright frame near the start of the video, so thumbnailing was completed successfully (and very quickly); This is usually the case.
The video didn’t contain a suitably bright frame but the machine was fast enough that it was able to process every frame of the video within 7 seconds and successfully used the brightest frame as a thumbnail.
The video didn’t contain a suitably bright frame and the machine was not fast enough to process the entire video and timed-out. No thumbnail is available and the hot air balloons appear instead.
In fact, you’ll notice when the Puddle video is thumbnailed, the thumbnail image is not the first frame, but actually one near the end of the video. You’ll also notice that when Vista is creating thumbnails for the videos, it will take a few seconds to display the thumbnail for the Puddle video. Of course, all of this applies to Windows’ thumbnailing of MPEGs in-general; it isn’t DreamScene-specific.
So, there it is. MPEG videos that are too dark or too bright might not thumbnail correctly in Vista when run on slower machines. Unfortunately, our Puddle video is in this class. The good news is that if a machine is borderline-fast-enough to thumbnail, it only has to succeed once; if a thumbnail is successfully created one time, it will be cached and will continue to be displayed from then on. Since the Puddle video is a relatively short (7 second) clip, it should have a correct thumbnail on most modern machines.
Published Monday, July 02, 2007 5:44 PM by UltimateTeam