André Esser's PiCameleon Lets Multiple Processes Use a Raspberry Pi Camera Module at the Same Time

Clever Python middleman lets processes request different functions, resolutions, and even detect motion — all simultaneously.

Developer André Esser has released a tool designed to address one of the biggest problems with the Raspberry Pi's camera interface: Its inability to communicate with more than one process at once.

"The Raspberry Pi Camera [Module] can only be used by one process at a time," Esser explains of the problem he has tried to solve. "This can be very limiting when you need a camera feed from the camera to be used by many other programs or want to take pictures while some other program is using it."

"However the camera has four ports that can be used simultaneously by the same process. This feature is exposed by the picamera library. The feature is leveraged in this project to allow communication with the camera that would be difficult without it."

Dubbed PiCameleon, Esser's project acts a daemon that sits between the Raspberry Pi Camera Module and whatever client software needs access. Depending on configuration, it allows processes to request multiple streams at multiple qualities, send video streams to multiple clients for processing, request photo or video capture even while streaming is taking place, and even detect motion to trigger events.

Written in Python and recommended for use inside a Docker container, PiCameleon could soon become more user-friendly. "Since some of you really liked it," Esser writes in response to early feedback, "I'm thinking of writing a client for it so it is easier to use it."

The current version, meanwhile, is available with instructions on GitHub under the reciprocal GNU General Public License 3.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles