It’s been possible to use the I2S for video output on ESP8266 and ESP32 chips for years, but aquaticus’ ESP32 Composite Video Library is may simplify the task of outputting PAL, NTSC, or SECAM video signals from any Tensilica-based ESP32 platforms.
The library does not require any external hardware, and you can just connect an RCA connector to GPIO25 (I2S data) and GND, plus integration with the LVGL library makes it easy to create graphical user interfaces as showcased with the captures below.
The library supports grayscale video output (no color at this stage), multiple resolutions from 384×288 to 720×288 at up to 25 or 30 Hz, six different pixel clocks for PAL/SECAM and NTSC, as well as six framebuffer formats with namely RGB565, RGB332, Grey 8 bits/pixel, Grey 4 bits/pixel, Monochrome 1 bit/pixel, and LVGL monochrome 1 byte/pixel.
You’ll find the source code for the ESP32 Video Composite Library, released under a GPL v3 license, in Github, together with the instructions to get started, and the API documentation. The “hello world” sample displays a Philips PM5544 pattern in PAL 384×288 resolution or NTSC 320×240 resolution:
1 2 3 4 5 6 |
#include "video.h" void app_main(void) { video_test_pal(VIDEO_TEST_PM5544); } |
The example above is for PAL/SECAM, simply use the function video_test_ntsc for NTSC output instead.
It requires the ESP32-IDF framework (version 4.4 used for testing) with -O2
CFLAGS, and optionally the LVGL graphics library (version 8.3 tested). The library appears to have been tested on one of the Wemos D1 mini board. Some of the applications listed for the library include infotainment systems, emulators,8-bit style game consoles, and video diagnostic.
Via Hackaday
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
Would be handy to have this integrated into esphome
Its a nice hack, but you don’t want to use esp for video in my opinion.