1<refentry xml:id="zbarcam" 2 xmlns:xlink="http://www.w3.org/1999/xlink"> 3 4 <refmeta> 5 <refentrytitle>zbarcam</refentrytitle> 6 <manvolnum>1</manvolnum> 7 </refmeta> 8 9 <refnamediv> 10 <refname>zbarcam</refname> 11 12 <refpurpose>scan and decode bar codes from a video device 13 </refpurpose> 14 </refnamediv> 15 16 <refsynopsisdiv> 17 <cmdsynopsis> 18 <command>zbarcam</command> 19 <arg><option>-qv</option></arg> 20 <arg><option>--quiet</option></arg> 21 <arg><option>--nodisplay</option></arg> 22 <arg><option>--xml</option></arg> 23 <arg><option>--verbose<arg>=<replaceable 24 class="parameter">n</replaceable></arg></option></arg> 25 <arg><option>--prescale=<replaceable 26 class="parameter">W</replaceable>x<replaceable 27 class="parameter">H</replaceable></option></arg> 28 <arg><option>-S<optional><replaceable 29 class="parameter">symbology</replaceable>.</optional><replaceable 30 class="parameter">config</replaceable><optional>=<replaceable 31 class="parameter">value</replaceable></optional></option></arg> 32 <arg><option>--set <optional><replaceable 33 class="parameter">symbology</replaceable>.</optional><replaceable 34 class="parameter">config</replaceable><optional>=<replaceable 35 class="parameter">value</replaceable></optional></option></arg> 36 <arg><replaceable class="parameter">device</replaceable></arg> 37 </cmdsynopsis> 38 39 <cmdsynopsis> 40 <command>zbarcam</command> 41 <group choice="req"> 42 <arg choice="plain"><option>-h</option></arg> 43 <arg choice="plain"><option>--help</option></arg> 44 <arg choice="plain"><option>--version</option></arg> 45 </group> 46 </cmdsynopsis> 47 </refsynopsisdiv> 48 49 <refsection> 50 <title>Description</title> 51 52 <para><command>zbarcam</command> scans a video4linux video source 53 (eg, a webcam) for bar codes and prints any decoded data to the 54 standard output. The video stream is also displayed to the 55 screen. </para> 56 57 <para><replaceable class="parameter">device</replaceable> is the 58 path to the video4linux (version 1 or 2) character device special 59 file (major number 81 and minor number 0 thru 63). It defaults to 60 <filename>/dev/video0</filename></para> 61 62 <para>The underlying library currently supports EAN-13 (including 63 UPC and ISBN subsets), EAN-8, DataBar, DataBar Expanded, Code 128, 64 Code 93, Code 39, Codabar, Interleaved 2 of 5 and QR Code symbologies. 65 The specific type of each detected symbol is printed with the decoded 66 data.</para> 67 68 </refsection> 69 70 <refsection> 71 <title>Options</title> 72 73 <para>This program follows the usual GNU command line syntax. 74 Single letter options may be bundled, long options start with two 75 dashes (`-').</para> 76 77 <variablelist> 78 &refcommonoptions; 79 80 <varlistentry> 81 <term><option>-q</option></term> 82 <term><option>--quiet</option></term> 83 <listitem> 84 <simpara>Quiet operation; disable the audible beep otherwise 85 emitted when a symbol is decoded</simpara> 86 </listitem> 87 </varlistentry> 88 89 <varlistentry> 90 <term><option>--nodisplay</option></term> 91 <listitem> 92 <simpara>Disable output video window. Video input will be 93 scanned until the program is interrupted or otherwise 94 signaled</simpara> 95 </listitem> 96 </varlistentry> 97 98 <varlistentry> 99 <term><option>--xml</option></term> 100 <listitem> 101 <simpara>Stream results using an XML output format. This 102 format wraps the raw data from the symbol with information 103 about the scan in an easy to parse format. The latest 104 schema is available from <link xlink:href="http://zbar.sourceforge.net/2008/barcode.xsd"/></simpara> 105 </listitem> 106 </varlistentry> 107 108 <varlistentry> 109 <term><option>--raw</option></term> 110 <listitem> 111 <simpara>Use raw symbol data output format. This format 112 prints symbol data separated by newlines without the 113 additional symbology type information that is printed by 114 default</simpara> 115 </listitem> 116 </varlistentry> 117 118 <varlistentry> 119 <term><option>--prescale=<replaceable 120 class="parameter">W</replaceable>x<replaceable 121 class="parameter">H</replaceable></option></term> 122 <listitem> 123 <simpara>Request video input scaling from the camera driver. 124 Possibly useful for reducing huge frames to achieve a higher 125 frame rate. Note that the driver may adjust or completely 126 ignore the scaling request</simpara> 127 </listitem> 128 </varlistentry> 129 130 </variablelist> 131 </refsection> 132 133 <refsection> 134 <title>Examples</title> 135 136 <para>Scan for barcodes using the second video device and pipe the 137 resulting data through a script that searches for each code in a 138 database and does something useful with them: 139 140 <screen><command>zbarcam</command> <filename>/dev/video1</filename> | <command>upcrpc.py</command></screen> 141 142 The <command>upcrpc.py</command> example script included in the 143 <filename>examples/</filename> subdirectory of the distribution 144 will make an XMLRPC call to a popular internet UPC database and 145 print the product description if found.</para> 146 147 <para>Scan for barcodes using the default video device and stream 148 results to stdout in XML format, also disable recognition of 149 Interleaved 2 of 5 codes to prevent confusion with other 150 symbologies or background noise: 151 152 <screen><command>zbarcam</command> <option>--xml</option> <option>-Si25.disable</option></screen> 153 </para> 154 155 <para>Scan only for Code 39, without using the preview window - 156 maybe for a fixed installation. To enable only Code 39, first all 157 symbologies are disabled, then Code 39 is re-enabled: 158 159 <screen><command>zbarcam</command> <option>--nodisplay</option> <option>-Sdisable</option> <option>-Scode39.enable</option></screen> 160 </para> 161 </refsection> 162 163 <refsection> 164 <title>Exit Status</title> 165 166 <para><command>zbarcam</command> returns an exit code to indicate the 167 status of the program execution. Current exit codes are:</para> 168 169 <variablelist> 170 <varlistentry> 171 <term>0</term> 172 <listitem> 173 <para>Successful program completion.</para> 174 </listitem> 175 </varlistentry> 176 177 <varlistentry> 178 <term>1</term> 179 <listitem> 180 <para>An error occurred. This includes bad arguments and I/O 181 errors.</para> 182 </listitem> 183 </varlistentry> 184 185 <varlistentry> 186 <term>2</term> 187 <listitem> 188 <para>A fatal error occurred.</para> 189 </listitem> 190 </varlistentry> 191 </variablelist> 192 </refsection> 193 194 <refsection> 195 <title>See Also</title> 196 <para><xref linkend="zbarimg"/></para> 197 <para><link xlink:href="http://zbar.sf.net/"/></para> 198 </refsection> 199 200 <refsection> 201 <title>Bugs</title> 202 203 <para>See <link xlink:href="http://sf.net/tracker/?group_id=189236&atid=928515"/></para> 204 205 </refsection> 206 207</refentry> 208