To connect to an mjpg stream with OpenCV's VideoCapture object, OpenCV needs to have libav/ffmpeg support compiled in. The version of OpenCV that I distribute does not currently have libav support (see
issue #2). That's interesting that you were able to connect to an Axis camera, as that would also require libav.
When running the code on the RoboRIO, you should be able to use this URL:
http://localhost:5800/?action=stream
EDIT: It's possible that OpenCV 3.x does not require libav to connect to an mjpg stream.. but I know OpenCV 2 did require it. If you're connecting to the stream separately then that's would work too.