Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ctypes error: libdc1394 error: Failed to initialize libdc1394

I'm trying to compile my program to a shared library that I can use from within Python code using ctypes.

The library compiles fine using this command:

g++ -shared -Wl,-soname,mylib -O3 -o mylib.so -fPIC [files] `pkg-config --libs --cflags opencv` 

However, when I try and import it using ctypes

from ctypes import * mylib = CDLL("/path/to/mylib.so") print mylib.test() // Expected output: Hello World 

I get the following error:

libdc1394 error: Failed to initialize libdc1394 

What's going on?

like image 820
fredley Avatar asked Oct 02 '12 11:10

fredley


2 Answers

Very frustrating that nobody actually shows a concrete solution. I had this issue after installing OpenCV. For me the easiest solution to remove this warning was actually to disable this driver:

sudo ln /dev/null /dev/raw1394 
like image 119
Vad Avatar answered Sep 22 '22 00:09

Vad


libdc1394 is a library for controlling camera hardware. I presume it comes the opencv you link in. Maybe the kernel driver does not load ? I guess there is a number of reasons why it can fail.

Maybe some OpenCV expert can answer better. But I bet the problem is on OpenCV lib side.

Some initial search for the same error message yielded results with the same reason [1, 2]. So if you can't find /dev/raw1394 on your file system try those.

UPDATE:

It seems like this is only a warning. The module raw1394 seems to be deprecated and some libdc1394 version might be looking for it while it disappeared with an update. Searching for it gives many results and bug reports. But it seems that the software should run fine. So if you don't really need it you can just ignore it. [3, 4]

like image 35
luk32 Avatar answered Sep 26 '22 00:09

luk32