Code Monkey home page Code Monkey logo

esp32_camera_webstream's Introduction

headline

esp32_camera_webstream

Bringing the ESP32 camera video stream to the web!

The Arduino ESP32-Camera test sketch only lets you use the stream on your local network. To get the stream to the web, you need a bit more...

This collection of scripts consists of:

  • Arduino code for ESP32 camera module (AI Thinker CAM) websocket_camera_stream.ino
  • Python code to receive the images via websockets with receive_stream.py
  • Python code to push the most recent image to a website with send_image_stream.py

Why is this cool?

I havent found a working repository that streams ESP32 camera images in real time to a web backend. This sovles this issue.

How to run?

  1. Open the ESP32 code in your Arduino IDE, install all missing libraries, change the ssid, password and websockets_server_host. Upload the code to you ESP32 AI Thinker Cam board. Please test the Arduino camera example before you test this code!

  2. Install the missing python requirements using pip: pip install pillow websockets flask asyncio

  3. Run python receive_stream.py You should get a constant stream of numbers (sizes of images). The image.jpg in the directory is always the latest received image.

  4. Open a second terminal and run python send_image_stream.py You should get a response by flask with an IP and port to enter in your browser.

Now enjoy your fresh live stream! ๐Ÿ“บ

Known Issues

Browsers don't like broken images.

This is solved using the placeholder.jpg. It just replaces the image, if the backend receives a broken frame to prevent the browser from freezing the stream.

You have to have the right board.

There are many ESP32 Camera modules. The defined pins in websocket_camera_stream.ino only work with the AI Thinker Cam. Change this, if you have a different board. The only tested camera is currently the OV2640.

Video!

LINK TO VIDEO

esp32_camera_webstream's People

Contributors

neumi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.