elixir-vision / picam

Elixir library used to capture MJPEG video on a Raspberry Pi using the camera module.
Other
122 stars 27 forks source link

Support multiple cameras #4

Open electricshaman opened 7 years ago

fhunleth commented 6 years ago

@electricshaman or @hsztul If I take a look at adding multiple camera support to the C side, can one of you make the updates to the Elixir side?

@hsztul In your device, are you using two cameras simultaneously or is the second camera port more convenient for some reason? Also, what's the cheapest or easiest way for Jeff and me to try out the second camera port? It's only accessible via the compute module, right?

electricshaman commented 6 years ago

@fhunleth Sure, if I were to do it, the ideal situation would be to make camselect a parameter to start_link then return a PID that the client would have to pass into everything. This would break backwards compatibility, of course.

hsztul commented 6 years ago

@fhunleth I am using both camera ports simultaneously using the compute module. I believe that the only way to test this would be to use the compute module (+dev kit). I have one and could help test.

I can try helping on the Elixir side (relatively new to Elixir, so might have to bear with me).

fhunleth commented 6 years ago

@electricshaman That's the only route that I can think of doing to implement this.

@hsztul Welcome to Elixir, then! We'll definitely be leaning on you to test. Also, what @electricshaman is proposing for how to change the Elixir API isn't too bad. It's mostly a mechanical change. I think that I'll have a chance to take a look at the C code either tomorrow or Monday. I'll post when I have something to try.

fhunleth commented 6 years ago

@hsztul Totally untested code is available in the dual-camera branch. I hardcoded it to use the second camera. Just look for the FIXME. Fingers are crossed that this works...

fhunleth commented 6 years ago

@hsztul @electricshaman Just curious if anyone was going to follow up on the dual camera change?

electricshaman commented 6 years ago

@fhunleth I don't have a compute module or I would try it.

electricshaman commented 6 years ago

@hsztul Have you had a chance to test this?

fhunleth commented 6 years ago

FYI - I met up with the Bowery Farming team over the weekend and found out that they abandoned using picam and just call raspi-still directly (they don't need video). I personally think that this work is so close that someone with a compute module and two cameras could easily finish it off.