Resource icon

Control Visca-over-IP based cameras 2.6

vwout

Member
Great that you got it to work!

I should have thought about the script reload. Yes, when you (attempt to) use the plugin in a scene, a connection is created. Its configuration will only be forcefully be updated after a script release.
 

JVRaines

New Member
This script looks promising for my use, especially the animation function. Would it be possible to add a configurable delay before the preset is called? I am using a stinger that takes 1 second to wipe on the screen and the cam needs to be still for that period. Currently, I handle it with a browser source calling Javascript with setTimeout and fetch. It's a little arcane and VISCA would be cleaner.
 

vwout

Member
Sure, that doesn't look hard to add. I will include it in the next release.
As a small bonus, it might even allow adding multiple Visca commands in the same scene, to be executed sequentially based on configured delays...
 

vwout

Member
vwout updated Control Visca-over-IP based cameras with a new update entry:

Release 1.6

This release adds several features and contains a significant number of reworks to improve the code quality.

New features:
  • The number of camera configurations that can be stored increased to the arbitrary maximum of 42
  • Add visca support for focus control. The plugin now supports hotkeys for changing the focus (automatic mode (default for most cameras, manual mode, single shot refocus trigger, focus to infinity, focus to near and focus to far). The hotkeys can be assigned via...

Read the rest of this update entry...
 

vwout

Member
vwout updated Control Visca-over-IP based cameras with a new update entry:

Release 2.0

A second major release of the Visca over IP control plugin for OBS!

This release contains many and significant changes to the code to enable several new features, completely backward compatible with all previous releases.

Most noticeable is the integration of a nice new feature suggested and initially implemented by user tmimlitch. The current pan, tilt and zoom value of a camera can be retrieved and stored in a scene action, which are recalled when the scene becomes active. This means...

Read the rest of this update entry...
 

vwout

Member
One additional note: the plugin tries to detect the camera brand, model and version. This will be shown with the camera in the scripts settings under 'Version Info'. This information is provided by the camera as codes. If your camera provides this information and the plugin shows this as 'Vendor: Unknown (vvvv), Model: Unknown (mmmm), ...', please share the actual vendor and model name and the vvvv and mmmm shown in the plugin, so this information can be added.
 

Jeggins

New Member
Hi and thanks for this script so far :)

I managed to add position recalls to ma scenes but I have the problem that i can recall a saved position exactly 3 times. After that the cam is not responding. I have to reload the script to have 3 more position recalls :D

I have the "NewTek NDI PTZ1" camera.
I tried the PTZOptics Mode but with that i had no camera movement at all. I added two logs from the OBS scriptlog. The first one shows 4 scene changes with 3 successfull cam preset recalls and the last one failing. The second log shows some unfinished messages that i get when i reload my script.
 

Attachments

  • log1.txt
    7 KB · Views: 37
  • log2.txt
    314 bytes · Views: 35
  • obs_script.jpg
    obs_script.jpg
    70.6 KB · Views: 44
  • settings_preset.jpg
    settings_preset.jpg
    28.9 KB · Views: 43

vwout

Member
Hi Jeggins,

You are welcome :)

To start with log2, this is because not all replies from the camera can be linked to a send message.
From the logs, it looks like the camera has some issues:
- not sending its own Vendor data (it identifies as Sony)
- it seems to be sending incorrect message counters on reply's
Both should not prevent the plugin from sending more commands to the camera, but this looks suspicious.

One question for confirmation: you are only sending the preset recall command after the previous command has been fully completed, so when the camera has reached the preset position? It looks like that looking at the logs, but just to be sure.
The test you are doing is recalling respectively preset 2, 3, 4 and 1. The call to preset 1 is failing. Although you probably tested this, could you try sending preset 2, 3, or 4 again - so sending a 'known good' preset recall?

When this continues to fail, could you modify libvisca.lua at line 941 and change:
message.seq_nr = self.last_seq_nr
to
message.seq_nr = 0

On a side note: your camera seems to still have stock firmware (revision 104). The latest at the NewTek site is 121 (VHR121F, see https://www.newtek.com/downloads/). Besides testing the above, you could also try a firmware update.
 

Jeggins

New Member
Hi vwout,
thanks for your quick reply.
changing the mentioned line in the libvisca.lua did the job :) thank you very much!!

doublechecked my firmware version but I am at version VHR121F as you can see here:
1666433921511.png


Thank you again for the script ;) loving it
 

vwout

Member
vwout updated Control Visca-over-IP based cameras with a new update entry:

Release 2.1

A small update release introducing a few additional capabilities

- Add functions for changing color gain (saturation) and brightness (#8). The color gain can be increased on the fly using assignable shortcut keys, or can be set to a fixed value as scene action.
- Add API commands to libvisca for reset/set/get Color Gain (Saturation) and set/get Brightness.
- Make previously hardcoded pan, tilt, zoom and focus speeds configurable per camera, add shortcuts for live modification (#6)
- Add...

Read the rest of this update entry...
 

Paul E.

New Member
Would it be possible to add a menu selection to send a manually entered VISCA command to a camera? For example, I'd like to be able to send VISCA command 81 0A 01 12 0F FF to my PTZOptics camera in order to set the "Red Tuning" to level 0F. (That's just an example. I'd like to be able send any VISCA command that is shown in the list provided by PTZOptics.)
 

vwout

Member
Hi Paul, would you want to send this once (manually), or as action in a scene (so it is send with every transition)? Both are technically possible, but the former does not feel like a good fit to the (purpose of the) Visca plugin. The latter may, although I'm a bit in doubt since your request requires a rather deep and technical understanding of the Visca protocol for the person using the feature.
 

Paul E.

New Member
The short version: I believe the answer to your question is that I want to send the commands as actions in a scene, when the scene enters the preview window, actually.

The longer version: Here's my situation. I currently set up a fairly long sequence of scenes to record a weekly church service. The scenes proceed in sequence, and I transition them manually at the appropriate times. (I use studio mode and Advanced Scene Switcher to pull each subsequent scene into the preview window as each scene goes into the program window.) Whenever the next scene calls for a camera change (including changing to a new preset), I include a browser source in the scene that sends an http: command to the appropriate camera. Unfortunately, there are no browser commands for the settings I need in order to adjust the various exposure and color settings of the camera. Only VISCA commands exist for these. Also unfortunately, the lighting and camera positioning in the church is such that I can only achieve the best result if I'm able to adjust the camera settings with each camera preset, so I'd like to be able to send the VISCA commands with each appropriate scene in the same way I'm currently sending http: commands. In fact, I'd like to switch to using VISCA commands to move the cameras to the desired presets, as well, since your plugin doesn't require an extra "refresh browser in preview" source to make it execute while the scene is still in the preview window.

Although it might look nice, there's no need for you to build menus for all the exposure and color settings that exist as VISCA commands for PTZOptics cameras. I have access to the list of commands, and I certainly don't mind entering the codes myself. I'm just looking for an easy way to send those codes as a source in a scene. Based on what your excellent script already does, I thought it might not be too difficult for you to add something like this.

By the way, I do have an advanced degree in computer science, though I don't have your familiarity with the inner workings of OBS and Lua and whatever other knowledge you used to write your script. Still, if there's anything I can do to help, just ask.
 

vwout

Member
Thanks, the story is clear and makes sense. The implementation indeed is not too complex, as long as you don't ask to modify a parameter based on a to be retrieved value, such as 'increase current blue gain by 42' ;)

I'll add something to the plugin for you to test.
 

Paul E.

New Member
Thank you very much! I'm eagerly looking forward to it. Since it'll soon be Sunday, I won't be able to test until after the next church service, though I'd be tempted if it came out before then. :)
 

vwout

Member
Have a look at the code on Github. I added the function. When you select 'Custom' as action, you can enter an arbitrary command that is executed at activation/deactivation of the scene.

1681505172625.png
 
Top