Is it possible to activate a mjpeg-streamer plugin inside octoprint?
What im thinking of, is to create an overlay inside the camera stream like this example.
Does there exist any example plugins that use that feature?
Is it in general possible to hoock a plugin in to mjpeg-streamer within a octoprint-plugin?
OctoPrint doesn't deal with webcam streaming, it doesn't have control over mjpg streamer which is a separate piece of software. It just embeds/reads the stream provided by it.
So it would be difficult to make that an OctoPrint plugin really, there's no API to make use of, I think these plugins have to be added on to the command to start mjpg streamer, so you would have to edit the webcam service files I think.
As @Charlie_Powell stated, this is indeed not a use case OctoPrint handles.
It would be indeed far easier to change the service to use the input stream you're speaking of. There are at least two ways that I can think of to achieve what you want.
First one, won't take into account any modification you make to the octopi.txt or octopi.conf.d/*.txt files, would be to create a new mjpg-streamer.service inside /etc/systemd/system/ which could look like that:
replacing the uvc and raspicam by opencv. You would then have to alter the
camera_usb_options=
camera_raspi_options=
lines with the correct options. This would present the advantage of keeping the same configuration files you're used to. Be aware, as stated in the mjpg-streamer documentation, that the opencv input is more CPU consumming. Your Rpi might not be able to sustain multiple cameras, or the maximum resolution depending on your setup.