examples/peripherals/h264/README.md
| Supported Targets | ESP32-P4 | ESP32-S3 |
|---|
This example demonstrates how to use H.264 hardware/software encoder and decoder with visual pattern generation:
The example supports multiple YUV formats and provides side-by-side colorized display in the console. All encoding parameters are configurable through the ESP-IDF menuconfig system.
This example provides comprehensive configuration options through idf.py menuconfig:
All parameters can be adjusted in "H.264 Example Configuration" menu:
This example requires:
Before building, configure the example parameters:
idf.py menuconfig
Navigate to: Component config → H.264 Example Configuration
For ESP32-P4 (with hardware encoding support):
idf.py set-target esp32p4
idf.py menuconfig # Configure as needed
idf.py build
idf.py -p PORT flash monitor
For ESP32-S3 (software encoding only):
idf.py set-target esp32s3
idf.py menuconfig # Software encoder will be automatically selected
idf.py build
idf.py -p PORT flash monitor
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
I (1555) H264_ENC_DEC: H264 Example starting: 320x240 @ 30fps
I (1565) H264_ENC_DEC: Encoder: Hardware, Decoder: Software
I (1575) H264_ENC_DEC: Config: GOP=30, Bitrate=512000 bps, QP=26
I (1585) H264_DEC.SW: tinyh264 version: 1c7f584
I (1585) H264_ENC_DEC: H264 encode-decode loop started (320x240 @ 30fps)
Frame 0: source image | decoded image
[Colorized bar patterns displayed side by side using ANSI colors]
Frame 1: source image | decoded image
[Colorized bar patterns displayed side by side using ANSI colors]
Frame 2: source image | decoded image
[Colorized bar patterns displayed side by side using ANSI colors]
...
I (21465) H264_ENC_DEC: H264 process Completed successfully
I (21475) main_task: Returned from app_main()
Note: The exact values shown will depend on your menuconfig settings.
Configuration Issues:
idf.py menuconfig to verify H.264 settings before buildingMemory allocation failures:
Encoding/decoding errors:
Performance Issues:
Visual output issues:
(For any technical queries, please open an issue on GitHub. We will get back to you as soon as possible.)