{"id":25099548,"url":"https://github.com/pablotoledom/ESP32-video-streaming-USB","last_synced_at":"2025-04-02T04:41:10.761Z","repository":{"id":276154123,"uuid":"928337658","full_name":"pablotoledom/ESP32-video-streaming-USB","owner":"pablotoledom","description":"This project allows video streaming from a PC to an **ST7789** screen using an **ESP32** via UART.","archived":false,"fork":false,"pushed_at":"2025-02-12T00:09:39.000Z","size":7077,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T00:22:34.714Z","etag":null,"topics":["esp-32-videp-receiver","esp32","esp32-video-streaming","esp32-wroom-32"],"latest_commit_sha":null,"homepage":"https://theretrocenter.com/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pablotoledom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-06T13:24:25.000Z","updated_at":"2025-02-11T23:22:07.000Z","dependencies_parsed_at":"2025-02-12T00:22:35.549Z","dependency_job_id":null,"html_url":"https://github.com/pablotoledom/ESP32-video-streaming-USB","commit_stats":null,"previous_names":["pablotoledom/esp32-video-streaming","pablotoledom/esp32-video-streaming-usb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablotoledom%2FESP32-video-streaming-USB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablotoledom%2FESP32-video-streaming-USB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablotoledom%2FESP32-video-streaming-USB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablotoledom%2FESP32-video-streaming-USB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pablotoledom","download_url":"https://codeload.github.com/pablotoledom/ESP32-video-streaming-USB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246758278,"owners_count":20828919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp-32-videp-receiver","esp32","esp32-video-streaming","esp32-wroom-32"],"created_at":"2025-02-07T19:21:51.411Z","updated_at":"2025-04-02T04:41:10.756Z","avatar_url":"https://github.com/pablotoledom.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📽️ ESP32 Video Streaming to ST7789 Screen\n\nThis project allows video streaming from a PC to an **ST7789** screen using an **ESP32** via UART.\n\n[Click aquí­ para ver el archivo léame en español](https://github.com/pablotoledom/ESP32-video-streaming-USB/blob/main/README_ESPANOL.md)\n\n[![IMAGE Esp32 showing DooM video](https://raw.githubusercontent.com/pablotoledom/ESP32-video-streaming-USB/refs/heads/main/image.jpg)](https://www.youtube.com/watch?v=Cykcpi9xnGo)\n\n## 🚀 Features\n- ✅ Real-time video streaming from a PC to the ESP32.\n- ✅ Frame conversion and compression to **JPEG** to optimize transmission.\n- ✅ Decoding on the ESP32 and display on the ST7789 screen.\n- ✅ Automatic color adjustment and image rotation in **Python**.\n- ✅ FPS optimization (~10-15 FPS with stable UART at 921600 baud).\n\n## 📌 Requirements\n### 🔹 **Hardware**\n- 📟 **ST7789 screen** (135x240 pixels, SPI)\n- 🎛️ **ESP32** (preferably with PSRAM for better performance)\n- 🖥️ **PC with Linux or Windows** (to send video)\n- 🔌 **USB cable** for programming and communication with the ESP32\n\n### 🔹 **Software and Libraries**\n#### 📂 **On the ESP32 (Arduino)**\nMake sure to install the following libraries in **Arduino IDE**, If you can't find them in the Arduino library, you can copy them directly to your computer from the **arduino/libraries** directory of this project, copy and paste them into the libraries folder that the Arduino software creates on your PC:\n- [`TFT_eSPI`](https://github.com/Bodmer/TFT_eSPI) → To manage the ST7789 screen\n- [`JPEGDecoder`](https://github.com/Bodmer/JPEGDecoder) → To decode JPEG images\n\n📌 **Required configurations in `TFT_eSPI`**:\n1. Edit `User_Setup.h` and ensure the following settings:\n   ```cpp\n   #define ST7789_DRIVER\n   #define TFT_WIDTH  135\n   #define TFT_HEIGHT 240\n   #define TFT_MISO -1   // Not use for ST7789\n   #define TFT_MOSI 23   // GPIO 23\n   #define TFT_SCLK 18   // GPIO 18\n   #define TFT_CS   5    // GPIO 5\n   #define TFT_DC   2    // GPIO 2\n   #define TFT_RST  4    // GPIO 4\n   #define TFT_BL   32   // If the display need a enable signal, use 3.3V EN pin or a GPIO\n   #define SPI_FREQUENCY  40000000  // Optionally, 80 MHz if supported by the screen\n   #define USE_DMA  // For better performance\n   ```\n\n#### 🐍 **On Python (PC)**\nInstall dependencies using:\n```bash\npip install -r requirements.txt\n```\n📌 **Contents of `requirements.txt`:**\n```\nopencv-python\npyserial\nnumpy\n```\n\n## 🔧 Installation and Usage\n### 1️⃣ **Configure and Upload the Code to ESP32**\n1. **Open Arduino IDE** and upload the `display.ino` code.\n2. **Close the Serial Monitor** in Arduino before running the Python script.\n3. **Connect the ST7789 screen to the ESP32** using SPI:\n\n   | **ESP32** | **ST7789** |\n   |-----------|-----------|\n   | **3.3V**  | **VCC**   |\n   | **GND**   | **GND**   |\n   | **18**    | **SCK**   |\n   | **19**    | **MOSI**  |\n   | **5**     | **DC**    |\n   | **23**    | **CS**    |\n   | **4**     | **RST**   |\n\n### 2️⃣ **Run the Code on the PC (Python)**\n1. **Open the terminal** and execute:\n   ```bash\n   python3 send.py\n   ```\n2. The video will start streaming to the ST7789 screen via ESP32.\n\n## 🛠️ Troubleshooting\n### ❌ **Distorted colors**\n✔️ Solution: Ensure that `tft.setSwapBytes(true);` is enabled on the ESP32.\n\n### ❌ **Rotated image**\n✔️ Solution: Modify in Python:\n   ```python\n   frame = cv2.rotate(frame, cv2.ROTATE_90_CLOCKWISE)\n   ```\n\n### ❌ **The image does not occupy the full screen**\n✔️ Solution: Ensure that the frame size in Python is `135x240`:\n   ```python\n   frame = cv2.resize(frame, (135, 240))\n   ```\n\n## 📜 License\nThis project is licensed under **MIT**, allowing free use and modifications.\n\nDeveloped by Pablo Toledo\n---\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablotoledom%2FESP32-video-streaming-USB","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpablotoledom%2FESP32-video-streaming-USB","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablotoledom%2FESP32-video-streaming-USB/lists"}