5

I would like to capture a MJPEG stream using C++. Which options do I have? I have tried OpenCV with FFMPEG support but icvCreateFileCapture_FFMPEG_p is always returning null (after a few seconds of timeout). May I program a HTTP client by myself?

Regards,

Didac Perez Parera
  • 3,734
  • 3
  • 52
  • 87

1 Answers1

5

M-JPEG is easy to capture. You send one HTTP request to the server and read back infinite response in multipart/x-mixed-replace format (Content-Type). Then you split it into frames, which are self-contained JPEG files... Subheaders might or moight not contain additional information such as timestamps.

You might find this relevant and useful as well: How to parse MJPEG HTTP Stream within C++?

Community
  • 1
  • 1
Roman R.
  • 68,205
  • 6
  • 94
  • 158