fieldOfView / Cura-OctoPrintPlugin

Cura plugin which enables printing directly to OctoPrint and monitoring the process
GNU Affero General Public License v3.0
495 stars 74 forks source link

Enhancement Request: Support for HLS streams in Monitor #286

Open marklieberman opened 2 years ago

marklieberman commented 2 years ago

OctoPrint itself natively supports HLS streams as a video source.

Octopi 0.18 is now bundling an experimental HLS streamer.

It can be enabled by editing /boot/octopi.txt and setting camera_streamer=hls. After rebooting, the stream is available at /hls/stream.m3u8.

See also: https://community.octoprint.org/t/experimental-hls-support/20336/72

It is great because I can stream high resolution images from the raspicam at a fraction of the bandwidth of mjpeg.

Unfortunately, the stream is not viewable in Cura.

fieldOfView commented 2 years ago

I would love to support this, but unfortunately Cura does not come with the ability to display videos. Even displaying the current mjpeg stream is a hack; the stream is interpreted as several consecutive still jpeg images, and fed to the window one at a time.

marklieberman commented 2 years ago

I suspected as much from looking at the plugin source, although I have almost no experience with Python. My idea was to use something like python-vlc to extract frames from the HLS stream and convert them into whatever format is most suitable for display. Documentation is hard to come by, but I found some encouraging code here.

fieldOfView commented 2 years ago

The problem with python-vlc is that it would rely on an externally installed vlc. I would probably need to keep the current implementation as a fallback, and add instructions to install vlc separately.

Arketsu commented 1 year ago

@fieldOfView I am not sure is this is completely related or if I should create a brand new ticket but is it possible to add m3u8 stream support to octoprint plugin? Currently I am running wyze_bridge to get the stream and it works great in the octoprint webpage but no feed in cura.