I'm using ther ESP32-Cam and have started to play around with the ESP32-CAM Example 2 : Live Video Streaming Server application which works great.
I'm interested in starting and stopping the stream not by command from the client (via Start Stream/Stop Stream button in browser) but I want to control the Start/Stop option from the ESP32 directly.
I could just call WiFi.disconnect(false, false); to stop the stream but it's not great (if there was other data transmission going on as well) and a call to WiFi.reconnect(); won't automatically resume the stream either. How can this be done?
Append the following code to the end of app_httpd.cpp:
And add this at the top of CameraWebServer.ino:
Then you could stop the HTTP server by calling
stopCameraServer()