Results 1 to 3 of 3

Thread: Capturing Images From an IP Camera

  1. #1

    Default Capturing Images From an IP Camera

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Capturing Images From an IP Camera

    Hi,

    Do you know in wich format the camera returns the data?
    Òscar Llarch i Galán

  3. #3

    Default Re: Capturing Images From an IP Camera

    I've solved it

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

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

Similar Threads

  1. Connect camera in Qt?
    By nthung in forum Qt Programming
    Replies: 12
    Last Post: 25th May 2010, 11:19
  2. IP camera
    By vinod sharma in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2010, 13:41
  3. Capturing VIDEO from USB Camera
    By Rajeshsan in forum Newbie
    Replies: 6
    Last Post: 10th March 2010, 10:23
  4. Camera Detection
    By tiho_bg in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2009, 20:09
  5. Replies: 4
    Last Post: 27th July 2009, 15:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.