Video for Linux 2 Isis software documentation

Video for Linux 2

Video for Linux 2 (V4L2) is a library for doing video capture on the Linux operating system. Isis provides a simplified interface to V4L2 for doing video capture. More documentation will be added later. Below is a summary of the available functions.

Also be sure to look at the Isis video capture library which is the best choice for common needs. This simpler higher-level library uses Video for Linux 2 for is low level operations.

(vcap-open port) # initialize video capture on specified isis port # which should be open for reading and writing (open-update device), # returns vc (capture handle) to use in later functions (vcap-close vc) # close specified capture handle (vcap-input vc inputnum) # change input (integer numbered from 0) # returns actual input granted (vcap-format vc framesize pixelformat fieldmode) # change capture format # framesize should be [ width height ] # pixelformat should be one of: # vcap-rgb32, vcap-bgr32, vcap-rgb24, # vcap-bgr24, vcap-grey, vcap-yuyv, vcap-uyvy # fieldmode should be one of: # vcap-field-interlaced, vcap-field-top, # vcap-field-bottom, vcap-field-both, vcap-field-any # returns actual format granted: # [ framesize pixelformat fieldmode ] (vcap-period vc) # returns current frame period in seconds (vcap-standards vc input) # returns a list of standards supported by the specified input (vcap-standard vc standard) # change video standard # standard should be a string, such as "ntsc", "pal" or "secam" # call vcap-standards for a list of supported standards # returns True if successful (vcap-start vc) # start capturing # returns list of buffer addresses that will be used (vcap-read vc) # requeue the previously read buffer (if not done already by vcap-queue) # and read a new frame # returns [ bufnum bufaddr bytesused topfield-flag secs microsecs ] # bufnum is the index of the buffer being returned # bufaddr is the raw memory address of the data # bytesused is the number of bytes filled in the buffer # topfield-flag is True if the frame is the top field # secs & microsecs is the Unix timestamp of the frame # (similar to what is returned by (get-time) in Isis) # the returned buffer is valid for processing # until the next vcap-queue or vcap-read call (vcap-image vc framesize pixelformat bufaddr) # returns an Isis image buffer that refers to the memory in a # video capture buffer at the address specified by bufaddr, # in the format specified by framesize and pixelformat, # which should be the same as returned by vcap-format (vcap-queue vc) # place the previously read buffer back in the read queue # calling this function is optional, for extra efficiency # vcap-read performs the same action (vcap-stop vc) # stop capturing (vcap-find-control vc control-name) # find information about a control on the specified capture device # control-name should be a string, such as "Brightness" or "Contrast" # if successful, returns a list of 5 integers # [ control-id minimum-val maximum-val step-val default-val ] # or Null if the control could not be found (vcap-control vc control-id) # gets the value of a control # control-id is an integer that was determined from vcap-find-control # returns the integer value of the control (vcap-control vc control-id value) # sets the value of a control # control-id is an integer that was determined from vcap-find-control # value is the integer value you wish to set the control to # returns the value the control was actually set to (vcap-tuner vc input) # gets information about the tuner for the specified input # more documentation to come (vcap-freq vc input) # gets the current frequency set on the specified tuner # returns an integer expressing the frequency in units of 62.5 KHz (vcap-tune vc input frequency) # sets the frequency on the specified tuner # frequency should be an integer in units of 62.5 KHz # returns the actual frequency tuned


Requirements:
Scripts: (load "v4l2-utilities.isis")
Other: Needs Video for Linux 2 library