The camerav4l2 driver captures images from V4l2-compatible cameras. It uses MMAP capture method.
- Compile-time dependencies
- Provides
- Requires
- Configuration requests
Requests are passed in text format (ctype strings: char *, ended whith ''). Parameters are passed in form readible by scanf("%f") or scanf("d). There could be only one space between command name and parameters. This interface is not intend to be used by application. This should be wrapped by proper ClientProxy subclass.
Below are examples of all requests:
- 's 640 480' change size of video capture, takes 2 integer arguments
- 'i 2' (or 'i USB') change input source, takes one String/Integer argument (look for config file expl)
- 'n pal' change video norm, takes one String argument (look for config file expl)
- 'm RGB24' change video mode, takes one String argument (look for config expl)
- 'f INTERLEACED' selects type of field interleaving, takes one String argument (look for config file expl)
- 'w 1' changes swap_rb setting, takes one Integer argument (look for config file expl)
- 'c 0.5 brightenes changes control value. Takes two arguments.first Double (new Value in range 0-1) and rest after one space is name of control. Order is reversed when compared to config file, to easily parse command
- 'ci 0.5 2 changes control value. Takes two arguments.first Double (new Value in range 0-1) and next is Integer and points to position in actual control list ( depends on device and source )
Requests, that returns some reply. Size of reply depends on size of passed strings (names of device or controls).
- 'g' - get device name; after g, there should be end of string: ''; (ex. "AverTV Studio 303 (M126)")
- 'gc' - get actual number of controls (reply is like result of printf("%d", num)
- 'gc name' - get value of given control
- 'gci ID' - get value of given control identified by id in range 0..max_id-1, where max_id is returned by 'gc' request. Value is in range 0.0 - 1.0, and is result of printf("%f", val) command. Value <0 mean error.
- 'gcn ID' - get given control name (ID is like in gci request).
- 'gf' - get field setting (example reply content: "ANY")
- 'gn' - get norm setting (ex. "PAL")
- 'gm' - get pixel format setting (ex. "RGB24")
- 'gi' - get source input name (ex. "S-Video"). This name can be used later with 'i' command
- Configuration file options
All Strings except dev_file are case insensitive. All options added in this module aren't mendatory and have default value.
- dev_file (string)
- Default: "/dev/video0"
- Device to read video data from.
- input (integer/string)
- Default: 0
- Some capture cards have multiple input sources; use this field to select which one is used. Can be name of source (list is printed on opening device).
- norm (string)
- Default: "pal"
- Capture format; "ntsc" or "pal"
- size (integer tuple)
- Default: varies with norm
- Desired image size. This may not be honoured if the driver does not support the requested size).
- mode (string)
- Default: "RGB24"
- Desired capture mode. Can be one of:
- "RGB24" - 24 RGB-8-8-8
- "RGB32" - 32 RGB-8-8-8-8
- "BGR24" - 24 BGR-8-8-8
- "BGR32" - 32 BGR-8-8-8-8
- "GREY" - 8 Greyscale
- "RGB565" - 16 RGB-5-6-5
- "SBGGR8" - see http://www.siliconimaging.com/RGB%20Bayer.htm
- "RGB332" - 8 RGB-3-3-2
- "RGB555" - 16 RGB-5-5-5
- "RGB555X" - 16 RGB-5-5-5 BE
- "RGB565X" - 16 RGB-5-6-5 BE
- "YVU410" - 9 YVU 4:1:0
- "YVU420" - 12 YVU 4:2:0
- "YUYV" - 16 YUV 4:2:2
- "UYVY" - 16 YUV 4:2:2
- "YUV422P" - 16 YVU422 planar
- "YUV411P" - 16 YVU411 planar
- "Y41P" - 12 YUV 4:1:1
- "NV12" - 12 Y/CbCr 4:2:0
- "NV21" - 12 Y/CrCb 4:2:0
- Note that not all capture modes are supported by Player's internal image format; in these modes, images will be translated to the closest matching internal format (ex., RGB32 -> RGB888).
- Depth set in player frame is rounded to full byte (ex. 12b in v4l2 -> 16b in player).
- swap_rb (integer)
- default 0 (no flip)
- value !=0 means that in RGB/BGR (24/32 only) formats, R and B should be swapped
- field (string)
- Default: "ANY"
- Desired field interleaving type. Can be one of:
- ANY
- NONE
- TOP
- BOTTOM
- INTERLEACED
- SEQ_TB
- SEQ_BT
- ALTERNATE
- Search for explanation of each type in v4l2 spec.
- controls ( String + Double tuple )
- Driver specific (default: last used values)
- List of pairs: Control_name(String) Control_value(Double) of v4l2 driver specific names. Values are in range 0-1. Below 0, means use driver default.
- control names and ranges for values are driver specific but are printed of opening device. Non existing controls will be ignored. Control values are applied on each device open. According to v4l2, each source can have different control set. Not specyfing control, means to leave it without change on open.
- show_fps (integer)
- default -1 (disable)
- selects level of debug (-d lev when starting player). Value should be in range -1..9 on selected debuglevel, stats about frames per second will be printed once per 2s.
Note that some of these options may not be honoured by the underlying V4L2 kernel driver (it may not support a given image size, for example).
- Mini Example
driver
(
name "camerav4l2"
plugin "camerav4l2.so"
provides ["camera:0"]
)
- Full example
driver
(
name "camerav4l2"
plugin "camerav4l2.so"
provides ["camera:0"]
dev_file "/dev/video0"
input 0
size [160 120]
mode "RGB24"
show_fps 2
controls [
"red balance" 0.0667
"blue balance" 0.3333
"exposure" 0.0
"global gain" 0.2903
"DAC magnitude" 0.501
"green balance" 0.1333
"exposure2" 0.0328
"iso" 0.0
]
field "any"
swap_rb 0
)
- Authors
Marcin Rudowski
Generated on Thu Jun 29 22:04:43 2006 for Camerav4l2 by
1.4.4