zbarcam no compatible image format [Solved]

Discussions Regarding Software

Moderator: Moderators

zbarcam no compatible image format [Solved]

Postby Schweppes » Thu Oct 04, 2012 17:25

zbarcam (to scan bar- and qr-codes with a webcam) fails on sabayon with the error:

WARNING: no compatible input to output format
...trying again with output disabled
ERROR: zbar processor in zbar_processor_init():
unsupported request: no compatible image format

My collegue who uses Debian on the same laptop has no poblem whith it. My webcam works fine with cheese.
I've found a lot forums discribing this problem but none of them offers a working solution.
What can be the problem here?

Let me know what extra information you want me to provide.

Verbose output:
_zbar_video_open: opened camera device /dev/video0 (fd=5)
_zbar_v4l2_probe: HP HD Webcam [Fixed] on usb-0000:00:1a.0-1.3 driver uvcvideo (version 3.5.0)
_zbar_v4l2_probe: capabilities: CAPTURE STREAMING
v4l2_reset_crop: crop bounds: 1280 x 720 @ (0, 0)
v4l2_reset_crop: current crop win: 1280 x 720 @ (0, 0) aspect 1 / 1
v4l2_probe_formats: enumerating supported formats:
v4l2_probe_formats: [0] YUYV : YUV 4:2:2 (YUYV)
v4l2_probe_formats: [1] MJPG : MJPEG COMPRESSED
v4l2_probe_formats: current format: MJPG(47504a4d) 1280 x 720 (line=0x0 size=0x1c2000)
_zbar_v4l2_probe: using I/O mode: USERPTR
add_poll: [1] fd=6 handler=0x7f0fb7d70540
_zbar_window_probe_xv: XVideo extension version 2.2
_zbar_window_probe_xv: adaptor[0] 16 ports 79-94 type=0x11 fmts=1 : Intel(R) Textured Video
_zbar_window_probe_xv: grabbed port 79
xv_probe_port: probing port 79 with 1 encodings:
xv_probe_port: [0] 2048 x 2048 rate=1/1 : XV_IMAGE
xv_probe_port: max XV_IMAGE size 2048x2048
xv_probe_port: 5 image formats
xv_probe_port: [0] YUY2(32595559) YUV LSBFirst packed planes=1 bpp=16 : YUY2
xv_probe_port: [1] YV12(32315659) YUV LSBFirst planar planes=3 bpp=12 : YV12
xv_probe_port: [2] I420(30323449) YUV LSBFirst planar planes=3 bpp=12 : I420
xv_probe_port: [3] UYVY(59565955) YUV LSBFirst packed planes=1 bpp=16 : UYVY
xv_probe_port: [4] XVMC(434d5658) YUV LSBFirst planar planes=3 bpp=12 : XVMC
proc_input_thread: spawned input thread
_zbar_best_format: from YUYV(56595559) to YUY2(32595559)=0 YV12(32315659)=52 I420(30323449)=52 UYVY(59565955)=20
zbar_negotiate_format: YUYV(56595559) -> YUY2(32595559) (0)
zbar_negotiate_format: setting best format YUYV(56595559) (0)
v4l2_set_format: VIDIOC_S_FMT returned -1(16), trying interlaced...
ERROR: zbar video in v4l2_set_format():
system error: setting format 56595559 (VIDIOC_S_FMT): Device or resource busy (16)
WARNING: no compatible input to output format
...trying again with output disabled
_zbar_best_format: from YUYV(56595559) to Y800(30303859)=24
zbar_negotiate_format: YUYV(56595559) -> Y800(30303859) (24)
_zbar_best_format: from MJPG(47504a4d) to Y800(30303859)=96
zbar_negotiate_format: MJPG(47504a4d) -> Y800(30303859) (96)
zbar_negotiate_format: setting best format YUYV(56595559) (24)
v4l2_set_format: VIDIOC_S_FMT returned -1(16), trying interlaced...
ERROR: zbar video in v4l2_set_format():
system error: setting format 56595559 (VIDIOC_S_FMT): Device or resource busy (16)
zbar_processor_init: ERROR: no compatible video input format
ERROR: zbar processor in zbar_processor_init():
unsupported request: no compatible image format
ERROR: zbar processor in zbar_processor_init():
unsupported request: no compatible image format
proc_kick_handler: kicking 2 fds
Last edited by Schweppes on Fri Oct 05, 2012 7:27, edited 1 time in total.
Schweppes
Baby Hen
 
Posts: 2
Joined: Wed Oct 03, 2012 16:00

Re: zbarcam no compatible image format

Postby Fitzcarraldo » Fri Oct 05, 2012 2:57

1. First I installed the package media-gfx/zbar-0.10-r1.

2. Then I checked the status of the installed package by using the Portage eix command (not installed by default in SL, but you could use the command equo search --verbose zbar instead):

Code: Select all
$ eix -I zbar
[I] media-gfx/zbar
     Available versions:  (~)0.10-r1 {{X gtk imagemagick jpeg python qt4 static-libs +threads v4l xv}}
     Installed versions:  0.10-r1(02:04:18 05/10/12)(X gtk jpeg qt4 threads v4l xv -imagemagick -python -static-libs)
     Homepage:            http://zbar.sourceforge.net/
     Description:         Library and tools for reading barcodes from images or video

3. Then I had a look to see what video device my USB Webcam is:

Code: Select all
$ ls /dev/video*
/dev/video0

4. Ah, so it is /dev/video0. So then I launched zbarcam:

Code: Select all
$ zbarcam --raw /dev/video0
WARNING: no compatible input to output format
...trying again with output disabled
ERROR: zbar processor in zbar_processor_init():
    unsupported request: no compatible image format

No cigar, so...

5. Ah, perhaps my Webcam would work with V4L1, so I launched zbarcam with the following prefix:

Code: Select all
$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam --raw /dev/video0

ZBar window pops up and I see myself in the window. So far, so good.

6. I hold a 2D bar code in front of my Webcam, then I hold a 1D Interleaved 2 of 5 10-digit bar code in front of the Webcam. The following is displayed:

Code: Select all
$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam --raw /dev/video0
http://roho.it/mryt
0161223563

Both 2D and 1D bar codes were read correctly. 8)

EDIT: BTW, if you installed the Entropy package, you should have the zbarimg tool installed too, which can be used to read bar code image files. See Installing and using ZBar in Linux to scan bar codes with your Webcam for details.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7335
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: zbarcam no compatible image format

Postby Schweppes » Fri Oct 05, 2012 7:27

OK preloading /usr/lib/libv4l/v4l1compat.so did the trick.

Thanks!
Schweppes
Baby Hen
 
Posts: 2
Joined: Wed Oct 03, 2012 16:00


Return to Software in General

Who is online

Users browsing this forum: No registered users and 1 guest