Skip to content

Commit 13e0206

Browse files
authored
Move _STREAM_BOUNDARY before _STREAM_PART (#3720)
The boundary delimiter (_STREAM_BOUNDARY) needs to be send before the body part (_STREAM_PART) too follow RFC2046. This caused ffplay/ffmpeg to fail to open the MJPEG stream.
1 parent 9b75c65 commit 13e0206

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -403,16 +403,16 @@ static esp_err_t stream_handler(httpd_req_t *req){
403403
}
404404
}
405405
}
406+
if(res == ESP_OK){
407+
res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));
408+
}
406409
if(res == ESP_OK){
407410
size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);
408411
res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);
409412
}
410413
if(res == ESP_OK){
411414
res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);
412415
}
413-
if(res == ESP_OK){
414-
res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));
415-
}
416416
if(fb){
417417
esp_camera_fb_return(fb);
418418
fb = NULL;

0 commit comments

Comments
 (0)