When using a webcam via SSH on a Raspberry Pi on the network, if you set proc.init (device)
as in the sample, an error will occur because the screen cannot be displayed.
proc.init(device)
zbar.SystemError: ERROR: zbar processor in zbar_processor_init():
system error: spawning input thread: Invalid argument (22)
It's okay to add the -X
option to SSH, but in many cases the screen display is not necessary as an application in the first place, so a memo of how to deal with such cases.
import zbar
proc = zbar.Processor()
device = '/dev/video0'
proc.init(device, False)
According to this article, although it is not documented, the device name and False are used to initialize the Processor. I should give it.