Saturday, December 13, 2025

Send VISCA commands using windows batch file

Have a situation where I want to control some FOMAKO cameras using VISCA, but from a Windows command prompt.  These commands for VISCA are HEX values which are sent.

You'll need two programs

1:  NCAT  (this will send the actual HEX commands)

https://nmap.org/dist/nmap-7.98-setup.exe

2:  XXD   (This tool will translate HEX commands)

https://sourceforge.net/projects/xxd-for-windows/

Download and install these.

From a simplicity sake, drop XXD into a folder that will contain your batch files.  You can add it to your system path, there are lots of online tutorials already

The command syntax is as follows:

echo 'HEX VALUE' | xxd -r -p | ncat CAMERA_IP VISCA_PORT

So the example below will send the HEX to the camera at 192.168.0.11 port 52381 and change it to recall a set point #3 (substitute 03 in bold for 01 or 02 or whatever preset value you want to recall.

echo '8101043f0203ff' | xxd -r -p | ncat 192.168.0.11 52381
I incorporated it a batch file because I wanted to send some other commands.
This batch file example send command from one computer to another computer running OBS. 
So the first computer runs a .bat file and it looks like this:

echo '8101043f0203ff' | xxd -r -p | ncat 192.168.0.11 52381

timeout /T 3 /NOBREAK > NUL

C:\OBSCommand\OBSCommand.exe /server=192.168.0.10:4455 /password="password01" /scene="Slide1" /delay=1
So the above syntax contained in a BAT file to do the following:

Command camera @ 192.168.0.11 to move to Preset #3
Wait 3 seconds 
Sends a WebSocket command to OBS to change the scene called "Slide1".

Here are my camera network settings, just in case you run into issues with your camera, to help troubleshooting.



No comments:

Post a Comment

Feel free to leave a comment! If you have any information that you think should be included, please do so here and I'll get it added in.