0

I usually don't like to post questions because I would rather figure things out myself, but I am ready to pull my hair out with this one. I am trying to interface with a Sony IP Camera using Java. One of the products of the company I work for uses a Sony IP camera (IPela EP550). I have been tasked with writing the new interface. I can connect to the stream using the VLC ActiveX embedded control, but I can't manipulate the PTZ of the camera from in Java. If I type: "http://xxx.xxx.xxx.xxx/command/ptzf.cgi?Move=left,0" in a web browser it will move, but I have tried every bit of code I can find with Google to get it to move with no success. This last thing I tried (because a page on Oracle said all I should have to do is open the connection):

URL url1 = new URL("http://xxx.xxx.xxx.xxx/command/ptzf.cgi?Move=left,0&t="+new Date().getTime());
HttpURLConnection con = (HttpURLConnection)url1.openConnection();

Any help will be appreciated. Thank you. Joe

Joe McCay
  • 41
  • 8

2 Answers2

0
  1. Check out whether the camera needs login.
  2. type the url in the browser, get HTTP request header and put header data into your code!
Kevinsss
  • 754
  • 7
  • 7
  • The camera only needs a login to change the setting when you are connected to it's main interface. When you enter the URL as I typed it above (with the appropriate IP address), no webpage is return the action in the camera just happens. – Joe McCay Jul 29 '16 at 14:32
0

I figured out how to do this. I am posting the solution in case anybody is looking to fix a similar problem. I took the basic idea in this Dr. Dobbs article and used it to get movement from the camera. I don't yet know why I can't get the camera to respond with URLConnection and HttpURLConnection, but using a Socket and PrintWriter to specifically print the GET request to the socket.

Joe McCay
  • 41
  • 8