Tuesday, February 14, 2023

Import SPOUT and capture it in OBS

SPOUT is an output mechanism that some programs use to output video.  I think its (mostly) used by DJ world that generate video backgrounds. I dunno, thats where I've encountered it.

I use Synesthesia.live to generate background for an LED wall.  I run them through OBS to use it as a scaler and to allow me to intermix video elements generated through OBS to my video wall.

Synesthesia can output its generated backgrounds as a "SPOUT" feed, and with the proper plugin, OBS can import it.  Its really similar to NDI.

In Synesthesia, I activated the SPOUT server.



In OBS i installed a plugin for this location.

Backup location for the file exe

I installed that

Then created a Scene, and in that scene added an Source "Spout2Capture"



Selected the Synesthesia SPOUT feed (that was configured in the Synesthesia "Live Source" example above

Click OK and voila!




Friday, February 10, 2023

MSWINSCK.OCX problems

First, make sure that file is in windows\syswow64

Then open a CMD prompt as administrator and enter in

regsvr32 \windows\syswow64\mswinck.ocx


That should take care of it.



The error 0x8002801c occurs when there’s a problem accessing the OLE (Object Linking and Embedding) registry. Insufficient system permissions will trigger this error code when the registration of an OCX (OLE control extension) file fails to complete. This is known to happen frequently when using regsvr32 via Command Prompt on Windows 7.

It’s a common occurrence to see this error code when trying to register an OCX file from C:\ Windows\ system 32. Most of the time, the call to the DLLRegisterServer fails because of a permission problem and has nothing to do with the actual OCX component that you are trying to register.

Fortunately, the error 0x8002801c can be avoided by copying the OCX file to C:\ Windows\ SysWOW64 and repeating the operation with administrator privileges. If you’re currently dealing with this issue, follow the step by step guide below to eliminate the error 0x8002801c and successfully register your OCX File.

Fixing Error 0x8002801c after OCX File Registration fail

  1. Open File Explorer and navigate to your Windows partition. Next, go to Windows > Windows 32 and use the search bar to look for the OCX file.
    Note: In this case, the file name is MSCOMCT2.OCX, but you can replicate this procedure any OCX component that fails to register.
  2. Copy the OCX file to your clipboard. Next, go back to the Windows folder and open up the folder named sysWOW64. Then, simply paste the OCX file there.
  3. Open the Start menu (bottom-left corner) and type “cmd“. Then, right-click on Command Prompt and click on Run as Administrator.
  4. In the Elevated Command prompt, type regsvr32 + the OCX component. In our case, the final command would be “regsvr32 MSCOMCT2.OCX”. Upon hitting enter, you will be prompted with a message telling you the file was successfully registered.

That’s it. You can use these four steps to grant proper permissions to any OCX file that is causing the 0x8002801c error code. Most of the time it will allow you to register the ActiveX component and eliminate the issue.


Tuesday, February 7, 2023

Sony SRG-x120 VISCA pinout

 Here's a link to the PDF this comes from:






Some general Asterisk dialpaln code

Save a Voice recording into a MySQL database

Here is an example of an Asterisk dialplan that asks for a voice recording and then saves it into a MySQL database:

[macro-record-and-save]

exten => s,1,Answer()
exten => s,2,Record(recording:/tmp/recording)
exten => s,3,System(mysql -u [username] -p[password] -h [host] [database] -e "INSERT INTO recordings (filename) VALUES ('/tmp/recording')")
exten => s,4,Hangup()

Replace the square bracket placeholders with the values for your setup
MySQL username, password, host, and database name. 



Example IVR dialplan for Asterisk:

[ivr]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Playback(welcome-to-our-company)
exten => s,4,Wait(1)
exten => s,5,Background(press-1-for-sales)
exten => s,6,Background(press-2-for-support)
exten => s,7,Background(press-3-for-billing)
exten => s,8,Background(or-stay-on-the-line)
exten => s,9,WaitExten(10)

exten => 1,1,Goto(sales,s,1)
exten => 2,1,Goto(support,s,1)
exten => 3,1,Goto(billing,s,1)

[sales]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Playback(sales-department)
exten => s,4,Wait(1)
exten => s,5,Background(sales-representative)
exten => s,6,WaitExten(10)

[support]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Playback(support-department)
exten => s,4,Wait(1)
exten => s,5,Background(support-representative)
exten => s,6,WaitExten(10)

[billing]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Playback(billing-department)
exten => s,4,Wait(1)
exten => s,5,Background(billing-representative)
exten => s,6,WaitExten(10)

When a call comes in, they here a welcome message followed by options to press 1 for sales, 2 for support, or 3 for billing.

If the caller presses 1, they are transferred to the sales extension.
If the caller presses 2, they are transferred to the support extension.
If the caller presses 3, they are transferred to the billing extension.
If the caller does not press a key, they stay on the line for 10 seconds before being disconnected.

Each department extension plays a message indicating which department the caller has been transferred to and then waits for 10 seconds for a representative to answer.


Dialplan that asks a user for their passcode and performs a MySQL lookup to compare it:

[passcode-lookup]
exten => s,1,Answer()
exten => s,2,Background(enter-passcode)
exten => s,3,WaitExten(10)
exten => s,4,GotoIf($[${LEN(${EXTEN})} = 4]?check)
exten => s,5,Background(invalid-passcode)
exten => s,6,Goto(s,2)

; check the passcode against the database
exten => s,n(check),Set(DB_RESULT=${MYSQL(SELECT id FROM passcodes WHERE passcode='${EXTEN}')})
exten => s,n,GotoIf($[${DB_RESULT} = 0]?incorrect)
exten => s,n,Background(passcode-accepted)
exten => s,n,Hangup()

; play "incorrect passcode" and go back to the beginning
exten => s,n(incorrect),Background(incorrect-passcode)
exten => s,n,Goto(s,2)

The Answer command answers the caller.
The Background command plays a message asking the caller to enter their 4 digit passcode. The WaitExten command waits for 10 seconds for the caller to enter a 4-digit passcode.

The GotoIf command is used to check the length of the entered passcode. If the length of the entered passcode is not 4 digits, the dialplan will play "invalid passcode" prompt and go back to the beginning.

The Set command is used to perform a MySQL lookup to compare the entered passcode against the passcodes in the database. The MYSQL function returns the id of the passcode if it is found in the database, and 0 if it is not found.

The GotoIf command is used to check the result of the MySQL lookup. If the result is 0, the dialplan plays an "incorrect passcode" message and goes back to the beginning. If the passcode is found in the database, the dialplan plays a "passcode accepted" message and hangs up the call.

Note: This dialplan assumes that you have a MySQL database set up with a table named passcodes containing a column named id and a column named passcode. You will need to modify the MySQL query to match the structure of your database.

Sunday, February 5, 2023

Setting up Sony SRG X120 X400 cameras with RM-IP controllers

This is a kind of high-level setup of X120 cameras.  

Essentially:

Cameras will need to be accessible from the IP network as the controller.  You can  HTTP to each camera's ip address and lock in an IP address.

Then use the IP controller app SONY PTZ SRG-X120 - Google Drive called "RM-IP" 

Make sure that you have the cameras setup into group and with unique names.  The group number coincides with the RM-IP10 controller.

On the controller itself there are two rows of DIP switches.  Bottom row, #8, you set to on to allow writing.  Power cycle the controller, the lights on the controller will blink continuously.

Go to the RMIP app, and you should be able to select the controller (assuming all on same network).
under "CAMERA TABLE" what I do is select the spots that I want to occupy a camera, then use "AUTO ASSIGN" then assign the IP range(s) of the cameras I want.

Apply it, and then once you have done that.  Flip the switch 8 on the controller back to normal position and power cycle it.  Should be good to go.