NIVision libraries not working

I’m having trouble implementing the NIVision wrappers for FRC (I’m choosing to use the NIVision libraries because in the pass we have used them to use two usb cameras on the robot with relative ease). When I try to use them however I get an error on the Riolog looking like this:

java.lang.UnsatisfiedLinkError: /usr/local/frc/lib/ cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(
	at java.lang.ClassLoader.loadLibrary(
	at java.lang.Runtime.loadLibrary0(
	at java.lang.System.loadLibrary(
	at org.usfirst.frc.team3205.robot.commands.cameraOneInit.<init>(
	at org.usfirst.frc.team3205.robot.OI.<init>(
	at org.usfirst.frc.team3205.robot.Robot.robotInit(
	at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(
	at edu.wpi.first.wpilibj.RobotBase.main(

I checked the location for which the library is located and I see the .so file that the error is referring to. How exactly do I fix this?

NIVision was removed from WPILib. You can use the CameraServer class to easily stream multiple USB cameras to the driver station.

This is typically done with

UsbCamera camera = CameraServer.getInstance().startAutomaticCapture("A Camera", 0);
camera.setResolution(160, 90); // Or whatever resolution you want to stream
camera.setFps(10); // Or whatever FPS you want to stream at

The same code can be reused for another camera. Just use a different name and device number to identify it

Thanks. Is there a way to switch between camera streams so that we don’t use too much bandwidth, allowing for a higher resolution/FPS?

MjpegServer server = new MjpegServer("Robot camera", 1189);
UsbCamera camera1 = new UsbCamera("<name>", 0);
UsbCamera camera2 = new UsbCamera("<name>", 1);

// set up the cameras...

// The condition can look at a button press in teleopPeriodic,
// or this can be run in a command to switch the streams
if (useCamera1) {
} else {

I’d personally put the toggling in a command. That makes it easier to use in the command-based framework