How to use vMix for Auto-Tracking with PTZOptics Cameras

vMix is a versatile live production software that allows you to create, record, and stream in HD, SD, and even 4K. One of its lesser-known features is scripting, which enables users to automate various functions and streamline their workflow. PTZOptics cameras, which are supported in vMix for pan, tilt, and zoom controls, now offer auto-tracking features in selected models, allowing the camera to follow the subject automatically. This guide aims to walk you through the process of using vMix scripting to enable or disable the auto-tracking capabilities on your PTZOptics cameras, making your production more efficient and dynamic.

Note: To access these advanced features, including scripting and PTZ controls, users must have vMix 4K, Pro, or vMix Max editions as these are not available in the lower-cost Basic HD and HD licenses.

Download the Guide: If you would like to download this guide as a PDF you can do so here.

Using Auto-Tracking Cameras with vMix

In this blog post, you will learn about the integration of vMix’s scripting capabilities with PTZOptics cameras, focusing specifically on enabling and disabling the auto-tracking functionalities. This synergy between vMix and PTZOptics can elevate your video production, allowing for more flexibility and creativity in your video productions. Whether you are a seasoned professional or a beginner eager to explore advanced video production techniques, this walkthrough will provide insights and step-by-step instructions to streamline your experience with vMix and PTZOptics.

Note: You can learn more about vMix scripting in this documentation page on their website.

Section 1: Preparing vMix for Scripting

1.1 Launching vMix:

Start by opening vMix software. You will also want to have your PTZOptics camera set up on the same network as your vMix computer. You will need to know the IP address of your PTZOptics camera. If you do not know the IP address of your camera follow the guide here.

vMix Scripting for setting up Auto-Tracking
vMix Scripting for setting up Auto-Tracking

1.2 Accessing Settings:

Next, in vMix, navigate to the “Settings” menu, located at the top right corner of the main interface. This menu hosts various configurable parameters, allowing you to customize your vMix experience according to your production needs. Click the “Scripting” tab of Settings to get started.

Section 2: Creating the Auto-Tracking ON Script

1.3 Scripting Menu Navigation:

Within the “Scripting” option from the left navigation pane, you will see the “Add”, “Edit” and “Remove” buttons along with a “Stop All” button. This section is dedicated to creating and managing scripts that can automate various tasks within vMix. It’s here that you will create scripts to control the auto-tracking feature of your PTZOptics camera. If you’re new to scripting, don’t worry; we will walk you through each step, ensuring you can follow along, regardless of your experience level.

Add AutoTracking to vMix
Add AutoTracking to vMix

2.1 Adding a New Script:

Once you are in the scripting menu, initiate the process by clicking on the “Add” button. This action will open a new window where you will create the script to enable the auto-tracking feature on your PTZOptics camera.

2.2 Naming the Script:

In this new window, you will be prompted to provide a name for your script. For the sake of this guide, we will name it “ATrackON.” This name will serve as an identifier, allowing you to execute the correct script when needed.

2.3 Entering the Code:

In the same window, you will find a main text entry field. Here, you will input the following code:

Dim webStream As Stream
Dim webResponse = ""
Dim req As HttpWebRequest
Dim res As HttpWebResponse
req = CType(WebRequest.Create("http://192.168.100.88/cgi-bin/param.cgi?set_overlay&autotracking&on"), HttpWebRequest)
res = CType(req.GetResponse(), HttpWebResponse)
webStream = res.GetResponseStream() ' Get Response
Dim webStreamReader As New StreamReader(webStream)
While webStreamReader.Peek >= 0
webResponse = webStreamReader.ReadToEnd()
End While

This code is responsible for sending an HTTP command to turn ON the auto-tracking feature of a PTZOptics product. Ensure that you replace the IP address “192.168.100.88” with the actual IP address assigned to your camera.

2.4 Saving the Script:

After entering the code correctly, click “SAVE.” This action will store the script in vMix, making it available for use. After saving, click “Close” to exit the script creation window.

Creating a script in vMix is a straightforward process, but attention to detail is crucial. Each line of code serves a specific purpose, and altering it can affect the functionality of the script. Always ensure the accuracy of the IP address and the commands to avoid unexpected behaviors during production.

Auto Tracking On and Off in vMix
Auto Tracking On and Off in vMix

Section 3: Creating the Auto-Tracking OFF Script

3.1 Adding Another New Script:

Return to the scripting menu and initiate the creation of a second script by clicking the “Add” button again. This script will serve as a counterpart to the first one, allowing you to disable the auto-tracking feature on your PTZOptics camera when needed.

3.2 Naming the OFF Script:

In the creation window, assign a name to your new script. For consistency and easy identification, we will name it “ATrackOFF.”

3.3 Entering the OFF Code:

In the text entry field of the same window, input the following code:

Dim webStream As Stream
Dim webResponse = ""
Dim req As HttpWebRequest
Dim res As HttpWebResponse
req = CType(WebRequest.Create("http://192.168.100.88/cgi-bin/param.cgi?set_overlay&autotracking&off"), HttpWebRequest)
res = CType(req.GetResponse(), HttpWebResponse)
webStream = res.GetResponseStream() ' Get Response
Dim webStreamReader As New StreamReader(webStream)
While webStreamReader.Peek >= 0
webResponse = webStreamReader.ReadToEnd()
End While

This piece of code is tailored to send an HTTP command to turn OFF the auto-tracking feature of a PTZOptics product. It’s imperative to replace the IP address “192.168.100.88” with the actual IP address of your camera to ensure proper communication between vMix and your camera.

3.4 Reiteration on IP Address:

It cannot be stressed enough how important it is to input the correct IP address corresponding to your PTZOptics camera. This ensures that the scripts communicate effectively with the intended device, allowing you to gain control over the auto-tracking feature seamlessly.

3.5 Saving and Closing:

Once you’ve ensured that the code and the IP address are correctly entered, click “SAVE” to store the OFF script in vMix. After saving, close the script creation window to return to the main scripting menu.

Having both ON and OFF scripts inside vMix allows you to have full control over the auto-tracking feature, enabling you to adapt quickly to different filming scenarios. Ensuring the accuracy of each script is crucial for a smooth and error-free production experience.

vMix Shortcut to turn on Auto-Tracking
vMix Shortcut to turn on Auto-Tracking

Section 4: Testing the Scripts with Shortcuts

4.1 Assigning Shortcuts for ON Script:

With your scripts saved and ready, the next step is to assign shortcuts to execute them efficiently. In the main interface of vMix, select “Shortcuts.” Once there, click the “Add” button to assign a shortcut key. For the ON script, you might, for example, choose the key “G.”

  • Key/Control: Assign the key you would like to use to trigger tracking ON, e.g., “G.”
  • Function: Navigate to Scripting → Select ScriptStart.
  • Value: Assign the name of the ON script, “ATrackON.”
  • Title: Name it “ATrackON” for consistent identification.

After assigning the key and the functions, click “OK” to save this shortcut.

4.2 Assigning Shortcuts for OFF Script:

Repeat the above steps to assign a shortcut for the OFF script. It’s advisable to choose a different key to avoid any confusion. For instance, you can assign the key “H” for the OFF script.

  • Key/Control: Assign a different key, e.g., “H.”
  • Function: Again, navigate to Scripting → Select ScriptStart.
  • Value: Assign the name of the OFF script, “ATrackOFF.”
  • Title: Name it “ATrackOFF” for consistent identification.

Once done, click “OK” to save this second shortcut.

4.3 Testing the Scripts:

Now, with the shortcuts assigned, test the scripts by pressing the corresponding keys you assigned as shortcuts. Pressing key “G” should start the auto-tracking, and pressing key “H” should stop it. Ensure that each key executes its assigned function correctly, allowing for seamless toggling between auto-tracking ON and OFF.

Assigning shortcuts is a crucial step for operational efficiency. It allows for quick toggling between different states of auto-tracking, providing flexibility and adaptability during live productions. Successful testing ensures that your setup is ready for action, allowing you to focus more on the creative aspects of your production, with assurance in the reliability of your controls.

Troubleshooting Tips:

  • If the scripts are not working as expected, double-check the assigned keys, script names, and the IP addresses in the scripts.
  • Ensure that you have the correct vMix edition that supports scripting and PTZ controls.
  • Consult the vMix and PTZOptics support forums and resources for additional help and information.

Further Automation with Triggers

Using Triggers to further automate Auto-Tracking ON and OFF

Do you want to automate auto-tracking even further? You can do so with vMix Triggers. Triggers in vMix are actions that are automatically performed when a specific event occurs, such as transitioning to a specific input. These can be used to automate various aspects of your production workflow.

For instance, you can set up a trigger to run a script when a specific input is taken live or when a particular overlay is accessed. This could allow you to automate the execution of scripts, including those that control the auto-tracking features of PTZOptics cameras, based on events occurring during your production.

To set up a trigger:

  1. Go to Input Settings: Select the input you want to associate with the trigger, and go to its “Input Settings”.
  2. Navigate to the Triggers Tab: Inside the “Input Settings”, navigate to the “Triggers” tab.
  3. Add a Trigger: Click on the “Add” button to create a new trigger.
  4. Select an Event: Choose the event that will activate the trigger from the drop-down menu.
  5. Assign a Function: Assign a function to the trigger. For running scripts, you would select “ScriptStart” and then choose the script you want to run.
  6. Choose a Value: For example, enter value “ATrackON”

Remember to test the trigger thoroughly to ensure it activates the script as intended in your live production environment.

Conclusion:

Having walked through vMix scripting with PTZOptics cameras, you have unlocked a seamless way to control the auto-tracking features of our cameras. By crafting meticulous scripts to toggle auto-tracking ON and OFF and assigning efficient shortcuts, we’ve established a flexible and responsive video production environment.

Remember, the essence of this integration lies in the availability of vMix 4K, Pro, or vMix Max editions, which grant access to the pivotal scripting and PTZ control features not available in the lower-tier Basic HD and HD licenses. It is these advanced features that empower users to blend the innovative capabilities of PTZOptics cameras with the versatile environment of vMix, paving the way for dynamic and engaging content creation.

Key Takeaways:

  1. Scripting Proficiency: The mastery of vMix scripting allows for the automation of various tasks, enabling a smooth and intuitive interaction with PTZOptics cameras.
  2. Accurate Details: The accuracy in details, especially the IP addresses and script names, is crucial for the flawless execution of scripts.
  3. Efficient Controls: The assignment of shortcuts provides quick access to the scripts, allowing for swift adjustments during live productions.
  4. Advanced Features Accessibility: The utilization of vMix 4K, Pro, or Max editions is essential for accessing advanced features like scripting and PTZ controls, enabling enhanced integration with PTZOptics cameras.

Final Thoughts:

As we conclude this guide, encourage yourself to explore the vast possibilities that vMix scripting offers, especially in tandem with the sophisticated features of PTZOptics cameras. The journey doesn’t end here; delve deeper, experiment with different scripts, and explore various camera commands to tailor your production environment to your unique creative vision. And most importantly, always ensure that every detail is accurate and every step is tested to secure a seamless and enriching video production experience.

Download the Guide: If you would like to download this guide as a PDF you can do so here.