Wednesday, April 8, 2009

Audio Quality

Some studies have pointed out that the human brain puts together both audio and images as a single message and therefore audio has a tremendous impact on viewer experience. Some research has even pointed out that viewers are less likely to completely view a video clip if the audio quality is poor.

Below is a list of audio encoding artifacts to check for as well as some tips.
  • Lip-sync. Most people find "out-of-sync" audio as unacceptable.
  • Audio drop outs and pre- echo are perceived as “very annoying” artifacts by most people. They tend to be more prevalent in material that is percussive like a gunshot or a drum hit. Increase the bit rate as much as possible to compensate.
  • Narrow audio program bandwidth. If high audio frequencies have been removed, the audio will sound “nasal” or “muddy”. If Low audio frequencies have been removed, the audio will sound “thin” and “harsh”. Make sure the resulting audio covers as much frequency spectrum as the original. Keep the audio sampling rate the same as the source or above 44.1 KHz for best results.
  • “Garbled” audio due to over compression tends to have sort of an underwater sound. These artifacts will be more noticeable in material that has random characteristics like rain, applause or city traffic. Give enough bits to the audio stream. Try to keep audio bitrates above 96 kbs for best results.
  • Summing some stereo material to mono will cause phasing artifacts and audio dropouts. Experiment by taking only the left or only the right channel if you hear this artifact. You might get better results.
  • Audio re-sampling or clock errors often have a metallic / ringing sound and can produce loud ticks. If you are encoding video from tape or other hardware playback device, make sure the audio is properly clocked and sync-locked. When using AES/EBU or SPDIF audio, clock your input device to the source’s digital signal as a rule of thumb.
  • Make sure the audio is noise (hiss) free. Be careful of not going overboard if you have to pre-process the audio with noise suppression as you might induce more serious artifacts. Also, make sure that your audio has the required bit resolution. Today, 16 bit audio is common place. Avoid a lower value.

Thursday, April 2, 2009

De-interlacing algorithms

De-interlacing algorithms can be sub divided into two broad categories:

  1. Spatial Based
  2. Motion Based

Some popular spatial based algorithms are:

  • Simply weaving the odd field and doubling each line. (Produces aliasing)
  • Averaging or blending both fields. (Produces ghosting)
  • Edge dependent interpolation techniques between adjacent lines in odd-even fields. (Few artifacts if edge direction is inaccurate)

Some motion based algorithms are:

  • Selective blending (or motion adaptive blending) basically only blend areas where there is motion and weaving where there is none. (Few artifacts if motion calculation is correct)
  • Motion and edge adaptive algorithms combine edge interpolation techniques and motion adaptive blending. (Fewer artifacts at computational expense)
  • Motion compensated algorithms can use the information to find the matching blocks in the neighboring fields. (Fewer artifacts at computational expense)

Be sure to check what algorithms your encoding software implements, it might have a great impact in your final video quality.

Thursday, March 26, 2009

De-interlacing

To compensate for CRT artifacts, an image frame has been traditionally broken up into two fields that contain even and odd scan lines. Each field thus contains half of the vertical resolution of a frame. Most standard definition video cameras record in this field manner (in NTSC they record 59.94 fields per second) which looks great in a CRT display.

To reproduce the image in its original resolution on a “progressive” type display –LCD, Plasma, etc.- both fields can be combined. However, because each field is recorded at slightly different time (1/59.94 = 16.68 ms) some artifacts may show up in the resulting picture. These artifacts, particularly visible in scenes where there is fast motion, appear as a kind of line crawling over the picture.

Most video original material is interlaced, but some original film material that has been converted to video (Telecine) might also be interlaced. For that reason, when transcoding video for playback in computer systems or on “progressive” type displays, always check if the video source is interlaced and if so, apply de-interlacing. If the source is a Telecine of a film, use an inverse telecine setting.
The link below gives some great examples of interlacing. Check it out.

Monday, March 16, 2009

VirtualDub

VirtualDub is one of many very useful open source programs that allows you to quickly convert and process video.


VirtualDub provides you with a framework for basic video editing, compression and filtering. It comes with a few plug-ins for encoding, frame rate conversion and image processing, but there are many third party plug-ins in the open source community that can be added very easily.


http://www.thedeemon.com/VirtualDubFilters/

With this powerful application you can stitch videos together, change audio or add overlays very quickly. This is one tool that video compression professionals must have in their arsenal. You can get it here:


http://www.virtualdub.org/

More technical video professionals can create or adapt their own plug-ins for VirtualDub using its open source filter SDK.


http://www.virtualdub.org/filtersdk.html

As with any open source solution, the main issue is support. However, with VirtualDub there is a very large community of developers and users that you can tap to find answers.

Monday, March 2, 2009

Video stream analyzers

I looked around for video stream analyzers and got a couple of trial versions to test. Here is a brief description:

Elecard StreamEye

An intuitive interface that lets you navigate and display the stream picture by picture while it determines the real bit rate and compares it to the header values. It will tell you the streams real peak bit rate and how it varies as well as frame data sizes. It gives you access to macroblock information and its file address as it is displayed on the corresponding image.

http://www.elecard.com/products/products-pc/professional/streameye-studio/

MTS4EA Tektronix Compressed video elementary stream analyzer.

A much more powerful tool that can help codec developers debug and optimize codec code. The learning curb is steep around their user interface as it offers lots of features .
It verifies stream compliance against standard. It gives you the ability to perform a differentiating analysis against a reference video. (.yuv file) and calculates PSNR, RMSE, MSE and other measurements. It gives you macroblock statistics. The video view selection may show you the hex code for a macroblock or a macroblock set. It includes a bit stream editor for debugging applications and a batch mode with logging capability. Their image inspector lets you view pixel data for individual macroblocks and separates them into their component channels for YUV or RGB images. They have a macroblock type overlay that lets you see, in color, if a macroblock is an intra 4x4 or inter type block. It also overlays the motion vectors as color coded arrows for B or P frames. It is capable of producing a bit usage histogram and give you buffer analysis.

http://www.tek.com/Measurement/applications/video/mpeg_derivatives.html?WT.srch=1&WT.mc_id=ppc,ggl,vid_aw_us_us_ngt,k3AF2,s,1520098873&

Interra Vega-Media analyzers

I wasn’t able to get a trial version of this product so I can only paraphrase what they have on their website.
It supports H264, VC1, MPEG2, Audio and compares with other encoded streams. It has a YUV Dif utility to evaluate quality against an original video. It provides with syntax analysis tools and frame statistics for analysis of interpolation and prediction.

http://www.interrasystems.com/dms/dms_vega.php

Monday, February 23, 2009

HPA Retreate Notes

There was an interesting session at the HPA (Hollywood Post Alliance) retreat last week where many studios as well as a representative of the EBU (European Broadcasting Union) talked about their real world experiences with video encoding and distribution.
Here are my notes.

The EBU has published their recommendations for HDTV video compression for acquisition, production and distribution in this document: http://tech.ebu.ch/docs/r/r124.pdf
The full report is only available to EBU members, but we can take note that:
  1. Progressive pictures look better than interlaced.
  2. Acquisition is recommended at 4:2:2 where 8bit is sufficient.
  3. To manintain quality after 7 cycles of encoding, Long GOP, CBR, MPEG-2 at 50Mbit/sec at the least is recommended (post and production).
  4. Distribution using H.264/AVC, CBR encoding requires 50% less bit rate than MPEG-2.
  5. Interlaced video requires 20% more bit rate than progressive video for the same quality.
  6. The dominant image quality impairments are determined by the distribution codec.


In that panel, there were engineers form three mayor broadcast studios who revealed their own conclusions:

MPEG-4 @ 20Mbits/sec, MPEG-4 @25Mbits/sec and MPEG-2 @45Mbits/sec are used in their facilities to maintain reasonably constant quality.

Monday, February 16, 2009

Automated Transcoding and Publishing

The panacea of original video publishing automation would be to go from final edited version to the asset management system to the web and other distribution channels. And along the way collect all relevant metadata, generate thumbnails and create videos that suit players that can capture relevant advertising based on the content.

A few companies have made great efforts to automate this kind of work flow, but one that stood out for me recently is Entriq’s Dayport solution: http://www.entriq.com/.

Their solution allows content creators to integrate their workflow with FinalCut (and carry relevant metadata to the content management system), live capture off air or tape (which can be scheduled to trigger automatically), thumbnail generation, create rules for security and usage policy, DRM, syndication and CDN integration for delivery. Companies that syndicate content to multiple partners can automate the process and save lots of time re-formatting metadata, transcoding, etc.

Entriq provides a UGC platform that incorporates an approval process along with download controls and players that make the automation of video workflows from creation to publishing possible.