Openvino movidius cant read IP camera

884 Views Asked by At

id like to make my movidius NCS1 read a IP camera. this is my code:

import cv2

#print("Before URL")
cap = cv2.VideoCapture('rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0')
#print("After URL")

while True:

    #print('About to start the Read command')
    ret, frame = cap.read()
    #print('About to show frame of Video.')
    print(ret,frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

but im my debug tests. i created a new user in my raspberry and installed the opencv for it using pip. i if run this code in this user that dont have openvino initialized it run fine. but in Openvino env it cant read the camera steam.

how to solve it?

1

There are 1 best solutions below

3
Rashmi T On

Are you getting an "MFX can't initialize session error" while running with openvino environment?

OpenCV that comes with openvino is built with MFX enabled. MFX will be used for decoding your video frames. If you are able to decode frames in non-openvino environment, I would suggest you to disable MFX in openvino's opencv or uninstall opencv. In the setupvars file from intel/openvino/bin folder, you can change the opencv path to point to another installed opencv.