Question / Help Controling V4L2 device controls from sources

unfa

Member
I found out that the settings for my webcam get reset to defaults every now and then.

I'm using v4l2ucp program to set up the webcam controls for exposure, white balance, focus, etc. They don't get saved though and after restarting the machine or even OBS sometimes I need to tune the parameters again myself.

Could there be a way for OBS to store the v4l2 device's configuration and restore then for a specific source?

Maybe something like video device presets could be created, also allowing testing of different settings quickly or even swapping them between scenes.

In theory even linear interpolation (along with crossfades) could be done for some parameters like manual focus, exposure, white balance, Pan-Tilt-Zoom controls.

Example:


I have 2 scenes: A and B. A uses the webcam in fullscreen, B shows my desktop and overlays a small webcam on top of that on a corner.

In scene A I'd like to use the full webcam resolution: 1920x1080.

In scene B I'd like to use a smaller resolution (640x480?), becasue the webcam is only a small part in the corner, and also making the webcam resoution smaller I can use the emulated PTZ controls to zoom in on my face without making OBS do the cropping and scaling - the webcam can do a lot of that, saving some CPU/GPU power.

Is that even remotely possible? Do you think it makes sense to spend time implementing this?
 
Last edited:

unfa

Member
There's a commandline program in Linux called "uvcdynctrl": https://sourceforge.net/projects/libwebcam/

It can be used to list, query and set parameters or a V4L2 device. It could be used to easily expose all the webcam controls in OBS and save/recall them also based on scenes - including stuff like animated camera focus (for example blurring out and back in on a transition.
 
Top