From LinuxTVWiki
Jump to navigation Jump to search

VIDEO_PALETTE_RAW is a special V4L image format supported only by the bttv driver.

In PAL mode capturing starts at line 23, offset 0H 186 * 2 / 35468950 s. It continues across active picture, horizontal blanking and sync for 640 K samples (roughly 288.7 scan lines). Otherwise the format is identical to raw VBI, i.e. it consists of only luminance samples of 8 bits each.

In NTSC-M mode capturing starts at line 23, offset 0H 128 * 2 / 28636363 s and continues until the first serration pulse of the next field (some 443 K samples or 243.3 scan lines).

Note line and offset are available through V4L2 ioctl VIDIOC_CROPCAP as / 2 and defrect.left.

The driver always captures both fields. F1 is stored in the buffer at offset 0, F2 at buffer size / 2. The default buffer size with V4L ioctl VIDIOCMCAPTURE and V4L2 ioctl VIDIOC_REQBUFS is 0x208000 bytes, determined by the gbufsize module parameter. VIDIOC_G_FMT (after VIDIOCSPICT, since VIDIOC_S_FMT does not support VIDEO_PALETTE_RAW) reports the image size as gbufsize rounded down to a multiple of 1024. read()s can request smaller images but will fail with EINVAL if the size is < 1280 KiB.