bitfocus / companion-module-sony-visca

MIT License
16 stars 19 forks source link

make the camera ID selectable in actions #47

Closed bensteUEM closed 1 year ago

bensteUEM commented 1 year ago

Please provide an optional parameter to all actions to overwrite the Visca-ID or IP of the camera which should receive the visca-ip messages generated.

Benefit -> i would like to setup a companion page that automatically executes actions based on the camera selected as ATEM switcher Preview Input.

We're using the module together with our ATEM Mini switcher and convert the messages to RS232 using a node.js script. At present we map the active PVW Input number to a companion variable. Our main page checks this variable and either executes the same button on page+1 (if input 1 is active) or page+2 (if camera 2 is in preview). Page+1 maps to Instance1 and Page+2 maps to instance2 of the sony-visca module. This workaround does work for preset recall and save but does NOT for pan/tilt/zoom and other params that requires start and stop commands because executing virtual buttons within companion 2.x always triggered "press & release" actions.

Ideally i would like to configure my action to point to a different camera ID directly. Visca-ID (on same IP would be fine for me) but i assume IP/Port changes would more accurate for regular Visca/IP use?

goseid commented 1 year ago

I'm pondering this request and any implications before making any promises.

I do something very similar in one of the setups I use regularly. In our case I have a page 1 that maps to camera 1 and has the pan/tilt movement actions plus zoom in & out, focus near & far, auto focus on/off and the remainder of the buttons on the Stream Deck XL consist of presets for that camera. There is a page 2 that is identical but all controls interact with the camera 2 instance. In our case I have all the preset buttons purple for the camera 1 page and cyan for the camera 2 page so it's pretty obvious which camera you are controlling. I've also implemented the ATEM: Tally: Program feedback on all the preset buttons for each camera so they all turn red as a warning that that camera is in PGM and to think before moving.

I use a trigger with the condition atem: Tally: Preview to set my Stream Deck to page 1 for camera 1 when that camera is tallied on preview. Another trigger for camera 2 does the same thing.

It sounds like we've both gone down similar paths and it seems to work well for a one person director/camera operator environment. Let me know if making a couple of tweaks to your process might provide all the functionality you need.

goseid commented 1 year ago

Can you confirm something for me @bensteUEM ? We currently send out our commands with something like 8x 01 06 06 10 FF where the x is the ID of the camera to be controlled. If we simply put in a mechanism for you to overwrite the x within the instance this should satisfy your particular needs?

If that is the case it should be a trivial change and I'd be happy to implement it.

goseid commented 1 year ago

Hi @bensteUEM

I created a viscaId branch where I've attempted to implement the "Override VISCA ID". I've included the pkg.tgz file as well as the pkg folder in case you want to drop those into your Developer modules path in Comanion v3 for testing.

Please let us know if that works for your use case.

bensteUEM commented 1 year ago

I've successfully tested it with the beta build of companion 3.0. Do i need to say it's awesome and a game changer once we will use this in production? Overwriting ViscaID for the whole module instead of allowing control for each action is different from what i "requested" but might be much better in order to keep the complexity down.

Only "weird" thing is displaying $(ViscaID-Branch-Test:viscaId) on a button it always shows decimals (e.g. 130) instead of hex - is this a formatting thing only or would it be possible to access the value 1-7 for the selected camera?

I did have an issue setting it with automatic triggers, but i suspect this problem is not module related.

@goseid any chance this feautre will make it into an official release?

goseid commented 1 year ago

This feature has been added to the official module and should be included in the beta soon.