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

Add support for Raspberry Pi can V2 #39

Closed mobileoverlord closed 5 years ago

mobileoverlord commented 5 years ago

I leaving this here as reported from ElixirConfEU that the new version of the cam doesn’t function properly. https://www.raspberrypi.org/products/camera-module-v2/

I haven’t verified this, needs research

fhunleth commented 5 years ago

There must be more to this, since I’d bet that most people using picam have v2 cameras. I’ve used them in training classes and I assume that’s what Greg uses.

elliotthilaire commented 5 years ago

I just bought a Picam v2 that I intended to use with this library. I’ll test it out soon and report back.

thomis commented 5 years ago

Thanks @mobileoverlord and @fhunleth for taking this up. I bumped into a timeout issue while calling Picam.next_frame() when setting lager image sizes (e.g. Picam.set_size(1920, 0)). Found this previous closed issue #23.

I was trying to increase #define MAX_DATA_BUFFER_SIZE to 1572864 (6 times previous value of 262144) in raspijpgs.c. With new settings re-compile, re-burn I was able to take frames with a image size of 3280*2464. No idea what optimal MAX_DATA_BUFFER_SIZE value is.

Should mention that my camera is labeled with Raspberry Pi Camera V2.1 and using it on a Raspberry Pi 3 Model B+.

GregMefford commented 5 years ago

Hey, sorry for the delayed response on this! Picam definitely supports the V2 camera (it's the main one that I use).

Regarding the internal buffer size - yes, it's really frustrating to me as well that the buffer is finite and limits the quality of output images. I'd like to track that issue separately in #37 since that seems to be the main issue there.

I think I'll close this issue unless someone here can demonstrate a hardware configuration where the V2 camera doesn't work, other than the issue with high-resolution images that log errors about hitting the MAX_DATA_BUFFER_SIZE.