seffra
seffra

Reputation: 11

Cannot open ip camera with opencv4.1.0-openvino on respberry pi 4

I need to access video stream from AXIS M1125 Network Camera with my raspberry pi 4.

I have a code that works on my laptop and raspberry pi 3. I use opencv 4.1 which comes in openvino distribution for raspbian.

camera = cv2.VideoCapture('http://192.168.1.38/axis-cgi/jpg/image.cgi')

When I run the code and debug OPENCV_VIDEOCAPTURE_DEBUG the output is:

[ WARN:0] VIDEOIO(FFMPEG): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(FFMPEG): backend is not available (plugin is missing, or can't be loaded due dependencies or it is not compatible)
[ WARN:0] VIDEOIO(GSTREAMER): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
(python3:6939): GStreamer-CRITICAL **: 14:32:38.521: 
Trying to dispose element appsink0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
...
[ WARN:0] VIDEOIO(GSTREAMER): can't create capture
[ WARN:0] VIDEOIO(V4L2): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(V4L2): can't create capture
[ WARN:0] VIDEOIO(CV_IMAGES): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(CV_IMAGES): created, isOpened=0
[ WARN:0] VIDEOIO(CV_MJPEG): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(CV_MJPEG): can't create capture

The output from cv2.getBuildInformation():

Platform:
    Timestamp:                   2019-03-19T16:11:44Z
    Host:                        Linux 4.13.0-45-generic x86_64
    Target:                      Linux 1 arm
    CMake:                       3.7.2
    CMake generator:             Ninja
    CMake build tool:            /usr/bin/ninja
    Configuration:               Release

Video I/O:
    FFMPEG:                      YES
      avcodec:                   YES (57.64.101)
      avformat:                  YES (57.56.101)
      avutil:                    YES (55.34.101)
      swscale:                   YES (4.2.100)
      avresample:                NO
    GStreamer:                   YES (1.10.4)
    v4l/v4l2:                    YES (linux/videodev2.h)

Upvotes: 1

Views: 752

Answers (2)

Regardless of the function of OpenVINO, it can be processed by OpenCV.

import cv2
cap = cv2.VideoCapture("http://username:[email protected]:port/xxxx")
#cap = cv2.VideoCapture("http://username:[email protected]:port")
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()

Please refer https://software.intel.com/en-us/forums/computer-vision/topic/801714

Hope this helps.

Upvotes: 1

O Dundar
O Dundar

Reputation: 90

Have you completed installing all the dependencies? under /opt/intel/openvino/install_dependencies. I also suggest to check running the demo application if it is running and you still have the problem.

Upvotes: 1

Related Questions