esp32-mjpeg-multiclient-espcam-drivers icon indicating copy to clipboard operation
esp32-mjpeg-multiclient-espcam-drivers copied to clipboard

Jpg page load finishes late

Open s0170071 opened this issue 4 years ago • 3 comments

When loading the JPG, the image appears instantly in the browser but the network connection remains open for about 2 seconds.

grafik

s0170071 avatar Sep 16 '20 08:09 s0170071

I am not doing anything special with the network connection as you can see from the code. Not sure what you are asking me to do about this?

arkhipenko avatar Sep 16 '20 12:09 arkhipenko

I was not paying much attention to the JPG aspect of it - the focus was on the video feed obviously. Would adding client.stop() after https://github.com/arkhipenko/esp32-mjpeg-multiclient-espcam-drivers/blob/master/esp32-cam/esp32-cam.ino#L368 help?

arkhipenko avatar Sep 16 '20 12:09 arkhipenko

The issue is that the image is already displayed in the browser but it takes another two seconds until it stops loading. It seems the browser is expecting something, i.e. a \r\n.
I already tried Client.stop but that didn't help. The streaming (also jpg) is done asynchronously, that may be why.

The long loading times cause issues with my home automation. It times out.

s0170071 avatar Sep 16 '20 12:09 s0170071