Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One day I read an article about reading barcode using my webcam in Ubuntu 12.04 by a some software which I don't remember now.

Can anybody help?

What software could help me by reading a barcode using a webcam?

share|improve this question
up vote 9 down vote accepted

ZBar is a library for scanning and decoding bar codes from various sources such as video streams, image files or raw intensity sensors.

It supports EAN,UPC, Code 128, Code 39 and Interleaved 2 of 5.

This package contains basic applications for decoding captured bar code images and using a video4linux device (e.g. webcam) as a bar code scanner.

referred from this link

sudo apt-get install libzbar0
sudo apt-get install libv4lconvert
sudo apt-get install zbar-tools

You can also use qrdecoder

Install Python 2.7

sudo apt-get install python2.7

Install Python Imaging Library (PIL)

sudo apt-get install python-imaging

Install PyQt4.

sudo apt-get install python-qt4

Install zbar.

sudo apt-get install python-zbar

Download and unpack qrDecode source tarball to any directory.


Where x.x.x is the version of qrdecoder

Unpack the tarball.

tar -xvf qrdecoder-x.x.x.tar.gz

Change into the qrDecoder directory.

cd qrdecoder-x.x.x

Start qrDecoder.

python qrdecoder.pyw

You may get an error Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap"

To get rid of this error, install gtk2-engines-pixbuf

sudo apt-get install gtk2-engines-pixbuf
share|improve this answer

Reading barcodes with a USB webcam on Ubuntu?

OK. Follow these steps...

First, installed Zbar and a little program called "crikey". The easy way. Open a terminal and type in:

  1. wget
  2. chmod +x
  3. ./

The script does this, for the more paranoid:

sudo apt-get install zbar-tools
sudo apt-get install libx11-dev x11proto-xext-dev libxt-dev libxtst-dev
tar -xzf crikey-0.8.3.tar.gz
cd crikey-0.8.3
sudo cp crikey /usr/local/bin

Now hook up your USB webcam.

Is your USB webcam supported by V4L1 (Video4Linux1)? Then, open again a terminal and type in:

LD_PRELOAD=/usr/lib/libv4l/ zbarcam --raw --prescale=320x240 /dev/video1 | crikey -i

Now open Google or a Gedit instance, clic inside the search box, and put a barcode in front of your USB webcam. Focus in the barcode, as necessary. You will get the barcode number where you have clicked on before...

Is your USB webcam suported by V4L2 (Video4Linux2)? Then, open a terminal and type in:

zbarcam --raw --prescale=320x240 /dev/video0 | crikey -i

If the above commands don't work, try "video1", instead of "video0"

share|improve this answer
It might be best to explain what crikey does? I'm not familiar with it, but it seems that it's some sort of shortcut maker for the drivers you want to load? – Nanne Nov 11 '12 at 18:48

protected by fossfreedom Oct 18 '13 at 15:00

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?