Microsoft Communities

Silverlight

Posted By: Ben Waggoner | Jun 4th @ 10:11 PM

A recent conversation over at the Streaming Media Advanced list sparked a rant from me about the importance of comparing implementations of codecs, not just codecs.

To that end, I thought I'd do a demo to show how much improvement there's been in Windows Media since the launch of Windows Media 9 Series back in 2003.

A recent conversation over at the Streaming Media Advanced list sparked a rant from me about the importance of comparing implementations of codecs, not just codecs.

To that end, I thought I'd do a demo to show how much improvement there's been in Windows Media since the launch of Windows Media 9 Series back in 2003.

Below, you'll find two streams, encoded with the same settings but with tools from different eras. The streams are both

  • Live encoding from a preprocessed file (so that preprocessing differences don't matter)
  • And yes, it's the "Lady Washington" footage again.
  • 640x360
  • 29.97 fps
  • 600 Kbps video
  • 64 Kbps 44.1 stereo WMA audio
  • 5 second buffer
  • Keyframe every 5 seconds

The difference is that the first is encoded with the original Windows Media Video 9 codec (ala just Windows Media Player 9 installed, like a stock Windows XP SP2 machine), and the second with the VC-1 Encoder SDK implementation in Expression Encoder 2. Pretty dramatic differences, I hope!

  Live Windows Media 2003 Live Windows Media 2008
Silverlight embedded page 2003 in Silverlight 2008 in Silverlight
Direct link to WMV
(right-click to download)
2003 direct WMV link 2008 direct WMV link

...reminding me that I really need to blog how to make a Silverlight dual media player that can play two versions of the same clip in sync.

So, what makes this big difference? There's been a huge amount of work and three major releases (Format SDK 9.5 and 11, and VC-1 Encoder SDK) since then, so I won't give a complete list, but a few of the highlights.

  • 4-way threading instead of 2-way threading, doubling performance on modern machines.
  • Lots of SSE2 and SSE3 optimizations to improve performance.
  • "Adaptive Complexity" that dynamically adjusts the complexity of the encoder, to make sure it's always using all available CPU power, without ever dropping frames. This compares to the old default live complexity of 1 (out of a 0-4 range).
  • Using B-frames (supported in the old decoder, but not used in the original encoder) which improve compression efficiency and enable efficient encoding of flash frames.
  • Lookahead Rate Control, where the codec buffers a few frames into the future, so it knows when it needs to start saving some bits for an upcoming keyframe, or when it's save to use a lot of bits on a few challenging frames.

A lot of the above are about performance. With offline encoding, better performance just makes for faster encoding. But for live encoding, it helps quality, because it allows the codec to do more math per pixel to find the optimum way to encode that file.

So, how big a difference is this? Below is a graph showing the Quantization Parameter (QP) for the two encodes. QP is a measure of how encoded each frame is, with higher values more highly compressed. In VC-1, the range is 0-31. A good rule of thumb is that QP of much below 8 looks pretty good, and QP of 8 or above...won't. Now, a live SD encode at 600 Kbps is pretty darn aggressive, so there's plenty of spots where both encodes certainly show artifacts. And quality varies a lot throughout the file as the the complexity of the video goes up and down, as this is a Constant Bitrate (CBR) encode. Note the relatively low QPs near the end of the file, where the easy credits scroll comes in.

But still, the modern VC-1 implementation (in red) with all of the above is dramatically better. While the old encoder (in blue) spikes all the way up to the maximum QP of 31, the new one is typically several QP lower, and maxes out at a QP of 20 instead.

QP-chart

That said, man, my Excel-fu sure has declined over the years. Hard to believe I used to teach classes on making good-looking Excel charts back in the early 90's. Anyway, just remember that lower is better, and red is our current stuff.

Posted By: Galileu Vieira | May 9th @ 12:56 PM
Estava lendo uns emails quando vi que um colega na empresa tinha reparado uma pequena, porém importante, novidade no Live Mesh. Já é possível assistir vídeos dentro do Mesh Desktop. Para lembrar a todos, o Live Mesh é uma plataforma que conecta dispositvos, serviços e arquivos visando um mundo onde todas as nossas informações importantes sempre estarão ao nosso alcance. Você pode ver um exemplo bem claro nesse vídeo aqui.

No Live Mesh o usuário tem um área de trabalho na Web chamada Web Desktop. Nessa área você pode acessar os seus arquivos de qualquer computador ou navegador Web, graças ao Silverlight. E agora você consegue não só baixar esses arquivos mas também visualizar suas fotos, ouvir suas músicas e, a novidade, ver os seus vídeos. O Ray Ozzie disse antes do lançamento do Live Mesh que será possível licenciar conteúdo uma só vez e assitir em qualquer dispositivo ou na Web. Assista a demonstração que gravei em vídeo e você verá que esse momento não está longe.

Page Navigation