Accessing the Raspberry Pi Camera Openflexure Connect video stream

How would I go about accessing this video stream to send to a streaming service such as YouTube (or maybe transfer over MQTT). From what I understand only one app can access the Raspberry Pi Camera at a time, so I think this would be the only way I could go about getting a stream. I could also try to repeatedly capture images, but that wont work when there’s a scan function running. Any ideas?

1 Like

The Openflexure sends the video stream as a web stream that you can access on another computer on the local network. This is what you see in the live view in the Openflexure webapp GUI. There is also an http request that will give you the stream only without the rest of the app

There are security issues with opening up the Openflexure server to http requests from outside the local network, but it feels as though it should be possible for a second local computer to request the web stream from the microscope and forward it where you want? I have no idea whether that is actually possible or sensible.

There are I think also systems to stream whatever is being sent to a display, which would need access to the display output rather than the camera input and could again be on another computer on the local network.

The HTTP stream is an MJPEG stream - it’s not very efficient, but if you use something to transcode it, you ought to be able to stream it quite nicely. I’d have thought the easiest way would be to use something on a different computer (e.g. OBS Studio) to access the MJPEG stream (or a window showing it) as a “video source” and then stream it to wherever you want.

I think MQTT is generally intended for quite short messages, most examples of video/image transfer I’ve seen use MQTT to notify that an image is ready, then HTTP to actually download it. In principle it wouldn’t be too hard to write Python code that does something with each incoming frame of the MJPEG stream - there is some code in the python client module that does that (openflexure-microscope-client).