bitfocus / companion-module-ptzoptics-visca

MIT License
8 stars 11 forks source link

Call to camera controls using variables rather than absolutes #27

Open ChrisSW58 opened 10 months ago

ChrisSW58 commented 10 months ago

Is this a feature relevant to companion itself, and not a module?

Is there an existing issue for this?

Describe the feature

It would be helpful if Companion could make calls to PTZOptics using a variable and calculation for Camera number and Preset Number. Thus I could recall a preset with ( + 1) for Camera ( + 1). Believe this is a Companion issue for making the call rather tag a PTZOptic request, hence posted here. This would make coding of saving and loading preset configs a lot easier.

Usecases

Different camera presets for different types of events; different camera presets for different users with their favourite shots.

ChrisSW58 commented 6 months ago

As I am not sure if anyone is actively looking at this, please let me explain the scenario why this would be useful to me. We have a system which uses 4 presets per camera based on the StreamDeck XL buttons (6 columns of cameras, 4 camera presets). I allow each operator to have their own set of presets, as well as the default. For that to work, I save their presets in higher preset numbers per camera and then recall them into the standard 4 presets. If instead of having to recall them and put them in the standard 1-4 presets per camera, I could call the presets directly with a variable (based on the operator), things would be so much quicker and easier. I hope this makes sense. many thanks for all your hard work.

ploveman commented 3 months ago

I've been working on being able to recall a preset via variable since it would simplify our church setup. You'd still target a particular camera, would that be useful to you? I don't think doing camera by variable would make a lot of sense from what I understand since the connection is per camera.

ChrisSW58 commented 3 months ago

Hi there.

We are a church as well, with 6 cameras and 4 presets. Initialising the cameras (we allow operators to store their own presets) requires each camera and each preset to be configured. Currently that is 24 calls to recall their presets and 24 calls to load them into the operating presets.

If I had variables for both camera and preset, then it would be so much simpler. I know that the presets are defined in the code per camera which Companion sends to it, but logically, if you were building the call, it would be comparatively easy to use a variable to insert the camera number on that code call - as easy as to insert the variable for the preset number.

I wait in hope!

Kind regards and many thanks,

Chris

On 25 Mar 2024, at 7:28 PM, ploveman @.***> wrote:

I've been working on being able to recall a preset via variable since it would simplify our church setup. You'd still target a particular camera, would that be useful to you? I don't think doing camera by variable would make a lot of sense from what I understand since the connection is per camera.

— Reply to this email directly, view it on GitHub https://github.com/bitfocus/companion-module-ptzoptics-visca/issues/27#issuecomment-2018752850, or unsubscribe https://github.com/notifications/unsubscribe-auth/BA2KHPZADUYQGHYOHPKIH4TY2B3GZAVCNFSM6AAAAAA3J7W4V2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJYG42TEOBVGA. You are receiving this because you authored the thread.

ploveman commented 3 months ago

@ChrisSW58 I think targeting the camera with a variable is a larger lift than I can contemplate. From how I read it, the way the module is built the socket from companion to the camera comes up and is maintained/reconnected via that TCP socket. It uses that to represent status that the connection is good/healthy. I don't know if this module could ever support targeting a camera via a var b/c it would then have to maintain multiple connections. @jswalden I think has been working a a pretty major re-write (at least of how the code is organized), but believe fundamentally the nature of the connection will remain unchanged). I still plan to continue to have a var for presets, that at least helps some. One thing you might be able to do is to setup some buttons with conditional presses to work around the multiple camera aspect. e.g. if this expresssion is true, send preset varible to camera x.

ChrisSW58 commented 3 months ago

Thanks for the clarification. I had thought it was simply an HTTP call with a relevant code sequence which could have the relevant code pair changed as needed.I look forward to any changes in this area. Many thanks and good luck. Kind regards,ChrisOn 26 Mar 2024, at 1:10 AM, ploveman @.***> wrote: @ChrisSW58 I think targeting the camera with a variable is a larger lift than I can contemplate. From how I read it, the way the module is built the socket from companion to the camera comes up and is maintained/reconnected via that TCP socket. It uses that to represent status that the connection is good/healthy. I don't know if this module could ever support targeting a camera via a var b/c it would then have to maintain multiple connections. @jswalden I think has been working a a pretty major re-write (at least of how the code is organized), but believe fundamentally the nature of the connection will remain unchanged). I still plan to continue to have a var for presets, that at least helps some. One thing you might be able to do is to setup some buttons with conditional presses to work around the multiple camera aspect. e.g. if this expresssion is true, send preset varible to camera x.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

ploveman commented 3 months ago

@ChrisSW58 although I don't think this module would be able to target a camera with an IP. However, you reminded me that PTZOptics does have an http API. This is a VISCA module so I don't think it makes sense to move to http, but you might be able to use the generic http module to do what you want. It appears that the URI can use variables. Here's a reference in PTZOptics help on recalling a preset (it's OBS, but the URI concepts would be the same). https://help.ptzoptics.com/support/solutions/articles/13000075770-using-obs-scene-switching-to-automate-ptzoptics-preset-recall I don't know if usually things like this get their own module to simplify or other. I also don't know if there's a benefit of VISCA vs http outside of that constant connection

ChrisSW58 commented 3 months ago

Very many thanks - much appreciated. Just need to get the time now to code and test! :)

Kind regards,

Chris

On 26 Mar 2024, at 1:11 PM, ploveman @.***> wrote:

@ChrisSW58 https://github.com/ChrisSW58 although I don't think this module would be able to target a camera with an IP, you reminded me that PTZOptics does have an http API. This is a VISCA module so I don't think it makes sense to move to http, but you might be able to use the generic http module to do what you want. It appears that the URI can use variables. Here's a reference in PTZOptics help on recalling a preset (it's OBS, but the URI concepts would be the same). https://help.ptzoptics.com/support/solutions/articles/13000075770-using-obs-scene-switching-to-automate-ptzoptics-preset-recall <x-msg://7/url> I don't know if usually things like this get their own module to simplify or other.

— Reply to this email directly, view it on GitHub https://github.com/bitfocus/companion-module-ptzoptics-visca/issues/27#issuecomment-2020395189, or unsubscribe https://github.com/notifications/unsubscribe-auth/BA2KHP5ZRFB64BR7X2XLAPTY2FXZZAVCNFSM6AAAAAA3J7W4V2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRQGM4TKMJYHE. You are receiving this because you were mentioned.

jswalden commented 3 months ago

@ploveman The "Recall Preset" action could accept custom input so you could specify a variable, that seems easy enough.

As long as it's one connection per camera, I agree that that extra level of option is not terribly useful. (Especially since cameras literally must occupy different spaces, so there's no real reason why preset 17 on camera 1 should have any coordinate meaning with preset 17 on camera 2.) But you could fake it by creating a page of "recall preset" buttons per camera, each one using the same variable to indicate which preset is desired...and then press "button x + $var" to target and press the desired button.

I'm kind of drowning in unlanded patches right now, so I think I'd like to clear some of that out first. I'll try to get the most critical parts of that landed this week.

ploveman commented 3 months ago

@jswalden I have a version that would accept a variable, since I only have 2 cameras in my setup and just alternate between basically the same shot across the 2, being able to do via a variable would be helpful. That being said I'll old off until you have whatever landed and will rework with your refactor.