Archived Forum Post

Index of archived forum posts

Question:

How can I handle a continuous HTTP stream (multipart)?

Nov 12 '15 at 09:36

I'm trying to use Chilkat C API to handle a MJPEG stream from an web-server (Content-Type: multipart/mixed). The stream of frames is continuous, so doing a CkHttp_SynchronousRequest or CkHttp_QuickGetObj will block forever. Is there a way to register a callback function that would periodically be called when a chunk of data is received from the server so that I can process it?

What I'm really interested in is processing the MJPEG video stream and separating the individual JPEG frames from the video stream as they come along..

Is there any way of doing that?


Accepted Answer

Unfortunately, the Chilkat HTTP API was not designed with this situation in mind, and it's not a good fit for it.


Answer

This is really really bad.

You should redesign and offer all data in streaming form, including charset conversion etc. I run into this problem when i realized that my application will suck if the user tries to download large files.

Its also no option to download into a file first when you want to do some processing on it, especially on mobile devices with small meory but still large data files.

For version 10 please continue your background thread design and offer streaming.