ESP-H264 Component

[中文]

Note

This document is automatically translated using AI. Please excuse any detailed errors. The official English version is still in progress.

Overview

ESP-H264 is a lightweight H.264 encoder and decoder component developed by Espressif Systems, offering both hardware and software implementations. The hardware encoder is specifically designed for the ESP32-P4 chip, capable of achieving 1080P@30fps. The software encoder is based on openh264, and the decoder is based on tinyH264. Both are optimized for memory and CPU usage, ensuring optimal performance on Espressif chips.

Features

Encoder Features

Hardware Encoder (ESP32-P4):

  • Supports Baseline Profile (maximum frame size 36864 macroblocks)

  • Supports width range [80, 1088] pixels, height range [80, 2048] pixels

  • Supports quality-priority bitrate control

  • Supports RGB888, BGR565_BE, VUY, UYVY, YUV420(O_UYY_E_VYY) raw data formats

  • Supports dynamic adjustment of bitrate, framerate, GOP, QP, etc.

  • Supports single-stream and dual-stream encoders

  • Supports deblocking filter, ROI, motion vector functions

  • Supports SPS and PPS encoding

Software Encoder:

  • Supports Baseline Profile (maximum frame size 36864 macroblocks)

  • Supports any resolution with width and height greater than 16 pixels

  • Supports quality-priority bitrate control

  • Supports YUYV and IYUV raw data formats

  • Supports dynamic adjustment of bitrate, framerate

  • Supports SPS and PPS encoding

Decoder Features

  • Supports Baseline Profile (maximum frame size 36864 macroblocks)

  • Supports various widths and heights

  • Supports Long Term Reference (LTR) frames

  • Supports Memory Management Control Operation (MMCO)

  • Supports reference picture list modification

  • Supports multiple reference frames specified in Sequence Parameter Set (SPS)

  • Supports IYUV output format

Performance

Encoding Performance

ESP32-P4 is recommended to use the hardware encoder, ESP32-S3 and other boards to use the software encoder

Hardware Encoder (only ESP32-P4):

  • Better performance and power consumption, supports up to 1080P@30fps

  • Supports single-stream/dual-stream encoding

  • Supports dynamic adjustment of bitrate, framerate, GOP, QP, etc.

  • Supports advanced features such as deblocking filter, ROI, motion vector

Software Encoder (all platforms):

  • Limited performance and power consumption, but no resolution limit

  • Supports YUYV and IYUV formats, richer color formats

  • Supports all Espressif chip platforms, more board choices

  • Based on the OpenH264 open source project

Encoding Performance Comparison

Platform

Type

Maximum Resolution

Maximum Performance

Remarks

ESP32-S3

Software Encoder

Any

320×240@11fps

ESP32-P4

Hardware Encoder

≤1080P

1920×1080@30fps

Hardware Acceleration

Decoding Performance

All boards are recommended to use the software decoder

Software Decoder (All Platforms):

  • Limited performance and power consumption, but no resolution limit

  • Supports IYUV output format

  • Supports advanced features such as long-term reference frames and memory management control

  • Based on the TinyH264 open source project

Decoder Performance Comparison

Platform

Type

Maximum Resolution

Maximum Performance

ESP32-S3

Software Decoder

Any

320×192@27fps

ESP32-P4

Software Decoder

Any

1280×720@10fps

Warning

Memory consumption strongly depends on the resolution and encoding data of the H.264 stream. It is recommended to adjust memory allocation according to the actual application scenario.

Tip

Using a dual-task decoder can significantly improve decoding performance, especially when processing high-resolution videos.