本帖最后由 skyding1212 于 2014-11-25 00:46 编辑
最近在国外看到了关于树莓派的java调用摄像头模块的例子
http://www.codeproject.com/Artic ... Raspberry-Pi-to-NET
稍微有点开发经验的看这个应该就很熟悉了~- // Captured video: 320x240 pixels, 24 frames/s
- // And it also inserts SPS and PPS inline headers (-ih) so that
- // later connected clients can synchronize to ongoing video frames.
- String aToExecute = "raspivid -n -vf -hf -ih -w 320 -h 240 -fps 24 -t 0 -o -";
- myRaspiVidProcess = Runtime.getRuntime().exec(aToExecute);
- myVideoStream = myRaspiVidProcess.getInputStream();
复制代码 具体安装过程(基本会点英语的应该看得懂,实在不行百度吧)
Raspberry Pi service application - Open Java project raspberry-camera-service in Eclipse and add reference to eneter-messaging.jarwhich you downloaded.
(Right click on the project -> Properties -> Java Build Path -> Libraries -> Add External Jars -> eneter-messaging-6.0.1.jar) - Build the project and then export it to executable jar.
(Right click on the project -> Export... -> Java -> Runable JAR file -> Launch configuration -> Export Destination -> Package required libraries into generated JAR -> Finish.) - Copy the generated jar to the Raspberry device.
- Start the application
java -jar raspberry-camera-service.jar
.NET Client Application - Open RaspberryCameraClient solution and add reference toEneter.Messaging.Framework.dll which you downloaded.
- Check if the path VLC is correct in MainWindow.xaml.cs.
- Provide correct IP address to your Raspberry Pi service in MainWindow.xaml.cs.
- Compile and run.
- Press 'Start Capturing'.
本来准备发代码的 系统有字数限制就算了吧
具体的 大家看附件吧
|