MJPEG stream stops after 30 minutes. Timeout? Use Web API to reload page and stream

Hi!
I am receiving a error message in my web browser console after streaming mjpeg for 30 minutes. It says Error inclomplete chunked encoding. And then the streams stop. So every 30 minutes I have to manually refresh my page.

This happens on different platforms in different browsers. What causes this? And what can I do to avoid it?
Is this a timeout issue? Is there a call I can do to keep it live?

Best regards
Rune Aspvik

Hi Rune!
Is it when using embedded code or when using the web client?
-Henrik

This is when embedding code.

Forgot, is the camera in motion detection or recording or in any way active? If not NCS will set that camera to idle to save energy and cpu load.

Not motion detection. But it is recording. And the cameras output streams to other services as well. So that is not the case I’m afraid.

I have been reading this several times, but just now I really take in what you write. “And the cameras output streams to other services as well”. That will not work. These cameras can only deliver a stream to one recipient since they are single stream. If you have several services using the same URL to the camera the services compete which one will get the stream. I suggest that you turn off all other streams than this one and see what happens. When you manually refresh you send a command that will also reinitialize the stream to the camera and get priority. You can setup a Rule which sends an email when the connection is lost to the camera.
-Henrik

Yes there is a size limit in the output mjpeg size. It’s about 2GB or something like that. After which a new session / mjpeg must be initiated.

Okey, thank you! I will have a look at that, however, since I have 5 different streams, all stopping at the same time it might not be the case.

Hi!
What I mean by “The cameras output streams to other services” is the camera it self output different streams (not the NCS stream), on different URLs. As in live1.sdp, live2.sdp and so on.

When I say I have 5 different streams all stopping at the same time, that is from 5 different cameras.

So exactly at 30 minutes after I connect to the mjpeg streams, all five stop at once. But the cameras still output image on the other URL’s, including NCS, because in the NCS Server GUI the image is still live.

I was hoping maybe there is a http request I can send to the server every 30 minutes to keep the connection alive?

Hi,
There is a limit for the stream. Only way is to reinitiate the stream to get it running again. Check out Web API Netcam Studio - Network Camera Surveillance Software that might solve the problem.

1 Like

Thank you! I worked it out like you said. Reloading the streams every 25th minute.

1 Like

Excellent! Thanks for the feedback. That will certainly help others.
-Henrik