Zoom button for usbwebcam

Not sure what to tell you since this technique works on mine, nicely making the custom buttons go horizontally across the page with a 10px padding between them.

I didn't add all items from your list, maybe it depends on some more of the lines?

EDIT: can't see which one that could possibly be...

It only requires the two as indicated and probably a page reload.

caching maybe... shift f5 doesn't help... let me see...

EDIT:
nope, stubborn one... it's horizontal at first but after a second or so it pops down to vertical.

I wonder where the "ko" "/ko" "if: layout == horizontal" stuff originates from in the code base...

You mean here in control.jinja2? So in theory, something above this level has a key/arg pair of something like layout: horizontal. You would think that this would be the ViewModel for Control. Which takes us to here in the docs for custom controls.

Wow. I got it to work (without Themeify this time).

Be super careful about editing your config.yaml. If you put the attribute in the wrong place it simply won't come up.

53%20AM

1 Like

Nice find! Thanks. So it was a built in tweak feature :smiley:

Docs: http://docs.octoprint.org/en/master/features/custom_controls.html

1 Like

Well... yeahUH...

:laugh:

The Custom Control Editor plugin worked very well.
image

1 Like

I have the Logitech C270, and, it seems that my cam doesn't zoom, it only has one speed :stuck_out_tongue_winking_eye:

I see... brightness, contrast, saturation, white balance temperature (what the heck is that ?) , power line frequency, sharpness, backlight compensation, exposure auto, and exposure absolute, but, nothing about zooming or I'd be copy pasting like a madman

What the heck, I tried it anyway, and got...

unknown control 'zoom_absolute'

Oh well, that's what I get for having a cheap camera

On the other hand, it adjusts from dark to light excellently, and when you take it apart you can spin the little focus knob (after you break the glue they put on it to stop you from spinning the little focus knob) so it can see perfectly right up to about two inches away, which is really cool (if, of course, you feel like manually moving the camera... hey, maybe a robotic arm. Okay, I'm a geek)

1 Like

I wonder how practical it would be to add just a "digital zoom" to the interface, that wouldn't depend on camera capabilities? For instance, when I'm keeping an eye on printing progress on a print that doesn't take up much of the view, it would be helpful if I could just enlarge a smaller area of what the camera sees to fill the viewport. There's way more resolution from the camera than I need for print monitoring, but when I have a browser window sized down on my laptop for watching a print while I'm doing other stuff in another larger window, the image of the printing part I can see can be pretty tiny.
Or maybe there's already something like this? (I couldn't find it with a search though)

It's fairly easy to apply a width and height to the IMG tag that shows the stream. There is already a full screen plugin for OctoPrint though, so maybe try that?

Hi @MagnusT would you be able to share the code to do this please as this looks perfect, just got a C525 and would love to use this format? Thank you so much.

In config.yaml

    gcodesystemcommands:
        command_definitions:
        -   command: v4l2-ctl -c zoom_absolute=1
            id: '911'
        -   command: v4l2-ctl -c zoom_absolute=2
            id: '912'
        -   command: v4l2-ctl -c pan_absolute=-36000
            id: '920'
        -   command: v4l2-ctl -c pan_absolute=0
            id: '921'
        -   command: v4l2-ctl -c pan_absolute=36000
            id: '922'
        -   command: v4l2-ctl -c tilt_absolute=36000
            id: '930'
        -   command: v4l2-ctl -c tilt_absolute=0
            id: '931'
        -   command: v4l2-ctl -c tilt_absolute=-36000
            id: '932'
        -   command: v4l2-ctl -c focus_auto=1
            id: '940'
        -   command: v4l2-ctl -c focus_auto=0 ; v4l2-ctl -c focus_absolute=77
            id: '941'
        -   command: v4l2-ctl -c brightness=120
            id: '950'
        -   command: v4l2-ctl -c brightness=80
            id: '951'

and

controls:
- children:
  - command: OCTO911
    name: Zoom out
  - command: OCTO912
    name: Zoom in
  - command: OCTO920
    name: Left
  - command: OCTO921
    name: Center
  - command: OCTO922
    name: Right
  - command: OCTO930
    name: Up
  - command: OCTO931
    name: Middle
  - command: OCTO932
    name: Down
  layout: horizontal
  name: Video Control
- children:
  - command: OCTO940
    name: Autofocus
  - command: OCTO941
    name: Manual focus
  - command: OCTO950
    name: Brighter
  - command: OCTO951
    name: Darker
  layout: horizontal
  name: Video Settings
1 Like

Thank you Magnus, I eventually got there tonight when I did lots of digging and found out about the Custom Control plugin and using v4l2-ctl commands to fix my 60hz issue on my Logitech camera (Wanted to force to 50hz). Then (Afterwards) came back to here only to find you had posted the scripts :slight_smile:

Anyway I learned something and came up with nearly exactly the same solution but using custom control plugin.

You have just saved me lots of time with the Logitech control values so thank you.

Thanks and appreciated that you shared.

Hi, has anybody thought about combining extruder movements with v4l2-ctl commands? (aka auto focuszoom feature)

I have a Logitech c930 cam and it has so narrow depth of focus and I'd like to dynamicaly adjust focus (and perhaps zoom also) based on extruder x axis position..(Auto focus feature of the cam itself is not ok, as it focuses other objects than wanted)

Would that be possible?

It's an interesting idea, but might be more difficult to implement in practice. It's hard to know in OctoPrint exactly where the extruder is at any given time - due to more than one buffer/queue of commands and the planner in Marlin, it's not easy to stay in sync.

Is there a breakdown/Easy guide on how to zoom Out? Step by Step. My Remote is MacOS, and I have a Kingroon KP5L with a Logitech C270 at the other end. I'm using Obico as well.