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

Receiving timeout when taking a photo for larger image sizes #23

Closed hsztul closed 6 years ago

hsztul commented 6 years ago

I am trying to take photos at full resolution of my camera using a Raspberry Pi 3. Setting the size of the image to anything above 1024x768 and a high quality (80) using:

Picam.set_size(1024, 768)
Picam.set_quality(80)

results in a timeout:

** (exit) exited in: GenServer.call(Picam.Camera, :next_frame, 5000)
    ** (EXIT) time out
    (elixir) lib/gen_server.ex:774: GenServer.call/3

I've tried explicitly changing the timeout calling GenServer.call(Picam.Camera, :next_frame, 10000) directly (rather than Picam.next_frame) but changing the timeout never results in a successful image.

Is there a way around this? or something that I'm perhaps doing wrong here?

electricshaman commented 6 years ago

Hi @hsztul. Sorry to hear you're encountering this issue - it sounds like a buffer size might need to be increased in the underlying C port, either MAX_DATA_BUFFER_SIZE or MAX_REQUEST_BUFFER_SIZE. That would be my first guess if you're interesting in experimenting with those values. I will need to look into it more carefully to be sure.

jeroenhouben commented 5 years ago

I'm also experiencing this (pi zero, camera v2)

raphi-web commented 2 years ago

I tried to increase the MAX_DATA_BUFFER_SIZE to 524288 and the MAX_REQUEST_BUFFER_SIZE to 8192, but still get this Error with the PI Cam V2 on Raspberry Pi Zero.