2 Camera Sample Code Problems Using Library 2017.3.1

I downloaded the most recent WPILib library (2017.3.1), and the vision test sample no longer works. I rolled back the version, and it works. I have not been able to get any code using Sink/Source combination to work with the new Libraries, but they all work fine with the old. I am stumped, and if anyone notices something in the screen captures that would be appreciated:

Test Code (as deployed, based on sample posted)
http://wpilib.screenstepslive.com/s/4485/m/24194/l/669166-using-the-camera-server-on-the-roborio-2017

Works fine (displays gray scale image) under 2017.1.1, but not 2017.3.1 Screen captures attached.

package org.usfirst.frc.team1876.robot;

import edu.wpi.first.wpilibj.CameraServer;
import edu.wpi.first.wpilibj.IterativeRobot;
import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;

import edu.wpi.cscore.CvSink;
import edu.wpi.cscore.CvSource;
import edu.wpi.cscore.UsbCamera;
import edu.wpi.first.wpilibj.CameraServer;
import edu.wpi.first.wpilibj.IterativeRobot;

/**
 * Uses the CameraServer class to automatically capture video from a USB webcam
 * and send it to the FRC dashboard without doing any vision processing. This
 * is the easiest way to get camera images to the dashboard. Just add this to the
 * robotInit() method in your program.
 */
public class Robot extends IterativeRobot {
	@Override
	public void robotInit() {
            new Thread(() -> {
                UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();
                camera.setResolution(640, 480);
                
                CvSink cvSink = CameraServer.getInstance().getVideo();
                CvSource outputStream = CameraServer.getInstance().putVideo("Blur", 640, 480);
                
                Mat source = new Mat();
                Mat output = new Mat();
                
                while(!Thread.interrupted()) {
                    cvSink.grabFrame(source);
                    Imgproc.cvtColor(source, output, Imgproc.COLOR_BGR2GRAY);
                    outputStream.putFrame(output);
                }
            }).start();
    }
}



Found the problem. In the sample code, the following line will sometimes return an empty image. Adding a check corrects the problem (this only seems to affect library 2017.3.1

//From the sample code
//Note that source may be empty
cvSink.grabFrame(source);

//Add this line to prevent exception errors:
if (source.empty()) continue;

cvSink.grabFrame was changed in this release to time out if there is no frame in 225ms. There is another version of the function called: grabFrameNoTimeout that has the old behavior. It sounds like that’s what your seeing.

See the release notes here:
http://wpilib.screenstepslive.com/s/4485/m/13503/l/685689-issues-and-faqs-for-2017

Huge thanks, Brad, that explains the issue I am currently seeing.