I can't open the video camera in C++ using Qt but I'm able to in Python for an axis camera. It's able to display the video in Python
I was able to open a webcam and have it display video using VidoCapture cap(0); I've tried using the same url from the database in Python and it worked in python. Then I hard code the same rtsp url in C++ but it failed to even open the ip camera for video capture. I've tried replacing rtsp to http but still didn't work. I've tried putting ipAddress:port# but that didn't work either.
Python:
url = None
url = channel.url
print('channel.url: ' + url)
vs = cv2.VideoCapture(url)
print("camera " + str(url) + " is opened : " + str(vs.isOpened()))
Output: camera rtsp://username:[email protected]/axis-media/media.amp is opened : True
C++
VideoCapture cap("rtsp://username:[email protected]/axis-media/media.amp");
if(!cap.isOpened()) // check if we succeeded
qDebug() << "Failed to video capture";
else
qDebug() << "able to open camera";
Output: Failed to video capture
I'm trying to to successfully open the VideoCapture.