Video Formats

Supported by ...

The following PixeLINK cameras support various video formats:

Description

Video Formats refer to a collection of settings for Region of Interest size and frame rate that are defined in the IIDC specification.  The various video formats are irrelevant to users of the PixeLINK API which operates entirely within Format 7 - variable ROI.  For users programming with IIDC controls, the following information is relevant.  

API Control

The PixeLINK API does not control video formats per se but rather operates the camera in Format 7 Mode 0.    See Image Data Formats for data formats available when using the API.

 

Note

Note that the PixeLINK API and drivers will only recognize cameras using Format 7 Mode 0 and will only set Format 7 Mode 0 regardless of the Pixel Addressing feature settings.  A FireWire camera with saved settings (see Memory Channel) with Pixel Addressing enabled (Value > 1) may not be recognized properly by 3rd party IIDC software.  If moving a FireWire camera between the PixeLINK API and 3rd party IIDC software, be sure to use the factory defaults or to save settings with no Pixel Addressing (Value = 1).

IIDC Control

See the IIDC Specification for information on controlling the video formats.

Pixel Addressing modes (decimation, binning, averaging or resampling) are only available with Format 7.  The Format 7 modes select the pixel addressing value.  To set the pixel addressing mode, see the advanced status  and control register of the Pixel Addressing feature.

PixeLINK cameras output video according to the IIDC specification with a padding region attached to the end of the frame.  The padding region is used to hold a descriptor structure containing information about that particular frame.  The image data is structured as:

Byte 0

Byte 1

Byte 2

Byte N-2

Byte N-1

Frame Descriptor (See Descriptor Structure Format)

where

N = Number of bytes per frame (width * height * bytes per pixel). The shaded color    represents the IIDC 1.31 frame padding region

If multiple descriptors are being used then a synchronization code will be encoded in the first sixteen bytes of the frame.  This code is to ensure that the driver knows which frame it is receiving from the camera (in case the frame size changes between descriptors).  The code is encoded as:

 

Byte 0

Bits 7 … 0

Byte 1

Bits 7 … 1

Code Bit 7

Byte 2

Bits 7 … 0

Byte 3

Bits 7 … 1

Code Bit 6

Byte 4

Bits 7 … 0

Byte 5

Bits 7 … 1

Code Bit 5

Byte 6

Bits 7 … 0

Byte 7

Bits 7 … 1

Code Bit 4

Byte 8

Bits 7 … 0

Byte 9

Bits 7 … 1

Code Bit 3

Byte 10

Bits 7 … 0

Byte 11

Bits 7 … 1

Code Bit 2

Byte 12

Bits 7 … 0

Byte 13

Bits 7 … 1

Code Bit 1

Byte 14

Bits 7 … 0

Byte 15

Bits 7 … 1

Code Bit 0

 

where Code is a 8 bit number (Bit 7 = MSB).  The Code is zero for the first frame of a video stream, and will increment by one each frame after that, rolling over once it reaches the number of descriptors currently in use (i.e. if three descriptors are in use then the Code will roll over once it reaches 2).

Byte Order

For 8-bit data, the byte order is straight forward with byte 0 being the top left pixel in the image, byte 1 being the second pixel in the top row and so on.

The FireWire bus uses big-endian notation, that means that the most significant byte comes first and the most significant bit is bit 0. The PC uses little endian notation, where the least significant byte comes first.  Hence, on a PC system, when receiving 16-bit data from the camera, the bytes will be swapped.

The following C code example swaps the bytes and strips the trailing zeros to leave a 10-bit pixel value in the range of 0 to 1023.

 

// Swap bytes and shift right to get a value in the range [0,1023]

inline U16 SwapAndShiftU16(U16 val)

{

      return ((val & 0xFF) << 2) | ((val & 0xFF00) >> 14);

}

 

When interpreting image data from the camera, the Video Format or Color Coding is used to determine the meaning and order of the data.  In addition, for Raw data formats, the Color Filter ID can be used to determine the order of the color channels in the image. This is relevant for cameras that can flip or rotate the image data.  See the IIDC Specification - offset 058h from the Video Mode CSR for Format 7.

For the 780 series cameras which do not support flip or rotate, the color data will always be output with Filter ID = 2 (GR/BG) format.

For the 770 series cameras which do not support flip or rotate, the color data will always be output with Filter ID = 2 (GR/BG) format.

For the 740 series cameras which do not support flip or rotate, the color data will always be output with Filter ID = 1 (GB/RG) format.