Playing movie with esp32

Hello All,

I’m trying to play video (or animation with sound) with ESP32 and 240 x 240 display and SD card.
1- is it possible to play a smooth video with ESP332? I saw some examples that use DMA to do it but all of them require to convert the video to (.raw). I like to have something that the user can play MP4 or something like that from an SD card.
2- In all the examples I saw, the SD card and the SPI display have a separate SPI(SPIH and SPIV). I’m wondering if there is any example that displays and SD card that can share the SPI.

Thank you

Have a look at this article:

It goes into quite some details and has a good analysis of what is possible and what isn’t. In particular, it finds that the ESP32 isn’t powerful enough to decode MP4 but that MJPEG is doable.

The problem with sharing the SPI bus it twofold:

  • Both reading from the SD card and writing to the display takes quite some time. You would need to analyze whether a single SPI bus has sufficient bandwidth for both. And don’t forget that it will result in additional wait times for these two tasks. So it can also reduce the available time for data processing.

  • Most likely, at least two tasks are needed to leverage the two cores in the ESP32. If the SPI bus is shared, some sort of synchronization is needed in accessing the bus. That’s doable and is built into the ESP-IDF framework but not in the Arduino framework. And is unlikely to be supported by the most common libraries. So this will be quite some extra effort.

Why can’t you use two SPI buses? Sharing a single one will add quite some complexity.

Thank you for the reply and for sharing the article.
The reason I want to have a share SPI is that I used all of my I/O for something else.
Maybe I need to use the I/O expander and use 2 SPI for this, but before doing so, I want to make sure that sharing SPI is not an option.
Thank you