misterhay / VISCA-IP-Controller

Python code for controlling PTZ cameras using VISCA commands over IP
The Unlicense
82 stars 28 forks source link

How to use with cameras that need a username and password? #17

Open nbkn865 opened 1 year ago

nbkn865 commented 1 year ago

I have an Avkans NDI PTZ camera with not much documentation.

I can access it via a web browser app provided by the manufacturer, and I need to log in to it.

As for trying to control it using your Python package, is there a way to put in a username and password?

Maybe I'm thinking about it wrong, and the username/password has nothing to do with Visca?

In any case, here's how I set up the camera for Visca:

image

I also have the IP address of the camera used to access it by the browser, which I won't post here

Given the camera's IP address and the above UDP port, how would I initialize the Camera?

I tried the below, and also without a port, but I can't seem to connect

cam = Camera('<cam IP>', port=1259)

misterhay commented 1 year ago

It looks like those cameras support VISCA over IP, so they should work with this library. Make sure the IP address in the line cam = Camera('192.168.0.70', port=1259) is the same as the IP address you are using for the web interface.

nbkn865 commented 1 year ago

Hi, thanks for the quick reply, much appreciated!

I did use the same IP address as what's in the web browser, and I tried the simple usage example in https://visca-over-ip.readthedocs.io/en/latest/tutorial.html#installation of moving the camera around, but nothing happened.

I looked through the class methods and tried get_pantilt_position() to see if I can read from the camera, but got a NoQueryResponse: Could not get a response after 5 tries.

Is there a simple method I can write to check the connection status? That might be a good enhancement to the code, so that users can check that things did in fact connect.

DanTappan commented 2 weeks ago

you should use port 52381 for SONY Visca over IP with the AVKANS cameras. I believe port 1259 wants a raw visca encapsulation without the SONY headers

misterhay commented 1 week ago

Good catch @DanTappan. Hopefully that helps @nbkn865.