Skip to content

picamera2 based replacement of mjpeg-streamer for octoprint

License

Notifications You must be signed in to change notification settings

vroomfondel/octoprintstuff

Repository files navigation

octoprint adaptions for octoprint running on RPI4 with new picamera2

replacement for https://github.com/jacksonliam/mjpg-streamer.git // mjpg-streamer-experimental used from within octoprint.

Description

After upgrading my raspberry pi 4 from bullseye running octoprint-installation (I think, or even the octoprint-image itself), the camera did not work anymore or to be more precise, the camera could not be used properly anymore with mjpeg-streamer.

Something around camera support changing to be about a new library and mjpeg-streamer failing

I also tried to get something working with rpicam-vid -t 0 --inline --listen -o tcp://0.0.0.0:8888 and so just relaying that to mjpeg_streamer. But that was no fun at all.

Getting Started

Dependencies

hardware / environment

  • libcap2-dev
  • picamera2
  • raspberry-pi 4
  • rapsbian bookworm
  • installed picamera2-libraries /-apps (e.g. by issuing sudo apt -y install rpicam-apps)
  • camera (not necessarily csi connected, but that was my starting point)
    # libcamera-hello --list-cameras
    Available cameras
    -----------------
    0 : ov5647 [2592x1944 10-bit GBRG] (/base/soc/i2c0mux/i2c@1/ov5647@36)
        Modes: 'SGBRG10_CSI2P' : 640x480 [30.00 fps - (65535, 65535)/65535x65535 crop]
                                 1296x972 [30.00 fps - (65535, 65535)/65535x65535 crop]
                                 1920x1080 [30.00 fps - (65535, 65535)/65535x65535 crop]
                                 2592x1944 [30.00 fps - (65535, 65535)/65535x65535 crop]
    

software / environment

Notes

  • maybe the installation on an octoprint-image would also work, but it may be the files have different locations

Installing

assuming, the installation was done as described here: https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspberry-pi-os-debian/2337

Executing program

  • if you have followed the installation from above, it should already be working

Authors

Contributors names and contact info

  • This repo's owner
  • Other people mentioned/credited in the files

Version History

  • -0.42
    • there will be no proper versioning
    • earlier versions used INA219, but INA226 seems to be more accurate and can additionally/also monitor voltage on the high side whilst monitoring current on the low side.

License

This project is licensed under the LGPL where applicable/possible License - see the LICENSE.md file for details. Some files/part of files could be governed by different/other licenses and/or licensors, such as (e.g., but not limited to) MIT | GPL | LGPL; so please also regard/pay attention to comments in regards to that throughout the codebase / files / part of files.

Acknowledgments

Inspiration, code snippets, etc.

  • please see comments in files for that

TODO

  • make width / height configurable (at the moment just edit mjpeg_sever_with_capture.py)
  • framerate-settings perhaps

NOTES

It seems to run smoothly, and the performance seems to be amazing so far - there is not even a hint of flickering left in the frames (which happened quite a lot in the last weeks).

About

picamera2 based replacement of mjpeg-streamer for octoprint

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published