PDA

View Full Version : IP Camera interfacing



antweb
10th February 2015, 08:35
I have been using the IP Camera of a company called RCom and I want to interface it through Qt.
Presently with the help of networkaccessmanager I am able to ping every moment on this URL,
"http://192.168.0.12:8080/snapshot.cgi?user=admin&pwd="

and I am displaying it on a label and able to view my video. The problem with this approach is that if I use multiple cameras and keep on pinging every moment that will be very heavy on my processor. So now I want to handle by accessing the mjpeg URL. It is as follows:
"http://192.168.0.12:8080/videostream.cgi?user=admin&pwd="

The issue that I am facing is that this URL does not give me any network reply so I am unable to take my process further but when I use this same URL on VLC's network stream it shows me a proper live output which means that the URL is correct.
Please help me by telling how can I get a network reply and how can I handle mjpegs?

Thanks.

d_stranz
10th February 2015, 14:48
Does the camera use the same port (8080) for the mjpeg protocol as it uses for snapshot mode? What does the camera user manual say?

antweb
11th February 2015, 04:53
Yes it uses the same port. When I am logging onto this IP Address and playing the video stream option my URL catcher gives me this URL.
Moreover this URL also shows me video on VLC network stream as i had mentioned earlier. I have an open source software called ISpy which gives me the same URL for accessing MJPEG. So the URL is absolutely fine but I am unable to get a network reply.

anda_skoa
11th February 2015, 08:15
What do you mean with "not getting a network reply"?

The get() method should return a network reply immediatetly.

Cheers,
_

antweb
11th February 2015, 08:32
Here is my code

nam = new QNetworkAccessManager(this);
QObject::connect(nam, SIGNAL(finished(QNetworkReply*)),
this, SLOT(finishedSlot(QNetworkReply*)));
QObject::connect(nam, SIGNAL(error(QNetworkReply*)),
this, SLOT(errorSlot(QNetworkReply*)));

QUrl url("http://192.168.0.12:8080/snapshot.cgi?user=admin&pwd=");
QNetworkReply* reply;
reply = nam->get(QNetworkRequest(url));

So when I use the present URL it goes to finishedSlot but when I use the videostream URL. It doesn't!

anda_skoa
11th February 2015, 09:26
Well, your new URL is for a stream, no?
A stream doesn't end until either side disconnects.

Cheers,
_