ZBARCAM(1)
π ZBARCAM β bestie's guide to scanning barcodes off a webcam π
okay so. you know how your laptop has a camera and barcodes exist? yeah. this is the thing that marries them. it's zbarcam, from the ZBar Barcode Reader fam, and she is that girl. π
β¨ NAME β¨
zbarcam β scan and decode bar codes from a video device π¦
πΈ SYNOPSIS πΈ
zbarcam [-qv] [--quiet] [--nodisplay] [--xml] [--verbose[=n]]
[--prescale=WxH] [-S[symbology.]config[=value]]
[--set [symbology.]config[=value]] [device]
zbarcam {-h | --help | --version}
π DESCRIPTION π
so zbarcam points itself at a video4linux video source (like, a webcam, bestie) and hunts for bar codes in the video stream. when it finds one it prints the decoded data to standard output. and yes, it also shows you the video on your screen, so you get the whole aesthetic while it works. π
device is the path to the video4linux (version 1 or 2) character device special file β that's major number 81 and minor number 0 thru 63 for those of you taking notes. it defaults to /dev/video0. slay.
the underlying library currently supports these symbologies: 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. the specific type of each detected symbol gets printed right alongside the decoded data, so you always know what you're looking at. β¨
π OPTIONS π
this program follows the usual GNU command line syntax. single letter options may be bundled, long options start with two dashes (-). periodt.
-h,--helpβ prints a short help message describing the command line options to standard output, then exits. the classic.--versionβ prints program version information to standard output and exits. go off.-v,--verbose[=n]β cranks up the debug output level. stack multiple-voptions for more spew π. or just hand itnto set the debug level directly, if you're a direct-communication kinda girl.-S[symbology.]config[=value],--set [symbology.]config[=value]β sets decoder configuration optionconfigforsymbologytovalue. if you skipvalueit defaults to1.symbologyis one ofean13,ean8,upca,upce,isbn13,isbn10,i25,codabar,code39,code93,code128,qrcode, or the special value*. ifsymbologyis omitted or is*, the config gets set for all applicable symbologies. prefix a config with"no-"to negate it. heads up: not all configs are appropriate for every symbology. π
here are the currently recognized configs:
enableβ controls decoding/reporting of a symbology. for the symbologies that are literally just subsets ofean13(upca,upce,isbn13,isbn10), this config controls whether the subsets are detected and reported as such. these special cases are disabled by default; all other symbologies default to enabled.disableβ antonym forenable. πemit-checkβ controls whether check digits are included in the decoded output. enabled by default. this config does not apply forcode128, which never returns the check digit. it also does not apply in cases where the check digit is disabled (seeadd-check). check digits are currently not implemented fori25orcode39.add-checkβ enables decode and verification of a check digit for symbologies where it's optional: this will includecode39andi25, neither of which implements the check digit yet. πasciiβ enables escape sequences that encode the full ASCII character set. this would apply tocode39, except that it's not implemented either... π«positionβ enables collection of symbol position information. enabled by default. currently the position information is unusable, so you can save a few cycles by disabling this. lowkey free performance, ngl.test-invertedβ specially for QR code images, because sometimes the image is inverted, e. g. lines are written in white instead of black. this option makes ZBar invert the image and parse again, in case it fails using the normal order. enabling it affects all decoders.min-length=n,max-length=nβ bound the number of decoded characters in a valid symbol. if a decode result lands outside the configured min/max range (inclusive), it will not be reported. set to0to disable the corresponding check. this setting applies to variable-length symbologies:i25,codabar,code39,code128andpdf417.min-lengthdefaults to6fori25and1forcode39(per the Code 39 autodiscrimination recommendation); all others default to0.x-density=n,y-density=nβ adjust the density of the scanner passes. lower values scan more of the image at the cost of decreased performance. setting to0disables scanning along that axis. defaults are both1.
-q,--quietβ quiet operation; disables the audible beep that otherwise goes off when a symbol is decoded. π--nodisplayβ disables the output video window. video input will be scanned until the program is interrupted or otherwise signaled. main character energy, no audience required.--xmlβ streams 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 fromhttp://zbar.sourceforge.net/2008/barcode.xsd--rawβ uses the raw symbol data output format. this format prints symbol data separated by newlines without the additional symbology type information that's printed by default. minimalism, we love her.--prescale=WxHβ requests 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. π
π§ EXAMPLES π§
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:
zbarcam /dev/video1 | upcrpc.py
the upcrpc.py example script included in the examples/ subdirectory of the distribution will make an XMLRPC call to a popular internet UPC database and print the product description if found. iconic.
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:
zbarcam --xml -Si25.disable
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:
zbarcam --nodisplay -Sdisable -Scode39.enable
see how it works? disable everything, then let exactly one girl through the door. π β¨
π EXIT STATUS π
zbarcam returns an exit code to indicate the status of the program execution. current exit codes are:
0β Successful program completion. π1β An error occurred. this includes bad arguments and I/O errors.2β A fatal error occurred. π
π₯ SEE ALSO π₯
π BUGS π
see http://sf.net/tracker/?group_id=189236&atid=928515
π AUTHOR π
Jeff Brown <spadix@users.sourceforge.net> Lead developer π
π COPYRIGHT π
Copyright Β© 2007-2010 Jeff Brown
All Rights Reserved
okay bestie that's the whole page, no cap. this was zbar-0.23.95, dated 2017-04-11, and it's the ZBARCAM(1) manual page from the ZBar Barcode Reader. go scan something cute. π¦β¨π
π¦ where this page comes from
- arch rolling: zbar 0.23.95-1 Β· LGPL-2.1-or-later
- fedora 43: zbar 0.23.95-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: zbar 0.23.95-1.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms