Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 204 | chris | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
||
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
||
| 4 | <head> |
||
| 5 | <title>ARToolKit Video Library Configuration documentation</title> |
||
| 6 | </head> |
||
| 7 | <body> |
||
| 8 | <h1>ARToolKit video configuration </h1> |
||
| 9 | <p>When using ARToolKit to open a video stream, one of the following functions / |
||
| 10 | code snippets is called:</p> |
||
| 11 | <blockquote> |
||
| 12 | <p><code>arVideoOpen(char *vconf);</code></p> |
||
| 13 | </blockquote> |
||
| 14 | <p>or</p> |
||
| 15 | <blockquote> |
||
| 16 | <p><code>AR2VideoParamT vid;<br> |
||
| 17 | vid = ar2VideoOpen(char *vconf);</code></p> |
||
| 18 | </blockquote> |
||
| 19 | <p>These functions take a single parameter, vconf, which is a character string.</p> |
||
| 20 | <p>This character string encapsulates operating-system dependent directions as |
||
| 21 | to how to find, open and configure the video stream. |
||
| 22 | In order to assist you in determining a set of parameters, the functions |
||
| 23 | <code>arVideoDispOption();</code> |
||
| 24 | or |
||
| 25 | <code>ar2VideoDispOption();</code> |
||
| 26 | are designed to output some help text. |
||
| 27 | |||
| 28 | The text is reproduced here for your convenience.</p> |
||
| 29 | <p>Select an operating system / driver for which you wish to view the help text</p> |
||
| 30 | <ul> |
||
| 31 | <li><a href="#VideoLinux1394Cam">VideoLinux1394Cam</a></li> |
||
| 32 | <li><a href="#VideoGStreamer">VideoGStreamer</a></li> |
||
| 33 | <li><a href="#VideoLinuxDVCam">VideoLinuxDVCam</a></li> |
||
| 34 | <li><a href="#VideoLinuxV4L">VideoLinuxV4L</a></li> |
||
| 35 | <li><a href="#VideoMacOSX">VideoMacOSX</a></li> |
||
| 36 | <li><a href="#VideoSGI">VideoSGI</a></li> |
||
| 37 | <li><a href="#VideoWin32DirectShow">VideoWin32DirectShow</a> |
||
| 38 | <ul> |
||
| 39 | <li><a href="#VideoWin32DirectShow271">ARToolKit versions 2.71 and later</a></li> |
||
| 40 | <li><a href="#VideoWin32DirectShow265">ARToolKit versions 2.65 to 2.70.1</a></li> |
||
| 41 | </ul> |
||
| 42 | </li> |
||
| 43 | </ul> |
||
| 44 | <p> </p> |
||
| 45 | <a class="anchor" name="VideoLinux1394Cam"> |
||
| 46 | <h2>VideoLinux1394Cam</h2> |
||
| 47 | |||
| 48 | <pre> |
||
| 49 | ARVideo may be configured using one or more of the following options, |
||
| 50 | separated by a space: |
||
| 51 | |||
| 52 | -node=N |
||
| 53 | specifies detected node ID of a FireWire camera (-1: Any). |
||
| 54 | -card=N |
||
| 55 | specifies the FireWire adaptor id number (-1: Any). |
||
| 56 | -mode=[320x240_YUV422|640x480_RGB|640x480_YUV411] |
||
| 57 | specifies input image format. |
||
| 58 | -rate=N |
||
| 59 | specifies desired framerate of a FireWire camera. |
||
| 60 | (1.875, 3.75, 7.5, 15, 30, 60) |
||
| 61 | -[name]=N where name is brightness, iris, shutter, gain, saturation, gamma, sharpness |
||
| 62 | (value must be a legal value for this parameter - use coriander to find what they are |
||
| 63 | </pre> |
||
| 64 | |||
| 65 | <a class="anchor" name="VideoGStreamer"> |
||
| 66 | <h2>VideoGStreamer</h2> |
||
| 67 | <p> |
||
| 68 | ARVideo via <a href="http://www.gstreamer.org">GStreamer</a> may be configured using a configuration string following the <code>gst-launch</code> syntax. Some examples (using the ARTOOLKIT_CONFIG environment variable, bash syntax): |
||
| 69 | </p> |
||
| 70 | |||
| 71 | <ul> |
||
| 72 | <li>Loading a file from disk: |
||
| 73 | <pre> |
||
| 74 | $> export ARTOOLKIT_CONFIG="filesrc location=gstreamer_test_xvid.avi ! decodebin ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink" |
||
| 75 | </pre> |
||
| 76 | |||
| 77 | <li>Using a webcam on /dev/video0 through Video4Linux v2 (V4L2): |
||
| 78 | <pre>$> export ARTOOLKIT_CONFIG="v4l2src device=/dev/video1 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink" |
||
| 79 | </pre> |
||
| 80 | </li> |
||
| 81 | |||
| 82 | The same strings can also directly been used within the code: |
||
| 83 | <pre>arVideoOpen("videotestsrc ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink");</pre> |
||
| 84 | |||
| 85 | </ul> |
||
| 86 | |||
| 87 | <a class="anchor" name="VideoLinuxDV"> |
||
| 88 | <h2>VideoLinuxDV |
||
| 89 | |||
| 90 | </h2> |
||
| 91 | <pre> |
||
| 92 | ARVideo may be configured using one or more of the following options, |
||
| 93 | separated by a space: |
||
| 94 | |||
| 95 | -mode=[PAL|NTSC] |
||
| 96 | specifies TV signal mode. |
||
| 97 | </pre> |
||
| 98 | |||
| 99 | |||
| 100 | <a class="anchor" name="VideoLinuxV4L"> |
||
| 101 | <h2>VideoLinuxV4L |
||
| 102 | |||
| 103 | </h2> |
||
| 104 | <pre> |
||
| 105 | ARVideo may be configured using one or more of the following options, |
||
| 106 | separated by a space: |
||
| 107 | |||
| 108 | DEVICE CONTROLS: |
||
| 109 | -dev=filepath |
||
| 110 | specifies device file. |
||
| 111 | -channel=N |
||
| 112 | specifies source channel. |
||
| 113 | -noadjust |
||
| 114 | prevent adjusting the width/height/channel if not suitable. |
||
| 115 | -width=N |
||
| 116 | specifies expected width of image. |
||
| 117 | -height=N |
||
| 118 | specifies expected height of image. |
||
| 119 | -palette=[RGB|YUV420P] |
||
| 120 | specifies the camera palette (WARNING:all are not supported on each camera !!). |
||
| 121 | IMAGE CONTROLS (WARNING: every options are not supported by all camera !!): |
||
| 122 | -brightness=N |
||
| 123 | specifies brightness. (0.0 <-> 1.0) |
||
| 124 | -contrast=N |
||
| 125 | specifies contrast. (0.0 <-> 1.0) |
||
| 126 | -saturation=N |
||
| 127 | specifies saturation (color). (0.0 <-> 1.0) (for color camera only) |
||
| 128 | -hue=N |
||
| 129 | specifies hue. (0.0 <-> 1.0) (for color camera only) |
||
| 130 | -whiteness=N |
||
| 131 | specifies whiteness. (0.0 <-> 1.0) (REMARK: gamma for some drivers, otherwise for greyscale camera only) |
||
| 132 | -color=N |
||
| 133 | specifies saturation (color). (0.0 <-> 1.0) (REMARK: obsolete !! use saturation control) |
||
| 134 | |||
| 135 | OPTION CONTROLS: |
||
| 136 | -mode=[PAL|NTSC|SECAM] |
||
| 137 | specifies TV signal mode (for tv/capture card). |
||
| 138 | </pre> |
||
| 139 | |||
| 140 | |||
| 141 | <a class="anchor" name="VideoMacOSX"> |
||
| 142 | <h2>VideoMacOSX |
||
| 143 | |||
| 144 | </h2> |
||
| 145 | <pre> |
||
| 146 | ARVideo may be configured using one or more of the following options, |
||
| 147 | separated by a space: |
||
| 148 | |||
| 149 | -nodialog |
||
| 150 | Don't display video settings dialog. |
||
| 151 | -width=w |
||
| 152 | Scale camera native image to width w. |
||
| 153 | -height=h |
||
| 154 | Scale camera native image to height h. |
||
| 155 | -fps |
||
| 156 | Overlay camera frame counter on image. |
||
| 157 | -grabber=n |
||
| 158 | With multiple QuickTime video grabber components installed, |
||
| 159 | use component n (default n=1). |
||
| 160 | N.B. It is NOT necessary to use this option if you have installed |
||
| 161 | more than one video input device (e.g. two cameras) as the default |
||
| 162 | QuickTime grabber can manage multiple video channels. |
||
| 163 | -pixelformat=cccc |
||
| 164 | Return images with pixels in format cccc, where cccc is either a |
||
| 165 | numeric pixel format number or a valid 4-character-code for a |
||
| 166 | pixel format. The following values are supported: |
||
| 167 | 32, BGRA, RGBA, ABGR, 24, 24BG, 2vuy, yuvs. |
||
| 168 | (See http://developer.apple.com/quicktime/icefloe/dispatch020.html.) |
||
| 169 | -fliph |
||
| 170 | Flip camera image horizontally. (Added in ARToolKit v2.72.) |
||
| 171 | -flipv |
||
| 172 | Flip camera image vertically. (Added in ARToolKit v2.72.) |
||
| 173 | </pre> |
||
| 174 | |||
| 175 | |||
| 176 | <a class="anchor" name="VideoSGI"> |
||
| 177 | <h2>VideoSGI |
||
| 178 | |||
| 179 | </h2> |
||
| 180 | <pre> |
||
| 181 | ARVideo may be configured using one or more of the following options, |
||
| 182 | separated by a space: |
||
| 183 | |||
| 184 | -size=[FULL/HALF] |
||
| 185 | specifies size of image. |
||
| 186 | -device=N |
||
| 187 | specifies device number. |
||
| 188 | -bufsize=N |
||
| 189 | specifies video buffer size. |
||
| 190 | </pre> |
||
| 191 | |||
| 192 | |||
| 193 | <a class="anchor" name="VideoWin32DirectShow"> |
||
| 194 | <h2>VideoWin32DirectShow</h2> |
||
| 195 | <a class="anchor" name="VideoWin32DirectShow271"> |
||
| 196 | <h3>ARToolKit versions 2.71 and later </h3> |
||
| 197 | <p>In ARToolKit 2.71 and later, the video configuration is specified in an XML file, conforming to the DSVideoLib XML Schema. This schema is documented in the file "DsVideoLib.xsd" inside the DSVL-0.0.8b package. You can use an <a href="http://www.w3.org/XML/Schema">XML Schema viewer</a> to view the schema file, and a text editor or XML editor to edit your own configuration file.</p> |
||
| 198 | <p>The pathname of the configuration file is then specified in the video configuration string. </p> |
||
| 199 | <blockquote><pre> |
||
| 200 | parameter is a file name (e.g. 'config.XML') conforming to the DSVideoLib XML Schema (DsVideoLib.xsd). |
||
| 201 | </pre></blockquote> |
||
| 202 | <a class="anchor" name="VideoWin32DirectShow265"> |
||
| 203 | <h3>ARToolKit versions 2.65 to 2.70.1</h3> |
||
| 204 | <blockquote> |
||
| 205 | <pre> |
||
| 206 | parameter format is either NULL or a list of tokens, separated by commas "," |
||
| 207 | |||
| 208 | BINARY TOKENS: |
||
| 209 | -------------- |
||
| 210 | flipH : flip image horizontally (WARNING: non-optimal performance) |
||
| 211 | flipV : flip image vertically (WARNING: non-optimal performance) |
||
| 212 | showDlg : displays either WDM capture filter's property page or |
||
| 213 | MSDV decoder format dialog (depending on source media type). |
||
| 214 | only applies to WDM_CAP, will be ignored for AVI_FILE |
||
| 215 | loopAVI : continuously loops through an AVI file (applies only to AVI_FILE) |
||
| 216 | noClock : does not use a Reference Clock to synchronize samples; |
||
| 217 | use this flag for offline post-processing (applies only to AVI_FILE) |
||
| 218 | renderSec : render secondary streams (applies only to AVI_FILE) |
||
| 219 | An AVI file can contain an arbitrary number of multiplexed A/V substreams, |
||
| 220 | usually there are at most 2 substreams (1st: video, 2nd: audio). |
||
| 221 | the AVI_FILE input module will only try to render stream 0x00 (assuming that |
||
| 222 | it's video) and ignore the remaning substreams. |
||
| 223 | Use this flag to force IGraphBuilder->Render(IPin*) calls on substreams 1..n |
||
| 224 | DO NOT SET this flag if your AVI file contains more than one video stream |
||
| 225 | |||
| 226 | PARAMETRIZED TOKENS: |
||
| 227 | -------------------- |
||
| 228 | inputDevice=? : supported parameters: |
||
| 229 | "WDM_CAP" (WDM_VIDEO_CAPTURE_FILTER) use the DirectShow WDM wrapper |
||
| 230 | to obtain live video input from a streaming capture device |
||
| 231 | such as a IEEE 1394 DV camera or USB webcam. |
||
| 232 | OPTIONAL: set deviceName=? and/or ieee1394id=? for better |
||
| 233 | control over the choice of suitable WDM drivers |
||
| 234 | "AVI_FILE" (ASYNC_FILE_INPUT_FILTER) use an Asynchronous File Input |
||
| 235 | Filter to read & decode AVI video data |
||
| 236 | NOTE: be sure to specify the input file name by pointing |
||
| 237 | fileName=? to a valid AVI file. |
||
| 238 | |||
| 239 | EXAMPLE: "inputDevive=WDM_CAP", or "inputDevice=AVI_FILE" |
||
| 240 | DEFAULT: "WDM_CAP" will be selected if you omit this token |
||
| 241 | |||
| 242 | videoWidth=? : preferred video width, EXAMPLE: "videoWidth=720" |
||
| 243 | only applies to WDM_CAP, will be ignored for AVI_FILE |
||
| 244 | videoHeight=? : preferred video height, EXAMPLE: "videoHeight=576" |
||
| 245 | only applies to WDM_CAP, will be ignored for AVI_FILE |
||
| 246 | |||
| 247 | pixelFormat=? : internal pixel format (see PixelFormat.h for supported types) |
||
| 248 | PERFORMANCE WARNING: Be sure to match your IDirect3DTexture/OpenGL texture |
||
| 249 | formats to whatever you specify here, i.e. use |
||
| 250 | PXtoOpenGL(format), PXtoD3D(format) for creating your |
||
| 251 | textures! (see PixelFormat.h for details) |
||
| 252 | EXAMPLE: "pixelFormat=PIXELFORMAT_RGB32" |
||
| 253 | NOTE: if you omit the pixelFormat=? token, the global |
||
| 254 | constant (default_PIXELFORMAT, usually PIXELFORMAT_RGB32) |
||
| 255 | will be selected. |
||
| 256 | |||
| 257 | friendlyName=? : only applies to WDM_CAP, will be IGNORED if "inputDevice=WDM_CAP" is not set. |
||
| 258 | Used to select a preferred WDM device. WILL BE IGNORED IF deviceName=? IS SET."); |
||
| 259 | (WARNING: WDM "friendly names" are locale-dependent), i.e. try to match substring <?> |
||
| 260 | with the "friendly names" of enumerated DirectShow WDM wrappers (ksproxy.ax). |
||
| 261 | EXAMPLE: "friendlyName=Microsoft DV Camera" for IEEE1394 DV devices |
||
| 262 | "friendlyName=QuickCam" for Logitech QuickCam |
||
| 263 | |||
| 264 | deviceName=? : only applies to WDM_CAP, will be IGNORED if "inputDevice=WDM_CAP" is not set. |
||
| 265 | Used to select a preferred WDM device. WILL ALWAYS WILL OVERRIDE friendlyName=? |
||
| 266 | i.e. try to match substring <?> with the "device names" of enumerated DirectShow |
||
| 267 | WDM wrappers (ksproxy.ax). |
||
| 268 | Device names look like: "@device:*:{860BB310-5D01-11d0-BD3B-00A0C911CE86} |
||
| 269 | Use GraphEdit (part of the DirectX SDK, under \DXSDK\bin\DxUtils\graphedt.exe) |
||
| 270 | to figure out your camera's device name. |
||
| 271 | EXAMPLE: "deviceName=1394#unibrain&fire-i_1.2#4510000061431408 |
||
| 272 | |||
| 273 | fileName=? : only applies to AVI_FILE, will be IGNORED if "inputDevice=AVI_FILE" is not set. |
||
| 274 | input file name, if just use a file's name (without its full path), the WIN32 |
||
| 275 | API fuction SearchPath() (Winbase.h) will be used to locate the file. |
||
| 276 | EXAMPLE: "fileName=C:\Some Directory\Another Directory\Video.AVI" |
||
| 277 | "fileName=video.AVI" (will succeed if C:\Some Directory\Another Directory\ |
||
| 278 | is: * the application's startup directory |
||
| 279 | * the current directory |
||
| 280 | * listed in the PATH environment variable) |
||
| 281 | |||
| 282 | ieee1394id=? : only applies to WDM_CAP, will be IGNORED if "inputDevice=WDM_CAP" is not set. |
||
| 283 | Unique 64-bit device identifier, as defined by IEEE 1394. |
||
| 284 | Hexadecimal value expected, i.e. "ieee1394id=437d3b0201460008" |
||
| 285 | Use /bin/IEEE394_id.exe to determine your camera's ID. |
||
| 286 | |||
| 287 | deinterlaceState=? : supported parameters (see VFX_STATE_names[]) |
||
| 288 | "off" : disable deinterlacing (DEFAULT) |
||
| 289 | "on" : force deinterlacing (even for progressive frames) |
||
| 290 | "auto" : enable deinterlacing only if |
||
| 291 | (VIDEOINFOHEADER.dwInterlaceFlags & AMINTERLACE_IsInterlaced) |
||
| 292 | WARNING: EXPERIMENTAL FEATURE! |
||
| 293 | |||
| 294 | deinterlaceMethod=? : deinterlacing method (see VFxDeinterlaceParam.h for supported modes) |
||
| 295 | supported parameters (see DEINTERLACE_METHOD_names[]): |
||
| 296 | "blend" : blend fields (best quality) |
||
| 297 | "duplicate1" : duplicate first field |
||
| 298 | "duplicate2" : duplicate second field |
||
| 299 | NOTE: omitting this token results in default mode (DEINTERLACE_BLEND) being used. |
||
| 300 | WARNING: EXPERIMENTAL FEATURE! |
||
| 301 | |||
| 302 | EXAMPLES: |
||
| 303 | |||
| 304 | arVideoOpen(NULL); |
||
| 305 | arVideoOpen("inputDevice=WDM_CAP,showDlg"); |
||
| 306 | arVideoOpen("inputDevice=WDM_CAP,flipH,flipV,showDlg"); |
||
| 307 | arVideoOpen("inputDevice=WDM_CAP,pixelFormat=PIXELFORMAT_RGB24,showDlg"); |
||
| 308 | arVideoOpen("inputDevice=WDM_CAP,showDlg,deinterlaceState=on,deinterlaceMethod=duplicate1"); |
||
| 309 | arVideoOpen("inputDevice=WDM_CAP,videoWidth=640,flipH,videoHeight=480,showDlg,deinterlaceState=auto"); |
||
| 310 | arVideoOpen("inputDevice=WDM_CAP,friendlyName=Microsoft DV Camera,videoWidth=720,videoHeight=480"); |
||
| 311 | arVideoOpen("inputDevice=WDM_CAP,friendlyName=Logitech,videoWidth=320,videoHeight=240,flipV"); |
||
| 312 | arVideoOpen("inputDevice=WDM_CAP,friendlyName=Microsoft DV Camera,ieee1394id=437d3b0201460008"); |
||
| 313 | arVideoOpen("inputDevice=AVI_FILE,fileName=C:\Some Directory\Another Directory\Video.AVI"); |
||
| 314 | arVideoOpen("inputDevice=AVI_FILE,fileName=Video.AVI,pixelFormat=PIXELFORMAT_RGB24"); |
||
| 315 | </pre> |
||
| 316 | </blockquote> |
||
| 317 | </body> |
||
| 318 | </html> |