Technical Introduction to Timecode

Copyright © 1996-03-17a
Charles Poynton

This note outlines timecode, as used in video, film, audio recording, editing, and sequencing equipment. For further information, see Chapter 21, Timecode, in my book A Technical Introduction to Digital Video.

Introduction

Timecode systems assign a number to each frame of video analogously to the way that film is manufactured with edge numbers to allow each frame to be uniquely identified. Time data is coded in binary coded decimal (BCD) digits in the form HH:MM:SS:FF, in the range 00:00:00:00 to 23:59:59:29 for 30 Hz frame rate systems. There are timecode variants for systems having 24, 25, 29.97, and 30 frames per second.

In addition to the 32 bits required for eight-digit time data, timecode systems accommodate an additional 32 user bits per frame. User bits may convey one of several types of information: a second timecode stream, such as a timecode from an original recording; a stream of ASCII/ISO characters; motion picture production data, as specified in SMPTE RP 135; auxiliary BCD numerical information, such as tape reel number; or nonstandard information. A group of 4 user bits is referred to as a binary group. The information portion of timecode thus totals 64 bits per frame.

A number of synchronization bits are appended to the 64 information bits of timecode in order to convey timecode through a channel. Sixteen synchronization bits are appended to form 80-bit longitudinal timecode (LTC). Eighteen sync bits and 8 CRC bits are appended to form 90-bit vertical interval timecode (VITC) that can be inserted into a video signal.

The BCD coding of time data has two implications. First, since no BCD digit can contain all ones, the all-ones code is available for other purposes. Second, the high-order bits of certain timecode digits are available for use as flags. These flag bits are described later.

The color frame flag is asserted when the least significant bit of the timecode frame number is intentionally locked to the color frame sequence of the associated video, that is, locked to Frame A and Frame B of SMPTE 170M.

Dropframe timecode

In 25 Hz video, such as in 625/50 video systems, and in 24 Hz film, there is an exact integer number of frames in each second. In these systems, timecode has an exact correspondence with clock time. In 525/59.94 systems, there is not an integer number of frames per second. The remainder of this section deals with the dropframe mechanism that is used to compensate timecode to obtain a reasonable approximation of clock time. Dropframes are not required or permitted when operating at 24, 25, or 30 frames per second.

During the transition from monochrome to color television, certain interference constraints needed to be satisfied among the horizontal, sound, and color frequencies. These constraints were resolved by reducing the 60.00 Hz field rate of monochrome television by a factor of exactly 1000/1001 to create the color NTSC field rate of about 59.94 Hz. This led to the dropframe timecode that is familiar to anyone that has been involved in videotape editing.

Counting frames at the NTSC frame rate of 29.97 Hz is slower than real time by the factor 1000/1001, which, if left uncorrected, would result in an apparent cumulative error of about +3.6 seconds in an hour. To avoid this error, timecode systems are designed so that on average once every 1000 frames a frame number is dropped, that is, omitted from the counting sequence. Of course, it is only the timecode number that is dropped, not the whole frame!

Frame numbers must be dropped in pairs in order to maintain the relationship of timecode (even or odd frame number) to video color frame (A or B).

Dropping a pair of frames every 66 2/3 seconds - that is, at an interval of one minute, six seconds, and twenty frames - produces the sequence in the table to the left. Although this sequence is not easily recognizable, it repeats after exactly ten minutes! This is a consequence of the ratios of the numbers: Two frames in 2000 accumulates 18 frames in 18 000, and there are 18 000 frames in 10 minutes (30 frames, times 60 seconds, times 10 minutes). To produce an easy-to-compute, easy-to-remember sequence of dropframe numbers, the key rule of dropframe timecode was devised:

Drop frame numbers 00:00 and 00:01 at the
start of every minute except the tenth.

In effect, a dropped pair that is due is delayed until the beginning of the next minute.

Longitudinal timecode, LTC

Timecode is recorded on studio videotape and audiotape recorders as a longitudinal track with characteristics similar or identical to those of an audio track. LTC is interfaced in the studio as an audio signal pair using three-pin XLR connectors.

Each frame time is divided into 80 bit cells; therefore the bit rate of timecode data is nominally 2.4 kb/s. LTC is recorded using the binary FM technique, also known as Manchester code: Each bit cell has a transition at its start, a one bit has a transition in the middle of the cell and a zero bit does not. This coding is immune to the polarity reversals that sometimes occur in audio distribution equipment.

LTC is transmitted bit-serially, in four-bit nibbles; first a timecode nibble, then a user nibble, least significant bit first. This 64-bit stream is followed by a 16-bit sync word pattern that comprises the sequence 0, 0, twelve ones, 0, and 1. The sync pattern is distinguished from any data pattern, since the combination of BCD timecode digit coding and time/user digit interleaving inherently excludes any run of nine or more successive 1 bits. The sync pattern also identifies whether timecode is being read in the forward or reverse direction so that timecode can be recovered whether the tape is moving forward or backward.

At normal play speed, LTC can be decoded from tape as long as the playback system (heads, preamps) has an audio bandwidth out to about 2.4 kHz. To recover timecode at the shuttle rates of a high-quality studio VTR - about 60 times play speed - requires an audio bandwidth about 60 times higher. Due to the limitations of stationary head magnetic recording, longitudinal timecode from a VTR (or ATR) cannot be read at very slow speeds or with the tape stopped.

Vertical interval timecode, VITC

Vertical Interval timecode overcomes the disadvantage that LTC cannot be read with videotape stopped or moving slowly. With VITC, one or two video scan lines in the vertical interval of the video signal contain timecode data. VITC in 525/59.94 should be conveyed on line 14 (277). For videotape recording it is advisable to record VITC redundantly on two nonconsecutive lines, in case one line suffers a tape dropout. Lines 16 and 18 (279 and 281) are preferred. VITC identifies each field of video; a field mark bit is asserted for the even field (field 2).

Each VITC line conveys 90 bits as 9 serialized bytes, each preceded by a 2-bit sync code (one, zero). The first 8 bytes contain the timecode information bits in LTC order.

The ninth byte contains a cyclic redundancy check (CRC) code that may be used for error detection (and possibly correction). CRC is computed as G(x) = x8 + 1 across the 64 information bits and the 18 VITC sync bits. The CRC can be generated by an 8-bit shift register and an exclusive-or (XOR) gate. A CRC can be independently computed by the receiver from the information and sync bits; if the computed CRC does not match the transmitted CRC, then an error is known to have occurred.

The bit rate of VITC for 525/59.94 systems is one-half of the NTSC color subcarrier frequency, that is, one-half of 315/88 MHz. A zero bit is at blanking level (0 IRE), and a one bit is at 80 IRE. The 0-to-1 transition of the first (start) bit is delayed 10.5 µs from the 50-percent point of the line sync datum (0H). A decoder must use the sync bit transition at the start of the line to establish a decoder phase reference; it may or may not use the other sync transitions.

Editing

Timecode is fundamental to videotape editing. An edit is denoted by its in point (the timecode of the first frame to be recorded) and its out point (the timecode of the first frame beyond the recording). An edited tape can be described by the list of edits used to produce it. Each entry in such an edit decision list (EDL) contains the in and out points of the edited tape, and the in and out points of the source tape, along with tape reel number and/or other source and transition identification.

An edited tape is invariably recorded with continuous "nonbroken" timecode. Nearly all editing equipment treats the boundary between 23:59:59:29 and 00:00:00:00 as a timecode discontinuity; consequently, it is conventional to start the main program segment on tape with the code 01:00:00:00. If the tape includes the usual 1.5 minutes of bars and tone leader, then the tape will start near timecode 00:58:30:00.

Timecode bit assignment table


This note is excerpted from Chapter 21, Timecode, of my book A Technical Introduction to Digital Video, copyright John Wiley & Sons, 1996. I encourage you to read this note online, but please do not reproduce it: reproduction of this note is prohibited according to the terms of my agreement with the publisher.

See also the Timecode document, part of the Lurker's Guide by Chris Pirazzi.

Charles - Video engineering
1997-07-13a