Skip to content

Initial documentation for new camera encoder component #5095

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

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions components/camera_encoder.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Camera Encoder
==============

.. seo::
:description: Instructions for setting up the camera encoder component in ESPHome
:image: camera.svg

The ``camera_encoder`` component provides image compression support for software-based cameras or cameras without
internal compression. It allows raw camera frames to be compressed into a format suitable for transmission to API
clients, such as Home Assistant, which expect JPEG-compressed images.

It supports different encoder implementations, such as a default software JPEG encoder that can be configured with
options like image quality, subsampling, and incremental encoding. These settings make it possible to balance image
quality and performance depending on the use case.

.. note::

The default software JPEG encoder enables devices like the ESP32-S3 to stream images.
It is primarily intended for smallar images due to limited processing power and memory.

.. code-block:: yaml

# Example configuration entry
camera-encoder:

Configuration variables:
------------------------

- **type** (*Optional*): ``default``

Default Options:
^^^^^^^^^^^^^^^^

- **quality** (*Optional*, enum): Selects compression quality. Defaults to ``HIGH``.

- ``BEST`` (Least compression artifacts)
- ``HIGH`` (Minor artifacts)
- ``MED`` (Visible artifacts)
- ``LOW`` (Most artifacts)

- **subsampling** (*Optional*, enum): Enables additional color compression to reduce image size at the expense of color fidelity. Defaults to ``444``.

- ``444`` (No color compression)
- ``420`` (Reduces color data to a quarter)

- **mcu_count** (*Optional*, int): Limits the number of MCU blocks processed per call to support incremental encoding. Prevents blocking other components at the expense of potentially lower frame rates. Defaults to ``0`` (incremental encoding disabled).

See Also
--------

- :doc:`/components/camera/index`
- :apiref:`camera_encoder/default_jpeg_encoder.h`
- :apiref:`camera/encoder.h`
- :ghedit:`Edit`
1 change: 1 addition & 0 deletions components/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ Miscellaneous Components

.. imgtable::

Camera Encoder, components/camera_encoder, camera.svg, dark-invert
ESP32 Camera, components/esp32_camera, camera.svg, dark-invert
Exposure Notifications, components/exposure_notifications, exposure_notifications.png
GPS, components/gps, crosshairs-gps.svg, dark-invert
Expand Down