Web Video

Web Video
Web Video

Many web videophiles complain that the colors in their videos look "off" when viewed on line. Is it merely their imagination or is there anything to these complaints?

Yes, the colors likely ARE off, but does the problem lie with the encoding software? The decoding software? Is YouTube, Vimeo or whatever video hosting service resampling your video and playing shenanigans with the color behind your back?

Many hours of research and testing have provided some answers, but first some background on web video.

There are two standards for digital color video. They are ITU rec bt.601 and ITU rec bt.709. bt.601 was never intended for use with computer video. It was introduced in 1982, just one year after the introduction of the IBM PC in 1981. bt.601 was designed to encode analog video to the digital domain. Today, bt.709 is the standard for high-definition broadcast video. Each standard has its own set of coefficients for converting between RGB and component video, known as YCrCb (sometimes known as YUV).

There is ONE standard for computer video: sRGB, which was developed jointly by Microsoft and Hewlett Packard and was standardized by the IEC in 1999. sRGB uses the bt.709 coefficients for conversion between RGB and YCbCr. sRGB does not specify vertical or horizontal pixel counts, so it can be used at any video resolution.

The first place to look for color errors is your browser. For reasons which remain a mystery, most web browsers do not default to the bt.709 color space called for in the sRGB specification. They are not standards-compliant. That situation did not change when browsers switched from software decoding to hardware-accelerated decoding, and it did not change with the introduction of HTML5.

In my research and testing I have found that the following broswers still default to bt.601 coefficients:

Mozilla Firefox and SeaMonkey

Chrome and Chromium

Opera

The two Microsoft browsers get it right and default to bt.709:

Microsoft Edge and Internet Explorer

You can see this for yourself by examining this test pattern. You will need an eyedropper-style program which reports the color of the pixel it is over.

Test Pattern

The numbers below the color patches give the RGB value each color is supposed to be.

Due to rounding error, video which is properly encoded with bt.709 colors in compliance with the sRGB spec, will have colors accurate to +/- 2 digital values. Color-conversion algorithms use floating-point coefficients, thus there is no way around rounding error. For example, suppose we have a calculation such as n = 5 / 2. We know this equals 2.5, but video hardware needs integers. It can't handle fractional numbers such as 2.5. We must then choose between 2 or 3. This is how rounding error creeps in.


© Copyright Chris Clementson

No comments:

Post a Comment