Join us in person this November for Streaming Media West in Huntington Beach, CA. Register now to save $100 off your pass!

Tutorial: High-Touch Encoding With Microsoft Expression Encoder 2

Article Featured Image
Article Featured Image

The other notable issue with the original clip was keyframe popping—when an obvious "jump" in the video happens at the keyframe rate of the video. Watch the original FLV in the online version of this article (www.streamingmedia.com/article.asp?id=10409), and you’ll see it during any of the longer static shots. Since the whole section with the cards is a single shot lasting more than 3 minutes without any hard cuts, there wasn’t a place for natural keyframes (automatically inserted at a hard cut) to go. Thus, keyframe transitions would happen while the cards were otherwise static, making even a slight change visible. And the VP6 codec is known for big jumps in image quality at keyframes.

I also wanted to show off the Expression Encoder templates a bit by doing thumbnail navigation, which provides a graphical interface to set markers on particular frames and flag them to be keyframes or thumbnails. A thumbnail becomes an image file that, with the supported templates, automatically gets included in the menus for navigation (think of a chapter menu on a DVD). Normally you also want to make the chapter points keyframes, since keyframes support immediate random access to that frame, hence hitting a chapter button yields a nearly immediate start.

This was an opportunity to kill two birds with one stone: If I set the markers on the first static frame of every card, it would be a nice, high-quality image that the later frames of that GOP will be based on, propagating quality forward. If I set my keyframe spacing long enough, there wouldn’t be any other keyframes in that interval to cause keyframe popping, and so the static card would be very consistent and efficiently encoded.

So, I set a marker for each person and flagged each to be a thumbnail and a keyframe. The audio didn’t always sync up exactly, so that the person’s name began after his or her card was down or sometimes the first name was cut off. This was easy to fix by just delaying the audio a second.

You can also use nonthumbnail keyframe markers; these become keyframes without showing up in navigation. I stuck a few of those in the intro and outro sections, and on the first full frames after the logo gets built. Since the sponsor pays the bills (RipCode in this case), I always want to make sure that the logos remain nice and crisp.

The ability to set keyframes has been around in compression projects for ages now; I did a lot of this in the Cinepak era, as that codec was prone to keyframe popping issues. Modern codecs such as VC-1 do a much better job of finding good natural keyframes and reducing popping issues. The Silverlight version still would have looked a lot better than the original Flash even if I hadn’t set them, but the markers did provide a further boost in quality. But don’t think this is something that should be done for all clips; this clip is unusual in having minutes without cuts with a mix of static and moving elements at an extremely low bitrate. Most normal film and video content doesn’t gain anything by adding manual keyframes.

Encoding Settings
Now that we’ve got the source all set up, let’s dig in to the precise encoding settings that we can set in Expression Encoder. Many of these concepts are applicable to other tools using the VC-1 Encoder SDK (details at www.microsoft.com/resources/mediaandentertainment/vc-1encodersdk.mspx), and many are applicable to other codecs as well.

The original FLV file was 640x480 with VP6 video at 488Kbps (the encoder was set to 400Kbps, but VP6 is infamous for overshooting the requested bitrate in aggressive compression) and MP3 audio at 48Kbps. For an apples-to-apples comparison, we’ll stick with the original settings so the file will go at the same size.

Additionally, we’ll target a peak bitrate of 1Mbps (the worst-case scenario of the maximum video and audio bitrates at the same time), which will stream without buffering to most consumer broadband connections today.

Frame Rate: Source—We want to capture all the motion in the source perfectly (29.97 fps in this case).

Streaming Covers
for qualified subscribers
Subscribe Now Current Issue Past Issues