Git Product home page Git Product logo

esp32-cam-mjpeg-multiclient's Introduction

ESP32 MJPEG Multiclient Streaming Server

This is a simple MJPEG streaming webserver implemented for AI-Thinker ESP32-CAM or ESP-EYE modules.

This is tested to work with VLC and Blynk video widget.

This version uses FreeRTOS tasks to enable streaming to up to 10 connected clients

Inspired by and based on this Instructable: $9 RTSP Video Streamer Using the ESP32-CAM Board

Full story: https://www.hackster.io/anatoli-arkhipenko/multi-client-mjpeg-streaming-from-esp32-47768f


Other repositories that may be of interest
ESP32 MJPEG streaming server servicing a single client:

https://github.com/arkhipenko/esp32-cam-mjpeg

ESP32 MJPEG streaming server servicing multiple clients (FreeRTOS based):

https://github.com/arkhipenko/esp32-cam-mjpeg-multiclient

ESP32 MJPEG streaming server servicing multiple clients (FreeRTOS based) with the latest camera drivers from espressif.

https://github.com/arkhipenko/esp32-mjpeg-multiclient-espcam-drivers

Cooperative multitasking library:

https://github.com/arkhipenko/TaskScheduler

esp32-cam-mjpeg-multiclient's People

Contributors

arkhipenko avatar kdsoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-cam-mjpeg-multiclient's Issues

Configuration screen request

Would it be possible to get a configuration screen like the basic esp32cam examples? This would make it easier to change the settings on the fly and be able to trade off between multi client responsiveness and image quality etc.

Uploading error

I am new to the ESP-32 Cam so please bear with me.
I am trying to upload the Multiclient code to my ESP-32 Cam and consistently error saying

'server' was not declared in this scope
Not used: C:\Program Files (x86)/Arduino\libraries\WiFi
exit status 1
'server' was not declared in this scope

Thanks

Race hazard accessing camera between motion/static stream threads

There is, I think, a race hazard if you have clients using the MPJEG stream and static picture URL at the same time in that that that it is possible for both threads to be accessing the camera object at the same time. This can then result in bad things happening with regard to the memory buffer pointer returned from the camera class. I can very quickly crash the board under these conditions.

I think you need a semaphore around the camera object accesses - the attached patch seems to work for me.

Cheers,

Jon.

cam_race_hazard.diff.gz

Partial image at VGA frame size

Hi,
80% of the time, I am connecting only from a single client, still, the camera is only loading partial image and at a relatively slow rate ~7fps.
I did notice that the performance reduction is related to jpg/mjpg compression. For example: I see a complete image when the picture is "static", and partial picture when the picture is changing (wind blowing leafs). partial image
I am using 4 esp32 cameras as a motion detection / surveillance system and for now, my workaround to the above problem is to set inspection windows away from the bottom of the frame (where the image is not loading properly), but I am wondering what do you recommend for improving performance (lower frame rate ? smaller frame size ? Thanks

Problem getting static jpg image while streaming mjpg

Hi, there's an issue capturing jpg image while another client is streaming mjpg, most of the time the jpg image is garbled:
https://imgur.com/a/KVj6g8p
and it often stops mjpg streaming on the other client altogether with an error in the log (have to reset the esp32 to make it work again)
[E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!

Video streaming with LAN network

Hi @arkhipenko , firstly, thanks for your project. It was a really good and useful project for me. And I want to stream with LAN network, Can you help me, pls???, I set 2 modes (WLAN and AP mode) but LAN mode I can't set.

features

hi i want use esp eye as realtime face recognization can i use this ?

if yes how to train bulk images in this ? is it possible to train the model in esp eye or we need train the model in server ?

we need some help if u give it is very helpful for me

Does not work on AI Thinker ESP32-cam

I am getting this in the serial output and the camera restarts.

08:27:24.642 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
08:27:24.642 -> configsip: 0, SPIWP:0xee
08:27:24.642 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
08:27:24.642 -> mode:DIO, clock div:1
08:27:24.689 -> load:0x3fff0030,len:1344
08:27:24.689 -> load:0x40078000,len:13864
08:27:24.689 -> load:0x40080400,len:3608
08:27:24.689 -> entry 0x400805f0
08:27:26.417 -> E (1502) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)
08:27:26.417 -> Error initializing the camera

Camera is NOT faulty, just tested a cam web server and that code works

Brownout detector was triggered

Hi I'm using an AI-Thinker board and was able to flash your code.

I activated

//#define CAMERA_MODEL_AI_THINKER

But somehow I get a Brownout detector was triggered reboot-loop at OV2640.cpp l184:

esp_err_t err = esp_camera_init(&_cam_config);

It seems that the cam can't be initialized with the given config for AI-Thinker.
(I also tried the other configs and they also don't work)

Here the board for reference:
https://www.amazon.de/gp/product/B08MZV1TT9/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Does not work on AI Thinker ESP32-cam

I am getting this in the serial output and the camera restarts.

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13864
load:0x40080400,len:3608
entry 0x400805f0
E (1476) gpio: gpio_set_level(226): GPIO output gpio_num error
E (1486) gpio: gpio_set_level(226): GPIO output gpio_num error
E (1508) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)
Error initializing the camera
ets Jun 8 2016 00:22:57

Camera is NOT faulty, just tested a cam web server and that code works

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.