Camera Settings Plugin: Seeking Feedback and Testing

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 :slight_smile:. 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!

2 Likes

Nevermind I'm dumb. Granted it's not so obvious settings are in a tab outside of the actual settings UI. :1st_place_medal:

Yeah, I also thought it odd that all the settings were in the tab. I think from a usability perspective I'd prefer all of it in settings rather than the tab.

Good point on having it in the settings instead.

I've been going back and forth on what makes the most sense from that perspective. It's easy to move so I'll have to try that out.

I had the same debate with the EEPROM Editor plugin. I decided, since I needed a separate 'save' button (among other things) that it did not make sense to put it in the settings dialog, and that the settings dialog was for the plugin's settings. Depends how much 'plugin' configuration you think you need.

Well, I don't hate it :smiley:

This is exactly what was causing me to question which location is most appropriate. In my mind there are camera settings and then there are plugin settings and they are different! But, I think in this case the average user won't realize that (or care), so I've just stuck them at the end of the 'other' settings:

In the case of EEPROM Editor I think that makes sense to keep in the tab list as it's specific to the printer and directly involving comm with it. Kind of like the control tab.

For this it kind of falls under the host side of things.

2 Likes

Ok, everything has now moved to the plugin settings page, the tab is completely gone.

If you've already installed it and want to take a look at the new layout/settings, just reinstall from the same URL: https://github.com/The-EG/OctoPrint-CameraSettings/archive/main.zip

Thanks for the feedback!

2 Likes

Thanks EG. I think this is better, because most people are going to set it and forget it I think, and I personally like to keep the tab real estate to a minimum.

2 things

  1. if you have multicam it only works with one cam
  2. suggestion to add ptz controls

THANX
MITCH
If I had a son he would be a son of a Mitch

Actually, you can control multiple cameras, but the preview only shows the camera that is configured in the OctoPrint settings. If you select the appropriate camera in the 'camera' drop down, the settings should still function even if it's not the camera being shown in the preview.

Presets also save which camera they apply to, so you can also save/load presets for multiple cameras. Currently, only 1 preset can be set to load on startup, though.

Allowing a user to specify the preview URL, etc for each camera and specifying multiple startup presets may be something I consider for the future, depending on interest.

If your camera supports them natively through v4l2, they'll be there. This plugin looks at the output of v4l2-ctl --list-ctrls-menus, so if pan, tilt, zoom, etc aren't listed there then the plugin can't control them.

If your camera does support those settings, and it's named differently from what the settings that are currently recognized you should get a warning saying as much, and directing you to open an issue requesting they be implemented.
If they are simply not showing up without the warning (but other controls are), then your camera did not report it had the capability. Unfortunately, there's not much I can do about that.

Hello I am using two same cameras. Is there a way to distinguish which one I am setting?
Thanks a lot.
Vlada

Hi there, that is an interesting problem.

In general, no, I don't really have a good way to help distinguish because all I get back from the cameras are the name, which is shown, the video device (ie. /dev/video0) and it's capabilities. In this case, the only thing that would distinguish one from the other is the video device and that's likely not going to be helpful to you either.

Do you also use the 'MultiCam' plugin? While not a direct solution, the latest release candidate of Camera Settings has an option to integrate with the MultiCam plugin, allowing you to 'map' the cameras to a MultiCam profile. This will cause the preview shown to change based on what camera is chosen.

It would take some trial and error to figure out which camera is which is which, but it could be helpful once you've gotten it mapped.

If you'd like to try the release candidate, go to Software Update in the OctoPrint Settings, find the Camera Settings plugin and select 'Release Candidate' under Release Channel and you should then be prompted to update to version 0.2.0rc2.

Yes I do use Multicam plugin. I have switched to RC to see OctoPrint-MultiCam Integration option.
And so far it that after checking "Integration" makes upper choice of cam no change but through the lower one I can toggle both cams plus I see "names" from Multicam. It would be nice to tie these two options somehow together.
Thanks.
Vlada

image

I'll look at optionally putting the multicam name in the top dropdown instead if the integration is enabled. Not sure how involved that will be or not.

Can the focus be changed to increments of 1 (currently increments of 5) Cheers.

Unfortunately I didn't arbitrarily pick the limits and step values for the sliders. If it's using a step of 5 that's because your camera reported that value.

I can look into adding some sort of override, but it's likely that the camera will ignore values that don't conform to the limits it reports.

ok, when I manually set the values I could set it 1 step at a time. It appears to change focus as well, but that could well be my old eyes. I already appreciate that you took the time to respond and are willing to have a look. Thanks. Blair

Regards
Blair Abernethy
0274748661

1 Like

Tracking it here:

Is there a way to quickly switch between presets? Maybe a button on the Control page I'm not seeing?

I have a "Home" preset for watching the initial ritual before starting the print...

and a "Printing" preset for everything else