View Single Post
  #2   Spotlight this post!  
Unread 07-01-2016, 12:25 PM
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Need help loading Axis Camera feed in Java

We have some Java code available on github that provides some examples of opening a video feed using the OpenCV methods.

The project can be found at:

https://github.com/frc868/2016-Vision

In particular the FrameGrabber.java class (https://github.com/frc868/2016-Visio...meGrabber.java).
  • The open(String url, int devId, int width, int height) method demonstrates the OpenCV methods we use to connect to the video capture device.
  • The run() method within the CaptureThread class (also in FrameGrabber.java) demonstrates opening and reading in frames.

We did find that determining the correct URL for cameras was a bit tricky. For the Axis M1103 at IP 10.8.68.11, we ended up using:

http://10.8.68.11/mjpg/video.mjpg

This seemed to have lower latency than using the H264 encoding available at:

rtsp://10.8.68.11:554/axis-media/media.amp?videocodec=h264

Finally, setting up your OpenCV environment can be tricky. If the necessary libraries aren't found, you can easily find yourself in a situation where you can grab still images just fine from the camera just fine, but are unable to grab a live stream.

Hope that helps.
Reply With Quote