Archive for June, 2007

22
Jun
07

Improve the quality of your WMV files, use Silverlight!

Strange but true.

If you run the same WMV file in Windows Media player and compare it to the exact same file running through Silverlight in the browser you would assume they they must look the same.

Well I thought they would.

Not so.

The version running through Silverlight displays more colour depth and better contrast than the same file running through Media Player. I then thought this must be a trick of the browser, maybe it’s something as simple as the browser tweaking the colour gamut – so I took the same video and used an embedded windows media element and played it back.

The result?

Exactly the same as the previous test. The version running in Silverlight has better contrast and colour than the same file, running in the same browser via an embedded media element.

When I get a chance I’ll hook up two videos to show this as it’s easier to see on the moving imagine but here’s a couple of stills.

 

Windows Media Player

Capture hist1

 

Silverlight

Capture - Copy hist2

 

In terms of colour both the warm and cold hues have more depth and clarity, and when you look at the background where the man is standing there is more contrast in the Silverlight version. I took a quick look at the histogram of the stills and the Silverlight version shows an extended range.

So what’s different? Why is Silverlight proving better quality with the same video?

The difference seems to be down to where the video is decoded.

In Silverlight we don’t rely on the GPU for decoding or format conversion, and Silverlight also does all its scaling transforms outside of the decoder/color space conversion code. WM on the other hand relies on the GPU.  So it seems that the GPU is actually giving a small hit to the overall quality.

I’d be interested to see if machines with different GPU’s see the same, mines a ATI 1600 Radeon. I’ve tried this with 5 different pieces of video and they all look better in Silverlight.

So, improve the quality of your video, use Silverlight 🙂