About Video

This page is a paean to the global implementation of digital television where all nations can sit down and watch field-less tv together in peace.

It also explains the use of the Global parameter fieldRendering to generate interlaced images for broadcast, and the deInterlacing parameter for importing interlaced video images.

You should also read the About Aspect Ratio page when dealing with video.

For a note on keying DV footage, jump to Overview - Keying - Tip #1.

The example images are located in doc/pix/video.


What Are Video Fields

Dividing frames into fields is a technique used in televsion broadcasting to reduce the perceived strobing of images by refreshing the display on subframes. By using fields, the viewer is exposed to twice as many frames. Here is an example of an emotionally touching animation obviously showing frames 1 and 3. These are considered to be full frames (one speaks of rendering frames or fields when discussing video) – the entire image is shown in the same moment of time.



The following shows the clip up to (but not including) frame 3 conveted to fields. The following image on the left shows some information from frame 1, field 1 and from frame 1, field 2 (unconventionally labeled here as frame 1.5), and the following image on the right shows frame 2, field 1 and frame 2, field 2 (unconventionally labeled frame 2.5 for illustration purposes):



The visual information at a given time is limited to every other line, for example all even lines. When you advance a half frame of time further, the visual information appears on the other lines, in this case the odd lines. These are called fields.

The following images show you field 1 (frame at time 1) and field 2 (frame at time 1.5) of frame 1. Notice the black lines across the images. When the two fields are put together, as in frame 1 above, the images is interlaced, because the fields are interlaced together.



Here is a close-up of the interlaced image:

 

Therefore, the interlace process produces two fields of half-height for every broadcast frame. When a television displays these images, it quickly shows the first field only, and then the second field only, and then proceeds to the next frame. This solution is interesting because each field sacrifices vertical resolution quality for the benefit of temporal quality.



Common Problems with Interlaced Images

The interlace approach of a spatial solution to temporal issues creates two particular types of problems for digital image manipulation.

The first problem occurs when you have any animated parameter. The animation must be understood and applied at half frame intervals. If you read in an interlaced clip and apply a static Gamma, no problems occur because both fields receive the same correction. If, however, you animate the gamma correction, you must turn on field rendering in order to evaluate the correct set of lines at the appropriate interpolated value. See the above examples to illustrate the need to break up color animation into half-frame fields. Field rendering is discussed later on in the cleverly named Section 3, Field Rendering.

The second and trickier problem is with any node that has spatial effects, like a Blur or a Move2D. If you pan an image up by 1 pixel in Y, you have effectively reversed time, because the even lines are moved to the odd field, and the odd lines are moved to the even field. The clip would have extremely jerky movement, since every two fields are reversed. This would be the same as if you inverted filmic frames 1, 2, 3, 4, 5, 6 to 2, 1, 4, 3, 6, 5.

Another example of spatial problems arises in image rotation and scaling. The following images show a rotation without field rendering and with field rendering. Only the image on the right appears correct when broadcast.

No field rendering Field render


You need to be aware of field rendering with more than just transforms. Below is a close-up of frame 1 (from above), without and with a blur applied to it. Since the blur is applied uniformly to both fields, the result is what we is called in the business "Real Bad."

Original Image Blurred without field rendering


To illustrate this, one field is removed from the image below on the left. Notice that information from both fields intermingles due to the blur, as pixels from a different moment in time bleed into the current field. Turning on field rendering gives you the correct image, shown on the right. No image information bleeds between the two fields due to the blur.

One field of improperly blurred image Properly blurred image with field rendering




Field Rendering

To correct the problems discussed above, turn on field rendering in the render controls of the Globals. There are three field rendering settings:

0 = Off
1 = Field rendering with odd field (counting from the top) first. This is generally the setting for PAL images.
2 = Field rendering with even field first. This is generally the setting for NTSC images.

With field rendering turned on, Shake separates the rendering into two separate fields. All animation and spatial effects are allocated to the proper field.

You do not have to use field rendering when you import interlaced images and apply static color corrections. For all other functions, or if you animate any value, turn on field rendering. The field rendering handles all transformations, filters, and warps by internally taking each field, removing the intermediate black lines, and then resizing the Y resolution back up to full frame. The software does this for each field, and then interlaces them back together again. In the following example, the image is resized from 640x480 to 720x486. The left image, which has inter-field bleeding, is without field rendering, the right image, which is clean, is with field rendering:

Resize without field rendering Resize with field rendering

 

Viewer zooming is another problem with field rendering. Unless you are at a 1:1 ratio for the Viewer (hit Home to make sure), you likely have artifacts. For example, if you zoom the image down by half in the Viewer, you remove half of the information – an entire field. Therefore, if you see any artifacts in a field-rendered image, press Home in the Viewer to see if that is the problem.

 

Viewer artifact



JPEGs and Fields. Using the JPEG output for field rendering is not recommended. The compression bleeds information from one field into the other, which just sucks.

 



Importing Interlaced Images

In addition to the fieldRendering parameter, you need to be aware of FileIn's deInterlacing parameter when importing interlaced images. Turn this on when you import an interlaced image, either to odd (usually PAL) or even (usually NTSC). When enabled, it strips out the two fields from each other, placing field 1 at frame 1, and field 2 at frame 1.5. Each field is then copied and moved into the empty spatial place of the removed field. This ensures that all spatial effects are properly handled by the field rendering. This strategy is interesting because it doubles the amount of frames you have, but keeps the frames within the same duration. Go figure. You must turn on the Global field rendering to return the image to its interlaced status.

field 1 field 2
De-interlaced field 1 De-interlaced field 2


To see each field, turn off fieldRendering and use an increment of .5 in the Time Bar, then step through the animation with the left and right arrow keys. Use this technique if you aren't sure which field is dominant. If you step through the animation and the image seems to stutter every other field, switch your deInterlacing to even, and the motion should be continuous.



Other Video Functions

Shake has several other video-oriented functions. Keep in mind that these operate with the assumption that field rendering is off, since they would be affected by the field rendering options like other functions. These functions include:

Tab Function
Notes
Globals dropFrame Toggles 30 to 29.97 frames per second when enabled.
Time Bar T on keyboard Toggles timecode/frame display.
Image FileIn Has de-interlacing, as well as pulldown/pullup capabilities under the Timing subtab.
Color VideoSafe This limits your colors to video-legal ranges.
Layer Constraint Limits effects by certain criteria, either zone, change tolerance, channel, or field. Naturally, field is of interest here. You can affect a single field with this node. Generally done with field rendering off.
  Interlace Interlaces two images, pulling one field from one image, and the second field from the other image. You can select field dominance. Generally done with field rendering off.
Other DeInterlace Retains one field from an image and creates the other field from it. You have three choices on how this is done. The height of the image remains the same. Generally done with field rendering off.
  Field Strips out one field, turning the image into a half-height image. Generally done with field rendering off.

  Swapfields Switches the even and odd fields of an image when fieldRendering is off. To do this when fieldRendering is on, just switch from odd to even or even to odd. Generally done with field rendering off.