summaryrefslogtreecommitdiffstats
path: root/doc/ref/zbarcam.xml
blob: 69ad593f3fde97fef3d7936b7121c5a755ad18fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<refentry xml:id="zbarcam"
  xmlns:xlink="http://www.w3.org/1999/xlink">

  <refmeta>
    <refentrytitle>zbarcam</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>zbarcam</refname>

    <refpurpose>scan and decode bar codes from a video device
    </refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>zbarcam</command>
      <arg><option>-qv</option></arg>
      <arg><option>--quiet</option></arg>
      <arg><option>--nodisplay</option></arg>
      <arg><option>--xml</option></arg>
      <arg><option>--verbose<arg>=<replaceable
      class="parameter">n</replaceable></arg></option></arg>
      <arg><option>--prescale=<replaceable
          class="parameter">W</replaceable>x<replaceable
          class="parameter">H</replaceable></option></arg>
      <arg><option>-S<optional><replaceable
          class="parameter">symbology</replaceable>.</optional><replaceable
          class="parameter">config</replaceable><optional>=<replaceable
          class="parameter">value</replaceable></optional></option></arg>
      <arg><option>--set <optional><replaceable
          class="parameter">symbology</replaceable>.</optional><replaceable
          class="parameter">config</replaceable><optional>=<replaceable
          class="parameter">value</replaceable></optional></option></arg>
      <arg><replaceable class="parameter">device</replaceable></arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>zbarcam</command>
      <group choice="req">
        <arg choice="plain"><option>-h</option></arg>
        <arg choice="plain"><option>--help</option></arg>
        <arg choice="plain"><option>--version</option></arg>
      </group>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Description</title>

    <para><command>zbarcam</command> scans a video4linux video source
    (eg, a webcam) for bar codes and prints any decoded data to the
    standard output.  The video stream is also displayed to the
    screen. </para>

    <para><replaceable class="parameter">device</replaceable> is the
    path to the video4linux (version 1 or 2) character device special
    file (major number 81 and minor number 0 thru 63).  It defaults to
    <filename>/dev/video0</filename></para>

    <para>The underlying library currently supports EAN-13 (including
    UPC and ISBN subsets), EAN-8, DataBar, DataBar Expanded, Code 128,
    Code 93, Code 39, Codabar, Interleaved 2 of 5 and QR Code symbologies.
    The specific type of each detected symbol is printed with the decoded
    data.</para>

  </refsection>

  <refsection>
    <title>Options</title>

    <para>This program follows the usual GNU command line syntax.
    Single letter options may be bundled, long options start with two
    dashes (`-').</para>

    <variablelist>
      &refcommonoptions;

      <varlistentry>
        <term><option>-q</option></term>
        <term><option>--quiet</option></term>
        <listitem>
          <simpara>Quiet operation; disable the audible beep otherwise
          emitted when a symbol is decoded</simpara>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--nodisplay</option></term>
        <listitem>
          <simpara>Disable output video window.  Video input will be
          scanned until the program is interrupted or otherwise
          signaled</simpara>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--xml</option></term>
        <listitem>
          <simpara>Stream results using an XML output format.  This
          format wraps the raw data from the symbol with information
          about the scan in an easy to parse format.  The latest
          schema is available from <link xlink:href="http://zbar.sourceforge.net/2008/barcode.xsd"/></simpara>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--raw</option></term>
        <listitem>
          <simpara>Use raw symbol data output format.  This format
          prints symbol data separated by newlines without the
          additional symbology type information that is printed by
          default</simpara>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--prescale=<replaceable
          class="parameter">W</replaceable>x<replaceable
          class="parameter">H</replaceable></option></term>
        <listitem>
          <simpara>Request video input scaling from the camera driver.
          Possibly useful for reducing huge frames to achieve a higher
          frame rate.  Note that the driver may adjust or completely
          ignore the scaling request</simpara>
        </listitem>
      </varlistentry>

    </variablelist>
  </refsection>

  <refsection>
    <title>Examples</title>

    <para>Scan for barcodes using the second video device and pipe the
    resulting data through a script that searches for each code in a
    database and does something useful with them:

      <screen><command>zbarcam</command> <filename>/dev/video1</filename> | <command>upcrpc.py</command></screen>

    The <command>upcrpc.py</command> example script included in the
    <filename>examples/</filename> subdirectory of the distribution
    will make an XMLRPC call to a popular internet UPC database and
    print the product description if found.</para>

    <para>Scan for barcodes using the default video device and stream
    results to stdout in XML format, also disable recognition of
    Interleaved 2 of 5 codes to prevent confusion with other
    symbologies or background noise:

      <screen><command>zbarcam</command> <option>--xml</option> <option>-Si25.disable</option></screen>
    </para>

    <para>Scan only for Code 39, without using the preview window -
    maybe for a fixed installation.  To enable only Code 39, first all
    symbologies are disabled, then Code 39 is re-enabled:

      <screen><command>zbarcam</command> <option>--nodisplay</option> <option>-Sdisable</option> <option>-Scode39.enable</option></screen>
    </para>
  </refsection>

  <refsection>
    <title>Exit Status</title>

    <para><command>zbarcam</command> returns an exit code to indicate the
    status of the program execution. Current exit codes are:</para>

    <variablelist>
      <varlistentry>
        <term>0</term>
        <listitem>
          <para>Successful program completion.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>1</term>
        <listitem>
          <para>An error occurred.  This includes bad arguments and I/O
          errors.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>2</term>
        <listitem>
          <para>A fatal error occurred.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>See Also</title>
    <para><xref linkend="zbarimg"/></para>
    <para><link xlink:href="http://zbar.sf.net/"/></para>
  </refsection>

  <refsection>
    <title>Bugs</title>

    <para>See <link xlink:href="http://sf.net/tracker/?group_id=189236&amp;atid=928515"/></para>

  </refsection>

</refentry>