PDA

View Full Version : Capturing Images From an IP Camera



mennaSiam
27th September 2010, 09:37
Hi

I am trying to connect to an ip cam using its ip address and capture images from it
I am using QHttp requests

here's my code snippet:

url.setPath("/eng/index.cgi");
http->setHost("192.168.10.86", 80);
http->setUser("admin","");

http->get(url.toString());

and this is the function that's called on "done" signal

void updateForm(bool error)
{
if (!error) {
QImage image;
if (image.loadFromData(http->readAll())) {
QPixmap pixmap = QPixmap::fromImage(image);
ui.label->setPixmap(pixmap);
}
}
}

the problem is loadFromData issues an error it can't read the image?

^NyAw^
27th September 2010, 09:41
Hi,

Do you know in wich format the camera returns the data?

mennaSiam
27th September 2010, 10:02
I've solved it

I was connecting with the wrong url
I should've used

url.setPath("/image/jpeg.cgi");