AmberCutie's Forum
An adult community for cam models and members to discuss all the things!

Help with terminal command on streamdeck, Linux user

  • ** WARNING - ACF CONTAINS ADULT CONTENT **
    Only persons aged 18 or over may read or post to the forums, without regard to whether an adult actually owns the registration or parental/guardian permission. AmberCutie's Forum (ACF) is for use by adults only and contains adult content. By continuing to use this site you are confirming that you are at least 18 years of age.

ts_cammer98

Cam Model
Aug 19, 2025
322
370
16
So I want to add some commands to my streamdeck to control my camera from there. I have v4l2-ctl to control the camera, and I can set camera control values to a specific number to make the camera tilt, pan, zoom to those values. What I want to do is have up/down left/right and zoom in/out buttons on my streamdeck. I can't figure out how to make the command add/subtract from the current value. All I can figure so far is how to set it to a value.
1778218527726.png

and the command I'm using to change a value is
1778218592588.png
to program less buttons to move the camera, I want it to be --set-ctrl=tilt_absolute=tilt_absolute+1000 obviously that doesn't work though. I want to add a value to the current value rather than set it to a value.
v4l2-ctl man doesn't have any answers for me, could it just be a limit of the application or is there any other ways I can try to type out that command?

Now I can use --get-ctrl=tilt_absolute to get the value and perhaps set it to a variable and then make the --set-ctrl=tilt_absolute= ii+50 or whatever I'm sure but then I'd have to learn programming again and I've only dabbed in a little python many years ago. I feel like that would be a lot of work if tilt_absolute is already a value and I should be able to do math with the --set-ctrl command
 
So I want to add some commands to my streamdeck to control my camera from there. I have v4l2-ctl to control the camera, and I can set camera control values to a specific number to make the camera tilt, pan, zoom to those values. What I want to do is have up/down left/right and zoom in/out buttons on my streamdeck. I can't figure out how to make the command add/subtract from the current value. All I can figure so far is how to set it to a value.
View attachment 106310

and the command I'm using to change a value is
View attachment 106311
to program less buttons to move the camera, I want it to be --set-ctrl=tilt_absolute=tilt_absolute+1000 obviously that doesn't work though. I want to add a value to the current value rather than set it to a value.
v4l2-ctl man doesn't have any answers for me, could it just be a limit of the application or is there any other ways I can try to type out that command?

Now I can use --get-ctrl=tilt_absolute to get the value and perhaps set it to a variable and then make the --set-ctrl=tilt_absolute= ii+50 or whatever I'm sure but then I'd have to learn programming again and I've only dabbed in a little python many years ago. I feel like that would be a lot of work if tilt_absolute is already a value and I should be able to do math with the --set-ctrl command
with v4l2 I dont think there is a python library, so you would just be using subprocess to access v4l2 which means realistically you may aswell use bash (lower recourse useage too)
the bash script would be something like this I think
Code:
#!/bin/bash
TILT_VAL=$(v4l2-ctl -d /dev/video2> -C tilt_absolute | awk '{print $2}')
NEW_TILT=$((TILT_VAL + 50))
4l2-ctl -d /dev/video2 -c tilt_absolute=$NEW_TILT


you would then need to do a chmod +x to make the script executable and then attach it to the button on the streamdeck so when you press it the script runs, then you would make a new script for each button / function (easier in bash than trying to make everying into a single script)

Not 100% sure if that will work since it's untested but it's going to be something like that. (the uppercase -C is shorthand for --get-ctrl and the lowercase -c is shorthand for --set-ctrl, $2 gets the data from the second column (first column being name and the second column being the values)
 
with v4l2 I dont think there is a python library, so you would just be using subprocess to access v4l2 which means realistically you may aswell use bash (lower recourse useage too)
the bash script would be something like this I think
Code:
#!/bin/bash
TILT_VAL=$(v4l2-ctl -d /dev/video2> -C tilt_absolute | awk '{print $2}')
NEW_TILT=$((TILT_VAL + 50))
4l2-ctl -d /dev/video2 -c tilt_absolute=$NEW_TILT


you would then need to do a chmod +x to make the script executable and then attach it to the button on the streamdeck so when you press it the script runs, then you would make a new script for each button / function (easier in bash than trying to make everying into a single script)

Not 100% sure if that will work since it's untested but it's going to be something like that. (the uppercase -C is shorthand for --get-ctrl and the lowercase -c is shorthand for --set-ctrl, $2 gets the data from the second column (first column being name and the second column being the values)
Code:
$(v4l2-ctl -d /dev/video2> #typo should be $(v4l2-ctl -d /dev/video2 with no >
 
ooo ooo I just woke up, so I'm gonna get my coffee in me and stuff. I can't wait to try this in a moment. I've made a few scripts in the past (to delete those damn Kodi log files, when opening Kodi). I'll let you know how it goes! TY!
 
  • Like
Reactions: KingMarti
@KingMarti

YES!!!! It totally works 100% ty sooooo much! Your awesome af!
 
  • Like
Reactions: KingMarti
This just sparked another idea in me! Not really so much when I'm streaming, but when I do music production I bridge in different ALSA sound devices into my JACK audio server. I've always done this in multiple steps as depending on when I restart the PC or turn on different devices, they can be listed at all sorts of different numbers under /proc/asound/cards. I'm going to make a bridge-in script for the alsa_in and alsa_out commands that will search /proc/asound/cards for my device and assign it's sound card number to a variable to auto plug and chug for me.
 
  • Like
Reactions: KingMarti