zbar
跳转到导航
跳转到搜索
从摄像头或者图片解码二维码等。
zbarcam
用法:
zbarcam [device]
参数:
--raw- 仅输出内容,不附加「QR-Code:」等文本
问题与解决方案
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
使用 LD_PRELOAD 环境变量预加载一个库即可:[1]
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam
zbarimg
使用 ImageMagick 的 import 命令截图并识别:
import png:- | zbarimg /dev/stdin
外部链接
- DushyanthMaguluru/ZBarScanner, an Android library project that simplifies the usage of the ZBar SDK for scanning bar codes from within your Android application.