Wednesday, July 21, 2021

CUSTOMIZATION of PTZoptics OBS controls

 CUSTOMIZATION of PTZoptics OBS controls


This post is about how to customize those same controls they offer to, perhaps, make them more conducive to your environment.

I found the majority of the buttons too big, or too much information being displayed for users that wasn't necessary.  Since most of their code is in HTML, you could make some modifications relatively easy.

Instead of one big controller, I wanted smaller ones to fit into my OBS screen.


Here's some additional things that might make your PTZoptics cameras in OBS a little easier to control.

You can see here I've modified just the HTML code that they provide for the buttons to alter them to fit within the UI view that I have.  This is to make it easier for operators and not to have to scroll around a large PTZ dispaly
I'm using these controls in conjunction with a plug-in called "Source Dock" Source Dock | OBS Forums (obsproject.com) to give me dedicated preview shots above the controls for that camera. 


The operator to can select tabs at the bottom of each camera view to make it easier to select a variety of preset positions, PTZ buttons 

You may notice that I've removed the "FOCUS" button from my PTZ control.  I also removed the "Auto Pan" feature as these are things we never use, so I prevent users from accessing them accidently.

I separated the preferences and preset assignments to a separate tab in OBS.  So these can be still fully accessible, but don't clutter up the normal day-day usage of the PTZ system.





This was all done by ONLY changing the HTML code provided by PTZ optics.  Was not hard at all and works perfectly.

Its easy to customize the buttons...here's how you would change the code text name and the camera preset you want to have it activate when you click it.  You can alter this in NOTEPAD.  Make a backup of the file in case you make some HTML mistakes.

By default it looks kind of like this:

<a class="call_preset preset_button preset-1" data-preset="1" href="#preset-1">Button1</a>

Change "data-preset" and "#preset-1" to be the preset saved position you would have programmed into your camera.  In this case, the value is 1, but if preset position is 22, change these values both to "22"

Then "Button1" is the descriptive name you see in OBS.  Make it whatever you want, i think the max i 8 characters though

In the example below, I've made the first 3 buttons do presets 1-3,
however buttons 4-6 activate presets 10-12 and 7-9 do presets 13-15

<form role="form" class="form-horizontal">
<fieldset class="presets">
<div class="row">
<a class="call_preset preset_button preset-1" data-preset="1" href="#preset-1">Pulpit</a>
<a class="call_preset preset_button preset-2" data-preset="2" href="#preset-2">Communion Table</a>
<a class="call_preset preset_button preset-3" data-preset="3" href="#preset-3">Lecturn</a>
</div>
<div class="row">
<a class="call_preset preset_button preset-10" data-preset="10" href="#preset-10">Organ</a>
<a class="call_preset preset_button preset-11" data-preset="11" href="#preset-11">Stairs</a>
<a class="call_preset preset_button preset-12" data-preset="12" href="#preset-12">12</a>
</div>
<div class="row">
<a class="call_preset preset_button preset-13" data-preset="13" href="#preset-13">13</a>
<a class="call_preset preset_button preset-14" data-preset="14" href="#preset-14">14</a>
<a class="call_preset preset_button preset-15" data-preset="15" href="#preset-15">Control</a>
</div>
</fieldset>

Here's a google drive link to some of these files to help give you some ideas perhaps.

https://drive.google.com/drive/folders/1n-G4Vk4Lkfzp6Nl7pGJy1UwYpF37OPz2?usp=sharing

Drop them into the appropriate "Camera X" folder(s) that is created when you extract the PTZOptics download, and then install them using this method :

You should know have some similar examples available in your OBS as is pictured above.

Wednesday, July 14, 2021

Control PTZ optics using their OBS "PTZOptics Open Source Control Software"

 This will let you control the PTZ optics camera using buttons that you can place inside your OBS Studio program.

First you want to download the PTZ optics package for their cameras to use with OBS

PTZOptics Open Source Software.zip

This is the most recent version (as of July 14, 2021).  This one fixes a problem where you could only control 1 camera, despite claims that you could control 4 (or more)

Next, you unzip this file, and you can unzip it anywhere in your machine, doesn't need to be in the OBS folder.  Just put it in a spot where you aren't going to accidently delete it later on.

Once you unzip it, you'll have a folder like this:

Here's the whole process you should know.  The above example controls 4 cameras, you just use use a different folder for each camera you have.  You could have a whole bunch, just copy/paste the Camera "X" folder and give it a new name.  PTZOptics makes it very easy.

STEPS:

Go into the folder for a camera.  I'll use Camera 1 as example

You will see a few pre-built layouts



Lets pick "Medium Controller (6) Preset Images".  So, simply double click that file, and it will open in a web browser

Now select the entire URL location and copy it.  We are going to paste this into OBS, and obs will use this file location and file URL to display the image you see now into OBS.


Go into OBS and select VIEW -> DOCKS -> CUSTOM BROWSER DOCKS


You'll see this:


Give it a "DOCK NAME" of your choice, then in the "URL" window paste the URL you copied above


Then press "APPLY"

You should now see a window pop up with the title you put in "Dock Name"

Now click drag it an you can place it somewhere in OBS that you like.


Now click on "PREFERENCES" in the Camera window at the bottom


Now you can assign hotkeys 1-9 on your PTZOptics camera and by pressing one of these buttons 1-9, the camera will move.


Change the IP Address to be the IP of the camera you are trying to control, then press "RELOAD CAMERA"  (which means "save IP address"

Click on DONE to get out of this screen.

You may need to restart OBS after to reload the camera you want to control.  
Youll notice there are other functions that you have access to just in case.


Now in that same folder that you unzipped, you'll notice some other pre-built controls.  You can have them all in OBS if you want.  I like the one called "Small Controller".  This will let me move the camera around

Repeat the above steps by copy/pasting the file URL of the subseqent URL files you want to have in OBS.
I place the "Small Controller" window ontop of the camera window, and it creates a small tab at the bottom that lets me toggle back and forth between the preset view and the PTZ view.





Automatically move PTZoptics Camera OBS Studio based on scene

Have your PTZoptics camera move to a pre-programmed x/y/z location automatically

You can have your PTZoptics camera move to a preset position that you've stored automatically when you select a scene.  Basically, we will use the "BROWSER" function in OBS to send an HTML command to the specific camera, that is formatted to trigger one of the pre-stored positions.

First, save a preset location.  In this example, Position #25 has been saved.  I'm doing this through the GUI of the PTZoptics camera.  




Now, in OBS, lets create a scene


Now in "Sources" we'll create a new one


Select "BROWSER"


Give it a name and click OK

You'll see the following

In the "URL" section paste in the following code syntax, but with changes for your situation.

http://IPofCAMERA/cgi-bin/ptzctrl.cgi?ptzcmd&poscall&PositionNumber

So as example, the camera I have uses IP 192.168.2.211 and we are using saved position # 25 so my code would look like 

      http://192.168.2.211/cgi-bin/ptzctrl.cgi?ptzcmd&poscall&25


Make sure you now check "Refresh browser when scene becomes active"

Then press "OK"

Now, add in the Camera input for the PTZoptics camera you are trying to control into the SOURCES window,  In my example the camera with IP of 192.168.2.211 is on Input #4

Now when you select the scene, your camera will move to that preset position #25 automatically.





Sunday, July 11, 2021

Ping a range of IPs from a windows command prompt

This command will ping every ip from 192.168.2.1 to 192.168.2.255

for /L %i in (1,1,255) do ping -w 20 -n 1 192.168.2.%i | find /i "Reply"

The above command would return would be similar to this, showing a reply for IPs that return a ping.

C:>ping -w 20 -n 1 192.168.2.1   | find /i "Reply"

Reply from 192.168.2.1: bytes=32 time<1ms TTL=64

C:>ping -w 20 -n 1 192.168.2.2   | find /i "Reply"

C:>ping -w 20 -n 1 192.168.2.3   | find /i "Reply"

Reply from 192.168.2.3: bytes=32 time<1ms TTL=64

C:>ping -w 20 -n 1 192.168.2.4   | find /i "Reply"

Reply from 192.168.2.4: bytes=32 time<1ms TTL=64

C:>ping -w 20 -n 1 192.168.2.5   | find /i "Reply"

C:>ping -w 20 -n 1 192.168.2.6   | find /i "Reply"

C:>ping -w 20 -n 1 192.168.2.7   | find /i "Reply"

C:>ping -w 20 -n 1 192.168.2.8   | find /i "Reply"

Reply from 192.168.2.8: bytes=32 time<1ms TTL=64


Here are some adjustments

Ping a range 1-100:

for /L %i in (1,1,100) do ping -w 20 -n 1 192.168.2.%i | find /i "Reply" 

Ping a range 100-200:

for /L %i in (100,1,200) do ping -w 20 -n 1 192.168.2.%i | find /i "Reply"

Range 1 to 200, but ping every second value

for /L %i in (1,2,200) do ping -w 20 -n 1 192.168.2.%i | find /i "Reply"


Here's how the command works:

for /L %i in (1,1,255) do ping -w 20 -n 1 192.168.2.%i | find /i "Reply"

Do a loop of pings from 1, counting up 1 each time, until you reach 255, while waiting for only 20 ms and for only 1 response on the specified network of 192.168.0.XXX.

To specify From A to B is in the (1,1,255) translates to (A,X,B)/  the W indicates how many milliseconds to wait for a response before you continue.  I keep it low, usually since i'm pinging on a local lan, but if you find results aren't accurate, turn up the rate to 100 (or eliminate the -w 20 all together to wait longer.

A= starting point  B= Ending point X= Increment value (normally would be 1)

Thursday, July 1, 2021

How to record Aux Inputs in your DAW on a X32

Hey you want to record the AUX inputs on your DAW in an X32

Good news!  You can do it!

Bad news, as of firmware 4.06 and X32 edit 4.6 in order to record them, you have to sacrifice 8 channels on your outputs to your DAW

But here's all you have to do

Goto "ROUTING"

Click on "CARD"

Select the OUTPUT group that you want to assign to your "AUX IN"


You'll see that I've assigned AUXIN to Outputs "25-32" on the "card"

Now in my DAW you'll see Aux input #2 is appearing on input #26 of my DAW software