Skip to content
Advertisement

How can i connect ethernet connected camera through python (Flir AX8 camera)

I am trying to connect a Flir AX8 camera through python. This camera is connected to the ethernet port of the laptop. So, the VideoCapture() isn’t recognising the port, I’ve tried all indexes for it (0, 1, 2), but it doesn’t connect. Can anyone help me that how can i connect the camera to python?

I have tried connecting through VideoCapture(1) and through VideoCapture('IP address')

Using the IP address:

JavaScript

Using the index 0, 1, 2:

JavaScript

I am getting following error in both situations:

JavaScript

Advertisement

Answer

import cv2 import numpy as np

while True: cap=cv2.VideoCapture(‘http://admin:admin@169.254.253.219/snapshot.jpg?user=admin&pwd=admin&strm=0‘) ret,img=cap.read() cv2.imshow(‘videos output’,img) k=cv2.waitKey(1) if k==ord(‘q’): break

cap.release() cv2.destroyAllWindows

Advertisement