Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial images at full res and high image complexity #135

Closed
tve opened this issue Jul 5, 2021 · 1 comment
Closed

partial images at full res and high image complexity #135

tve opened this issue Jul 5, 2021 · 1 comment
Assignees

Comments

@tve
Copy link

tve commented Jul 5, 2021

Thank you for esp32-cam-webserver!

I'm running into a problem, which is that at high resolution (e.g. UXGA) and high image complexity (e.g. lots of leaves or shade screen) the image ends up being cut off. For example, here's a low complexity UXGA image that works:
esp32-cam-20210705-1

Here's an UXGA image that is cut off:
esp32-cam-20210705-2

Here's the (approx) same image taken in XGA, which works:
esp32-cam-20210705-3

If I turn on the streaming I can start the camera so it only sees my indoor room wall and then slowly pan to the window so more of the shade screen comes into view and at some point, seemingly when the image size exceeds about 320KB, the image gets cut off or completely fails. I can then pan back and it works again and so forth.
I believe I've seen some issues about the 320KB limit in the esp32 camera driver repo, do you have any clue about where the bug is?

NB: I'm using the latest master @3ba9e81 and esp32 arduino 1.0.6
NNB: this issue has some hacks: espressif/esp32-camera#203, I've been able to go beyond 350KB using those, but I do get esp_camera_fb_get(): Failed to get the frame on time! errors on occasion.

@easytarget
Copy link
Owner

easytarget commented Jul 6, 2021

Thanks for the complete writeup and the interesting link!

The first thing is to check that PSRAM really is enabled, look at the /dump page or hit d in the console, psram available is shown in the output.

  • If it is disabled you will experience really bad clipping even at moderate quality settings.
  • The Arduino GUI defaults it to off whenever possible, this caught me out a couple of times, so it's worth double-checking even if you know you set it in the GUI..

That said.. Even with PSRAM on, you will see clipped frames at UXGA resolution and the highest quality settings. It will get worse if the image is high brightness and contrast (eg daylight scenes) as you have observed.
Lowering the quality level a bit should resolve it, for streaming use this lower quality should not make much difference.

  • My aquarium cam demonstrates this perfectly, at UXGA/highest quality it gives full unclipped frames when the lights are off, but clipped frames when the bright tank lights come on. Lowering the quality a little (not much) totally cured the problem.

You can also increase XCLK_FREQ_HZ back to the original 20MHz value, it's a new option in myconfig.sample.h', which will reduce the chance of frame timeouts, but that may add other visual artefacts (depending on how good your hardware is..)

The thread you linked to is interesting, I might look at using some of it in the future, but as the author notes they are really for people taking still images, not streaming. I intend keeping this sketch as general as possible, but may return to this if implementing 'capture to SD' or similar.

@easytarget easytarget self-assigned this Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants