jacksonliam / mjpg-streamer

Fork of http://sourceforge.net/projects/mjpg-streamer/
3.01k stars 1.23k forks source link

undefined symbol: _ZN2cv12VideoCaptureC1Ev #49

Closed jakinto closed 7 years ago

jakinto commented 7 years ago

Hi,

I'm trying to execute this command to stream from webcam, with low quality, to http:

mjpg_streamer -i 'input_opencv.so -d /dev/video0 -q 50' -o 'output_http.so -w ./www'

And I'm getting this error:

MJPG-streamer [15]: starting application
MJPG Streamer Version.: 2.0
MJPG-streamer [15]: MJPG Streamer Version.: 2.0

mjpg_streamer: symbol lookup error: ./input_opencv.so: undefined symbol: _ZN2cv12VideoCaptureC1Ev

Other inputs work fine. This must be related with OpenCV. Any ideas? Which parameters do you use when installing OpenCV?

Thanks in advance.

jacksonliam commented 7 years ago

Which version of opencv have you got installed?

jakinto commented 7 years ago

OpenCV 3.1

virtuald commented 7 years ago

Try this commit: https://github.com/robotpy/mjpg-streamer/commit/d558daa5b96a42ef18399cb857639e94fff06c2d

I've been meaning to PR it, but I haven't had a chance to actually test it on my Fedora machine to make sure it still works.

jakinto commented 7 years ago

Now I'm getting:

MJPG-streamer [781]: starting application
MJPG Streamer Version.: 2.0
MJPG-streamer [781]: MJPG Streamer Version.: 2.0

 i: device........... : /dev/video0
MJPG-streamer [781]: device........... : /dev/video0

 i: Desired Resolution: 640 x 480
MJPG-streamer [781]: Desired Resolution: 640 x 480

 i: VideoCapture::open() failed
MJPG-streamer [781]: VideoCapture::open() failed

Any ideas?

virtuald commented 7 years ago

Presume that you've checked that /dev/video0 exists? It might not support that resolution... there's a v4l tool you can use to query the webcam, I've forgotten what it's called...

jakinto commented 7 years ago

Using this command works:

mjpg_streamer -i 'input_uvc.so -d /dev/video0' -o 'output_http.so -w ./www'

So I don't think is related with the webcam.

jakinto commented 7 years ago

The problem was -d param. Remove it to use the default camera:

mjpg_streamer -i 'input_opencv.so -q 70' -o 'output_http.so -w ./www'

virtuald commented 7 years ago

Oh right! This must be related to https://github.com/opencv/opencv/pull/6391 -- if you patch your OpenCV installation with that, it should work. For some reason I thought that didn't apply to things like /dev/video0...