Open Koalk opened 10 years ago
I have been woking on my own trying to do at least the image retrieve with a basic extension of the IpCamDevice overriding the constructor and the getURL. The cam has an auth alert that ask for the username and password when you try to reach the URL of the image retrieve but I though that setting the auth of the IpCam as "new IpCamAuth(username,password)" should be enought.
Anyway when I start a new WebCamPanel with the IpCamDevice as it is done in the examples, the JFrame shows the "Image not available" message and there are no error message in the log so I am clueless about what could I be missing.
I have been doing some code in order to retrieve just the image from the cam.
By now I can only retrieve what the actual interface of mobotix is showing with a call to "http://(cam IP)/record/current.jpg".
I have been trying to use some other adresses from the http API like "http://(cam IP)/cgi-bin/faststream.jpg" in PUSH mode and "http://(cam IP)/cgi-bin/image.jpg" in PULL mode. The difference is that this calls accept extra options in order to change the size of the image and the format among others, but it was impossible to me to retrieve any image from there.
Also I am having some problems setting the resolution of the cam since it is throwing a null pointer exception when I try to do a getResolutions().
I will keep you posted with more information and here it is what I have been doing so far with the class. (let me know if you prefer a pull request or something like that to show you the code)
Do widzenia!
import java.net.MalformedURLException;
import java.net.URL;
import com.github.sarxos.webcam.WebcamException;
import com.github.sarxos.webcam.ds.ipcam.IpCamDevice;
import com.github.sarxos.webcam.ds.ipcam.IpCamMode;
public class MobotixCamIp extends IpCamDevice {
private URL base;
public MobotixCamIp(String name, String url) {
this(name, toURL(url));
}
public MobotixCamIp(String name, URL base){
super(name, null, IpCamMode.PULL);
this.base = base;
}
public MobotixCamIp(String name, URL url, IpCamMode pull) {
super(name,url,pull);
}
@Override
public URL getURL() {
// String url = String.format("%s%s",base,"cgi-bin/faststream.jpg?error=picture&preview&stream=full");
String url = String.format("%s%s",base,"record/current.jpg");
// if (this.getResolutions()!=null)
// url.concat(String.format("&size", this.getResolution().height,this.getResolution().width));
try {
return new URL(url);
} catch (MalformedURLException e) {
throw new WebcamException(String.format("Incorrect URL %s", url), e);
}
}
}
Hi! I need have a mobotix live view in a java program in pull mode (to get the best image rate). This library (sarxos) can do this with mobotix cam?? Can you help me?? Without this library, I try connect and reading from the DataInputStream, but only get ok the image in push mode (connect, read image, disconnect, connect, read image, disconnect...) with a bad rate (2fps), with the pull mode (connect, read, read, read...) I can´t get the images!!! I dont know the encapsulation mode (in axis I only have to discard first four lines and the last one, but no run with mobotix cams...)
Thanks in advance.
I'd like to have this cams added to the driver.
They have an extensive HTTP API and also an SDK. The http api is explained in this url and the SDK can be found in the Mobotix web page http://developer.mobotix.com/paks/help_cgi-remotecontrol.html
Also there is a public cam here http://80.122.26.250:7000/ that you can use as endpoint with guest permissions. I'm probably going to start trying to add it myself but since I don't have much knowledge in this topic is going to take a lot of time for me.
Thanks in advance.
PD: here you have a list of public address for cams of multiple types if you want to add more to the driver http://totalcontrolapp.com/index.php?option=com_content&task=view&id=55