Page 1 of 1

Handling with esp32-cam stream.

Posted: Thu Mar 05, 2020 3:46 pm
by pogmem
Hi!

Recently I wrote code, that streams video from OV2640 to esp32 webserver. I have done it like in example on github:

https://github.com/espressif/esp32-came ... /README.md. JPEG HTTP STREAM.

Now I'm trying to write app, that connects to esp32 and view this stream.
My question is what kind of format or media type is this stream? Is it just photos hosted one by one on blank website? Or is it some kind of format? I'm not into media formats at all, so I can't see any answer in code itself.

Re: Handling with esp32-cam stream.

Posted: Thu Mar 05, 2020 4:40 pm
by chegewara
https://github.com/espressif/esp32-came ... ttp-stream

static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n";

Re: Handling with esp32-cam stream.

Posted: Thu Mar 05, 2020 5:40 pm
by pogmem
So it means that it is raw jpeg photos hosted one by one on page?

Re: Handling with esp32-cam stream.

Posted: Fri Mar 06, 2020 9:01 am
by ESP_Sprite
Not one by one per se... the trick is in the multipart/x-mixed-replace header. This allows the client to keep the connection open and replace the JPEG it got earlier by a newer picture when it becomes available. Some explanation.