Closed sachinrke closed 5 years ago
If you want to use an Ovif device try to have a look at https://github.com/fpompermaier/onvif/blob/master/udoo-bot/src/main/java/org/udoo/telegram/bot/TelegramMsgHandler.java.
You need to write something like:
try {
System.out.println("Connect to camera, please wait ...");
OnvifDevice cam = new OnvifDevice(deviceIp, user, password);
System.out.printf("Connected to device %s (%s)\n", cam.getDeviceInfo(), deviceName);
} catch (ConnectException | SOAPException e1) {
System.err.println("No connection to device with ip " + deviceIp + ", please try again.");
System.exit(0);
}
Then you can take a picture from the camera with:
MediaUri sceenshotUri = cam.getMedia().getSnapshotUri(profileToken);
File tempFile = File.createTempFile("tmp", ".jpg");
FileUtils.copyURLToFile(new URL(sceenshotUri.getUri()), tempFile);
hiii, i want to open my ptz camera in java using your library. please tell me how to open camera. thank you in advance.