ballaswag / guppyflo

GuppyFLO is a self-hosted service that enables local/remote management of multiple Klipper printers using Moonraker
GNU Affero General Public License v3.0
24 stars 1 forks source link

Can't set up mjpeg camera #1

Open spitfire opened 3 months ago

spitfire commented 3 months ago

I can't set up mjpeg camera (the Creality K1 camera), the only option I'm seeing is go2rtc, and AFAIK it doesn't support webrtc. Am I missing something?

ballaswag commented 3 months ago

With 0.0.4, I added mjpeg-streamer. It works but the styling still needs work. When adding a printer you should be able to add a camera and select mjpeg-streamer. The path is the same you would use for fluidd and mainsail, the IP is where the camera service is running, I think for K1/KE people are scripted to use port 4408/4409 fluidd/mainsail due to the ngnix setup.

Give that a try and see if it works for you. I'm working on automating or at least make these camera configurations simpler.

WayneManion commented 3 months ago

I may be the only person in the world that does it this way, but here goes. I have several printers. I have a Frigate instance that I use for some exterior surveillance cameras. I use PoE IP cameras on my printers.

I then use the moonraker.conf file to set up the cameras (webrtc-go2rtc). With this setup most Fluidd and Mainsail clients (exception: the Device tab in OrcaSlicer) will automatically pick up on the camera. It does not have to be set up on a per-client basis. I use several machines as clients, so setting up several printers times several clients would be a pain.

Here is an example moonraker.conf camera setup:

[webcam darrylRaker]
location: printer
enabled: True
service: webrtc-go2rtc # hlsstream
target_fps: 15
target_fps_idle: 5
stream_url: http://192.168.1.32:1984/webrtc.html?src=darryl&media=video+audio
snapshot_url: http://192.168.1.32:1984/api/frame.jpeg?src=darryl
flip_horizontal: False
flip_vertical: False
rotation: 0
aspect_ratio: 16:9

As it stands guppyflo does not pick up on the camera defined in moonraker.conf. The webrtc-go2rtc stream does not work when manually configured either.

ballaswag commented 3 months ago

@WayneManion nice explanation. Currently GuppyFLO and moonraker camera settings are separate. I have plan to merge them. As you pointed out, when a camera is setup via moonraker, clients like fluidd/mainsail will pick them up automatically. The plan is to do the same for GuppyFLO.

The remaining challenges are the following:

  1. Fluidd/mainsail has implemented the client part for various camera service. GuppyFLO only has mjpeg streamer and go2rtc webrtc for now. The rest needs to be implemented.
  2. GuppyFLO uses 2 custom forks of fluidd/mainsail with small changes to enable path based router. This is to offer a single hosted instance of these client for all your backend printers. The path base router part still needs to be done for the cameras for these clients. As of now, I think if the user configures the cameras with a fully qualify path in moonraker, then it’s just setting up the reverse proxy route. If they are configured without the host/port, then GuppyFLO needs to discover their port, e.g. host is assumed to be same as printer in these cases.
  3. Why not auto discover all these cameras (GuppyFLO can do this now for mjpeg streamer), at least for the ones plugged into the printer. And add them to moonraker automatically, so now any client that understand moonraker cameras will get them out of the box.

Will work through above to make this thing magical.