Handling with esp32-cam stream.

pogmem
Posts: 7
Joined: Mon Jan 13, 2020 5:26 pm

Handling with esp32-cam stream.

Postby pogmem » Thu Mar 05, 2020 3:46 pm

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.

chegewara
Posts: 2310
Joined: Wed Jun 14, 2017 9:00 pm

Re: Handling with esp32-cam stream.

Postby chegewara » Thu Mar 05, 2020 4:40 pm

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";

pogmem
Posts: 7
Joined: Mon Jan 13, 2020 5:26 pm

Re: Handling with esp32-cam stream.

Postby pogmem » Thu Mar 05, 2020 5:40 pm

So it means that it is raw jpeg photos hosted one by one on page?

ESP_Sprite
Posts: 9599
Joined: Thu Nov 26, 2015 4:08 am

Re: Handling with esp32-cam stream.

Postby ESP_Sprite » Fri Mar 06, 2020 9:01 am

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.

Who is online

Users browsing this forum: No registered users and 133 guests