Encoding Best Practices, Part 2 | www.creativeplanetnetwork.com
RSS
Home
Loading

Encoding Best Practices, Part 2

 Continue Reading

Encoding Best Practices, Part 1

On2 VP6

In the previous installment, you read about which streaming codecs major broadcasters and corporate producers were using. Now you''ll see the results of some quality comparisons that I presented at Streaming Media East in New York last month. I compared the quality of H.264, Microsoft''s VC-1, and On2''s VP6 codec using both SD and HD test clips, which I describe further below.

As you may know, H.264 is a standard, and many companies have produced their own standards-compliant H.264 codecs. For this reason, H.264 quality varies depending upon who created the codec and the even the encoding tool. As part of my presentation, I compared the output of three H.264 codecs—MainConcept, Apple, and Dicas—and found that MainConcept as rendered by Rhozet''s Carbon Coder produced the best quality, so I used this output to compare against VC-1 and VP6.

Regarding VC-1, note that it''s the same codec as in Microsoft''s more familiar Windows Media Video 9 codec. It's just a rebranding to reflect SMPTE''s designating VC-1 a standard—primarily for HD playback devices such as the Samsung Blu-ray BD-P1000 that sits in my living room. For the record, I produced all VC-1 comparisons using Microsoft''s Expression Encoder 2.

VP6 is On2''s most famous of all Flash codecs, which I produce using On2''s flagship encoding tool, Flix Pro. There are now two versions of the VP6: VP6-S is recommended for high-definition production, and VP6-E is best for SD production.

Just before Streaming Media East, On2 announced a VP6 update that supposedly would deliver 40-percent better quality than the existing codec. Because On2 hadn''t yet integrated the new codec into Flix Pro, I asked if the company would supply sample encodes to my parameters using its existing inhouse tools. It did, and I''m showing those results in the comparisons you''ll see below. However, I'm not scoring the results because I didn''t have the final codec in hand.

Table 1. SD video quality by codec

Table 1. SD video quality by codec
Click here for a larger image

SD Tests


I produced all SD test files at 640x480 at 30fps, with a data rate of 468kbps for video and 32kbps for audio. I produced using two-pass variable-bit-rate encoding (VBR) at the highest supported profile for H.264. I used encoding VC-1 parameters provided by Microsoft''s encoding wiz Ben Waggoner. With Flix Pro, I set all quality settings for VP6 at the highest supported levels.

To assess quality, I looked at three factors. To test still-image quality, I captured frames from each compressed file and compared them side by side. To test motion quality, I played the files back in realtime and looked for artifacts such as mosquitoes, banding, jitter, and other artifacts that appear only during realtime playback. Finally, to test smoothness, I loaded each compressed file into Inlet Technology's Semaphore tool to detect whether the encoder had dropped any frames to meet the target data rate.

Figure 1. All codecs look the same in this easy-to-compress, low-motion shot.

Figure 1. All codecs look the same in this easy-to-compress, low-motion shot.
Click here for a larger image

In each test, I ranked the codecs. Lower scores are better, as summarized in Table 1. As you can see, H.264 was first, followed by VP6-E, and with VC-1 last.

Let''s start with still quality because that''s easiest to illustrate. As you would expect, all codecs performed well with easy-to-compress, low-motion footage, and they pretty much look the same in Figure 1.

Figure 2. In this high-motion sequence, VC-1 is starting to lose detail--and more importantly, it's dropping frames.

Figure 2. In this high-motion sequence, VC-1 is starting to lose detail—and more importantly, it's dropping frames.
Click here for a larger image

As motion and detail in the video increases, compression becomes more challenging, and you start to see some differences between the technologies. For example, in Figure 2, VC-1 starts to look faded and shows less detail in the shirt and in the woman''s face. That said, at least with these SD clips, the quality differences were quite modest, and probably wouldn''t be noticed absent side-by-side comparisons.

Note that other encoders produced VC-1 files without dropped frames, and that it may have been possible to produce files with Expression Encoder 2 that didn''t drop frames—although this may have changed other results, such as still-image quality or motion quality. However, I used the encoding parameters supplied by Microsoft, and those are the results I''m reporting.

Figure 3. While the New VP6 codec didn''t noticeably improve still-image quality, motion artifacts were much less visible.

Figure 3. While the New VP6 codec didn''t noticeably improve still-image quality, motion artifacts were much less visible.
Click here for a larger image

Interestingly, I didn''t see much difference between the old VP6 and new VP6 in still image tests, and neither codec dropped frames. However, the new version of the codec was noticeably quieter than the existing VP6 during realtime playback.

To illustrate this, I doctored up Figure 3, reducing brightness in the midtones to illustrate that the background wall as encoded by the updated VP6 codec was smoother than the wall as encoded by the VP6-E codec that I officially tested, which showed some banding, a hint of blockiness, and some mottled colors. During realtime playback, this was the source of much of the distracting noise that lowered VP6-E''s score.

Table 2. HD video quality by codec

Table 2. HD video quality by codec
Click here for a larger image

HD Tests


I produced all HD test files at 1280x720 at 30fps, with a data rate of 800kbps for video and 128kbps for audio. These rates are insanely aggressive, but I started at 1500kbps and kept reducing the data rate until all the codecs started exhibiting some flaws. I produced using two-pass variable-bit-rate encoding (VBR) at the highest supported profile for H.264 and using VC-1 parameters again supplied by Microsoft''s Waggoner. With Flix Pro, I set all quality settings for VP6 at the highest supported levels. Table 2 shows the results.

Figure 4. VC-1 exhibits much lower quality than the other contenders in this easy-to-compress clip.

Figure 4. VC-1 exhibits much lower quality than the other contenders in this easy-to-compress clip.
Click here for a larger image

Still-image tests revealed a couple of surprises. First, as shown in Figure 4, VC-1 had trouble maintaining quality even with low-motion clips such as a talking head. Not only did VC-1 lose detail, the clip lost color saturation and shows artifacts not present in any other clip.

Second surprise: the clip compressed with the On2's newly updated VP6 codec showed substantially greater detail retention than the VP6-S clip that I officially tested, which looks slightly fuzzy. Both trends are even more evident in the much harder-to-compress Figure 5, where the VC-1 clip is noticeably more degraded as compared with the other three frames, and where the "New VP6" clip preserves more detail than the VP6-S clip. In all comparisons, H.264 exhibited the best still frame quality.

Figure 5. This high-motion test clip makes On2's new version of its VP6 codec look very promising (but does nothing to dispel concerns about Microsoft's VC-1).

Figure 5. This high-motion test clip makes On2's new version of its VP6 codec look very promising (but does nothing to dispel concerns about Microsoft's VC-1).
Click here for a larger image

H.264''s advantage over VP6 was reversed during realtime playback tests, where VP6 proved quieter than H.264. Surprisingly, given its stellar performance in SD tests, VC-1 was much noisier during realtime playback than either other codec, probably because of the still frame artifacts seen in Figures 4 and 5. None of the codecs dropped frames in these tests, so smoothness scores were equal.

Overall, as you can see in Table 2, VP6 and H.264 tied for HD quality, with VC-1 last. Note that these results are consistent with past comparisons, where WMV/VC-1 has ranked last in all three tests that I''ve performed since 2005. Again, this doesn''t mean that you can''t produce high-quality HD files with VC-1. Rather, it means that you''ll probably need to encode at a 10-percent to 20-percent higher data rate to produce the same quality as H.264.

Keeping all this in mind, few producers choose a codec solely based on quality. That said, it''s obviously always an important consideration and I hope you find this information useful.