Monday 12 February 2018

Receive and send mjpg stream

I am doing an application which connects to a server, stores a continuous stream of data (mjpg images) and when a client connects to a url (/stream) it sends the frames to the client. I havent figured out yet the exact implementation. For now I am thinking to create an array of buffers (30-50) each will store one frame (images are small). I think this is a good idea because this way I have always a few frames stored to stream.My main question is can an array be accessed in two places at the same time?Am asking this because when the node server starts it connect to the streaming server and on data event I would like to write the data to the buffer array, but at the same time I would need to read from the same array to stream a frame (not the same index as the writing frame) to the clinet. I dont yet fully understand the node execution cycle and would really like to know if this is possible.

Submitted February 12, 2018 at 10:20AM by jurgonaut

No comments:

Post a Comment