Restart API streamer from inside the API?

Is there a possibility to restart the Octoprint WebAPI cam streamer from inside the API during one session?

if the stream breaks because e.g. camera is reinitialized, inside Octoprint WebAPI the stream freeze.
After closing the browser session and reopen a new one everything is fine again and camera pictures are shown well again.
Would be nice to have a possibitity to restart the internal streamer without close and reopen the Octoprint WebAPI.

No, there is not. The webcam stream is not actually part of OctoPrint; OctoPrint only uses it. Typically an application called mjpg-streamer is used (and comes preinstalled with OctoPi). There is no common API to control that application, but you could make a shell script that does sudo service mjpg-streamer restart and create a button for that script.

sorry, there is a misunderstanding.

I mean not how to restart the Raspi Linux Cam support. That works well.
I mean the Octoprint internal consumer of this stream. The part that is reading and rendering the data received by cam URL.
The reading routine seems not very robust. Maybe the reader, the Octoprint internal consumer, needs some help to reinitialize his part of the cam connection.
I'm grateful to every hint where it is coded and which technique is used by Octoprint to show data from the cam because this could prevent me from digging lots of hours into up to now unknown sources.

OctoPrint does not "consume" the stream. It just pushes the HTML <img> tag to the browser. The browser renders the stream. If you want to restart that, reloading the page should do.

would help to know where the part of source is (directory, file, maybe line) where

is done

It is "just" an HTML page that gets served. The HTML is created from this template:

You might also be interested in this:

yes, thanks very much :slight_smile: