jar包(均可从webcam-capture官方github上下载:https://github.com/sarxos/webcam-capture):
webcam-capture-0.3.12.jar
bridj-0.7.0.jar
slf4j-api-1.7.2.jar
webcam-capture-driver-v4l4j-0.3.12.jar
v4l4j-0.9.1-r507.jar
最重要一点,全新安装的Raspbian,需要增加一个库libjpeg8
sudo apt-get install libjpeg8-dev
测试代码:
public class Test { static { Webcam.setDriver(new V4l4jDriver()); } public static void main(String[] args) { JFrame frame = new JFrame("V4L4J Webcam Capture Driver Demo"); frame.add(new WebcamPanel(Webcam.getDefault())); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }