aquaticus / esp32_composite_video_lib

ESP32 library that generates composite video signal for PAL, SECAM and NTSC.
GNU General Public License v3.0
184 stars 7 forks source link

Custom Images #10

Open kgingerale opened 5 months ago

kgingerale commented 5 months ago

Hi,

I was actually looking into doing this and found your repo. I was wondering if you could provide some insight into how I can actually feed in my own image and have it displayed? I wasn't wanting to do the LVGL portion, just feed in a general image.

I attempted to try it already, but when I changed the frame buffer address to point to the image array (pixel values of the image in a 1D array) and changed the frame buffer size, the only thing I've managed to do is get a black screen.

I was wondering if you had some pointers or anything? I've still trying to get my head wrapped around where everything is and how it's actually creating the image. I've ordered a debugger to set through the code to see if that helps we understand what's happening.

Thanks!

aquaticus commented 5 months ago

Hi,

look at function (or its NTSC equivalent): https://github.com/aquaticus/esp32_composite_video_lib/blob/a1f5c7669aa274f148157947cdb7c94459e23777/diag.c#L135 The most interesting part is in: https://github.com/aquaticus/esp32_composite_video_lib/blob/a1f5c7669aa274f148157947cdb7c94459e23777/diag.c#L42

You could also compile demo app without LVGL support (see menuconfig options).

kgingerale commented 5 months ago

I've been able to get the demos working, but when I try to do a custom image I only get a black screen. I've converted the image to the right dimensions to match the video_graphics function, and converted it to grayscale, but I still only get a black image. I was trying to mimic what the VIDEO_TEST_WHITE does, by changing the buffer to point at my array, but it's not working as expected.

aquaticus commented 5 months ago

Just get demo app and change test image (you can use GIMP to generate source code for the image). If you created you own app, make sure compiler optimization level is set to performance -O2.