Flip ESP32-CAM image 90 degrees

I am using the ESP32-CAM and want to flip it 90 degrees. Is it possible at all?
In the ESPHome docs they only provide vertical_flip and horizontal_mirror, which both seems to do an 180 degree flip, not 90.

Here is my camera definition in ESPHome:

esp32_camera:
  name: ${friendly_name}
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  resolution: 800x600
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32

You can do it on HA’s side. Check out the docs.

1 Like

It’s worth noting that this is a hardware limit of the esp32-cam. It’s not possible to do a 90degree rotate since the ov2640 camera itself does not provide that (it does provide v-flip and h-mirror) and the ESP32 doesn’t have enough cpu/fast ram to rotate the images in real time.
This is a PITA if you want to monitor a doorway or stairs, where portrait mode is convenient.
On my (non HA) project I do it via a browser rotate and some js/css, nice to see that HA has provision for this too, I was wondering if it would prove a sticking-point in my evolving setup.

1 Like

Where can i find the documentation?

@KTibow you pointed to the docs but without telling which document you mean.
None of the usable camera entities says anything about rotation options.

Please provide a link.

Perhaps the docs have changed since 2020, since I can’t find what I was referring to. You might find success with camera.ffmpeg.

1 Like

Hello, I was googling a few days how to rotate image from ESP32 CAM in Home Assistant, but have not find any sollution. Would you please mind to help this community to solve image rotation at HA? Thank you.

I would also be interested in this, how to rotate the ESP32-CAM image on the HA side.