Coder Social home page Coder Social logo

Reduce resource usage of spyglass about spyglass HOT 3 CLOSED

bodak avatar bodak commented on August 20, 2024
Reduce resource usage of spyglass

from spyglass.

Comments (3)

roamingthings avatar roamingthings commented on August 20, 2024

It's unusual to have so many processes. How many streams do you have active at the same time?

from spyglass.

bodak avatar bodak commented on August 20, 2024

A single stream (through Mainsail web UI or mobileraker). There is no timelapse or any other monitoring running.

from spyglass.

mryel00 avatar mryel00 commented on August 20, 2024

We can't do anything about that. We are using the picamera2 module and that is spawning that many processes if I'm not completely wrong. There is also another project that can use the module v3: camera-streamer from ayufan but it's need manual compiling and doesn't give much benefits over spyglass for the module v3. In my testings it's generating the same amount of cpu load. So it seems more like an issue corresponding to the hardware of the pi.
The best and simplest solution for now would be to reduce your fps this should lower the cpu usage.

I can understand that you want some kind of automatic throtteling for the stream but that would be a bit harder to implement as I'm not completely sure how to change the fps while the camera is running. The processes are constantly pulling new frames in the background from the camera and decode them. This is generating cpu usage in the background even if you don't have any stream open. At the moment there isn't anything we can do about that sadly except for lowering the fps in your settings.
The only solution I can think of now for the background cpu usage could be something like starting and stopping the camera whenever someone connects or disconnects resulting in a delay before you can see the stream in the webui or mobileraker.

from spyglass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.