1

I have read Firewire 1394 camera with OpenCV, Firewire camera with OpenCv 2.4. not working, ctypes error: libdc1394 error: Failed to initialize libdc1394 but I have found no working solution up to now.

How to open a Firewire dc1394 camera on Windows with OpenCV?

I installed it with pip install opencv-python. Is there a specific version of OpenCV to install to use the libdc1394 on Windows?

This code:

import cv2  
cam = cv2.VideoCapture(cv2.CAP_FIREWIRE + 0)      # like in https://answers.opencv.org/question/203165/opencv-3-python-3-firewire-cameras/
# or is it this instead:
# cam = cv2.VideoCapture(0, cv2.CAP_FIREWIRE)
while True:
    ret_val, img = cam.read()
    cv2.imshow('test', img)
    if cv2.waitKey(1) == 27: 
        break  # esc to quit

does not find any device. Is there something specific to be able to open FireWire cameras with OpenCV Python for Windows?

(see also this opencv.org question)

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
Basj
  • 41,386
  • 99
  • 383
  • 673
  • 1
    Have you tried `print(cv2.getBuildInformation())`? With OpenCV version 4.5.5 on Windows 10, I am getting: `DC1394: NO`. It is not so difficult to build OpenCV from sources with FireWire enabled. In case you never built OpenCV from sources, it is going to be a bit challenging at the first time. – Rotem May 25 '22 at 20:50
  • Wonderful info @Rotem! Do you think there are premade OpenCV Python Releases with DC1394 included? For example Gohlke's page https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv I don't know if it includes this DC1394. – Basj May 25 '22 at 20:56
  • @Rotem If I achieve to build a custom OpenCV version with this, do you think `cam = cv2.VideoCapture(cv2.CAP_FIREWIRE + 0)` is the right way to connect? (like in my question's last link). Or would it be `cv2.VideoCapture(0, cv2.CAP_FIREWIRE)`? or something else? – Basj May 25 '22 at 21:02
  • I think it should be `cap = cv2.VideoCapture(cv2.CAP_FIREWIRE, 0)` but I never tried to capture FireWire. I don't know if there is premade releases with DC1394. – Rotem May 25 '22 at 21:09
  • 1
    @Rotem I'm not sure, but it seems to be the opposite order for the parameters: https://stackoverflow.com/a/63423961/1422096. Do you confirm? – Basj May 25 '22 at 21:23
  • Yes, my mistake: `cap = cv2.VideoCapture(0, cv2.CAP_FIREWIRE)` – Rotem May 25 '22 at 22:13

0 Answers0