Ask Your Question

OpenCV, & an Axis Camera (cannot open connection)

asked 2014-10-14 13:48:19 -0500

Dereck gravatar image

updated 2014-10-15 08:30:55 -0500

I grabbed the latest copy of the JDK, OpenCV, and Eclipse and I want to simply read in the live video stream from an Axis M1013 camera and display it (running windows 7 x64).

I've spent a few hours at it and found plenty of other posts with code they used to connect to the camera but it appears not to work for me.

Here's what I have:

import org.opencv.core.Core;
import org.opencv.highgui.VideoCapture;

public class HelloCV {
    public static void main(String[] args) {
        System.out.println("Welcome to OpenCV " + Core.VERSION);

        VideoCapture capture = new VideoCapture();"");

        if (capture.isOpened()) 
            System.out.println("Video link open.");
            System.out.println("Video link not open.");    

But the connection never opens, here's the output:

Welcome to OpenCV 
Video link not open.

I can use that url in VLC to view the live stream, so I am of the belief that the camera is correctly configured and the network is properly set up. Suggestions greatly appreciated.


I installed python and had the same problem, here's the code:

import cv2
cam = cv2.VideoCapture("")

Returns false.


As an update, I found this chunk of code, and it showed the video feed:

Although that snippet is in python, that's one step closer to solving the mystery here. I still want to know how to use the opencv VideoCapture class so that I can program in Java, suggestions very much appreciated.

UPDATE #3 The solution for Python was on:

UPDATE #4 I finally have it working in Java and python. I simply copied opencv/sources/3rdparty/ffmgeg/opencv_ffmpeg_64.dll to c:\windows\system32\opencv_ffmpeg2410_64.dll and ran the java application and it worked as expected~!

(I'm apparently not allowed to add an answer to my own question for another day, so I'll just leave this here in case I forget.)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-10-22 23:07:11 -0500

Dereck gravatar image

Updated above.

edit flag offensive delete link more


Hello Dereck!! Do you know if it's possible to build an app including openCV code and install into the axis cam ?

Thank you very much in advance

axis cam embedded application with openCV gravatar imageaxis cam embedded application with openCV ( 2017-10-09 06:12:14 -0500 )edit

^^ please do not post answers, if you have a question or comment here, thanks.

berak gravatar imageberak ( 2017-10-09 06:23:01 -0500 )edit

Question Tools


Asked: 2014-10-14 13:48:19 -0500

Seen: 2,553 times

Last updated: Oct 22 '14