Hello Everyone,
I'm Taylor aka The-EG on Github and Discord, etc.
After seeing multiple questions on Discord about changing camera settings (brightness, exposure speed, etc) and not being particularly satisfied with using a shell script myself, I decided to write a plugin that will allow a user to change camera settings interactively.
This plugin uses the v42l-ctl
program to change the camera settings, which means it should work on any Linux environment where the camera is connected to the same device as the OctoPrint server, and with any streamer (mjpg-streamer, uStreamer, etc.) without requiring additional configuration.
Note: this doesn't work for settings like resolution and fps. You'd still need to configure your streamer for that.
While the plugin works for my 2 cameras and suits my needs, I'd like to eventually register this plugin into the official repository because it may be helpful for other users. Before I can do that, though, I need to verify it will work with more cameras at the very least, and any additional feedback would welcome too.
That's where everyone here comes in . If you are comfortable testing my plugin I'd appreciate any feedback you may have, verification that it works with different setups (stock OctoPi, custom rpi, other Linux, etc) and most importantly, help me build the list of various camera controls that different cameras have.
I think I've gotten quite a few between my two cameras, but I'm sure some cameras will have some controls I haven't seen yet.
If you'd like to try it out, you can install it by using the following URL in OctoPrint's Plugin Manager:
https://github.com/The-EG/OctoPrint-CameraSettings/archive/main.zip
After install and restart, you should have a 'Camera Settings' tab and some settings available in the plugin settings. If the camera list is empty, switch to another tab and switch back.
After installation, open up the plugin settings to access the camera settings.
To have settings applied at startup, create a preset, enable the option for load preset at startup and select the appropriate preset.
If you get a warning that your camera has an unimplemented control, please let me know. The easiest would be to click 'Copy to Clipboard', click the link in the warning to create a new issue, paste the control info where the issue asks for it and specify your camera make and model.
I have an issue for feedback and general questions: Pre-release feedback, or you can just reply here or find me on the OctoPrint Discord.
Some issues I'm still working through and other thoughts:
- Is
v4l2-ctl
available by default on most Linux systems, most notably OctoPi? If not this should be resolved by installing it (sudo apt install v4l2-utils
), but I'd be interested how often this is the case - The layout isn't ideal, especially with plugins that display the tabs full width...I'm tinkering with it
- The camera preview is the camera that is configured in OctoPrint. If you have multiple cameras, you can use the plugin to set the settings on all of them individually, and even save presets, but the preview will always show the same camera, and only one preset will be applied on startup if enabled.
- Not all cameras expose devices in
/dev/v4l/by-id/*
The raspicam is a good example. So this plugin is using the/dev/videoN
device names for now, including the presets.
If you try it out, please let me know what you think!