The challenge of legalizing file-based video
Jul 1, 2007 12:00 PM, BY THOMAS DOVE
To most people, video legalization means ensuring that the levels in a baseband digital video signal are legal — that is, they are within the legal range. For SD video, the analog waveform is represented by 8-bit digital values in the range 0 to 255, either in RGB or YUV/YPrPb color spaces. Depending on the color space, some of these values and combinations of values are outside the range of full black to full white; they are sync signals or over-white, or simply cannot be converted from one color space to another.
As an example, for SD video conforming to BT-601, the value of the Y component of the YUV signal should be within the range of 16 to 235. This is because the values of 0 to 15 are below black or within the range of sync values. Likewise, there are upper limits as well as limits on the U and V components, both in their own values and in combination — the combination values being relevant when conversion to the RGB color space occurs (where specific YUV values can generate values outside the legal RGB color space). Video legalization or auto-correction is where these signal levels are monitored, and if they lie outside the valid/legal ranges, then the values are clipped to ensure they are within the ranges required.
Legalization alters the data values — generally losing detail — and affects the video signal in a way that the content provider did not intend. This aside, there are many reasons why video legalization won't work for file-based video.
In effect, legalizing afterward is a bit like papering over cracks.
Types of errors
File-based video is by definition digital files that store the video and audio. In the majority of cases, the video is compressed in some way (usually the audio is compressed as well), and there is transport stream data (or a transport layer/mechanism) and metadata. There is a large increase in abstraction from the baseband signals, as the video/audio data is compressed and metadata is added — and video legalization occurs only at the lowest level. (See Figure 1.)
Figure 1. Video abstraction levels
Therefore, there are many problems that video/audio legalization does not address. In fact, as file-based video is relatively new compared with the well-understood old analog video signal levels, the vast majority of problems are completely unrelated to video legalization. Therefore, it is vital that any test/checking system can detect these.
Problems that occur in file-based video include:
- Transport stream errors, such as incorrect PIDs, PATs, PMTs and PCRs.
- Multiplexing errors, for example, where the video and audio have been truncated when extracted from a multiple program transport stream.
- Missing required data, for example, when closed captioning or teletext are not present.
- Metadata errors, such as missing copyright information or other data used by an automation system.
- Simple factors, such as incorrect play time. Other examples include when the audio has been put on channels 3 and 4 instead of 1 and 2 (or omitted altogether) or the wrong version of the content has been provided.
- Incorrect bit-rate for the video or audio.
- Incorrect stream set-up, such as when three seconds of audio silence is required at the start but is not present.
- Compliance to various industry de-facto standards, such as CableLabs 1.1 compliance.
- Encoding quality errors where the encoder produces a series of blocky video frames, for example, when there is lots of movement.
- MPEG encoding syntax errors, which can occur due to multiple mux/de-mux operations, or an encoder blip.
- Errors in the syntax of the video and audio elementary streams.
- The stream is correct and legal, but still not what the broadcaster needs. For example, it should be NTSC but is PAL, or it should be 4.5Mb/s peak but goes to a peak of 4.6Mb/s. Typically, a broadcaster will have many such constraints/requirements.
- Errors due to the way the data is split out and put onto a video server. Some servers separate video, audio and metadata, and if there are some errors in these elementary streams or other parts of the data, then this process of splitting up can generate errors. Baseband test systems cannot detect these types of errors, and video legalizers cannot to fix them.
In order to do the testing of the baseband as required for video legalization, the compressed video file must be fully decoded to baseband. If there is then a gamut/legality problem and the video is then legalized, it must also be recompressed to the same video standard (MPEG-2, MPEG-4/AVC, VC-1, etc.) and remultiplexed with the audio and metadata. (See Figure 2.)
However, all the encoding schemes use lossy compression, meaning that some of the quality is always lost. The original compressed file had some loss due to the first encoding, but the content provider would (likely) have done a careful and painstaking quality control to ensure that the picture quality was as required.
An automatic re-encoding as done by a legalizer would add enormously to the compression artifacts. It may well be that artifacts not visible on first encoding become visible on re-encoding after legalization. In addition, there would not be the careful quality control afterward, so the results of the legalization may be video with unacceptable artifacts.
Previous research has indicated a 5dB loss in visual quality from doing a second-generation re-encode.
blog comments powered by Disqus
| Want to use this article? Click here for options! |




















