2018-08-09 17:33:54 +08:00
|
|
|
|
# PiCamCar
|
2018-08-09 18:32:02 +08:00
|
|
|
|
一个带有摄像头的简单远控小车,基于树莓派3B。
|
2018-08-09 17:47:29 +08:00
|
|
|
|
|
2018-08-09 17:50:09 +08:00
|
|
|
|
ffmpeg采集摄像头画面并推流到本地rtmp,
|
2018-08-09 17:47:29 +08:00
|
|
|
|
|
2018-08-09 17:50:09 +08:00
|
|
|
|
livego监听本地rtmp并转为http-flv视频流,
|
2018-08-09 17:47:29 +08:00
|
|
|
|
|
2018-08-09 17:50:09 +08:00
|
|
|
|
web页面用flv.js播放http-flv,调用php页面执行GPIO操作,完成小车控制。
|
2018-08-09 17:47:29 +08:00
|
|
|
|
|
2018-08-09 17:33:54 +08:00
|
|
|
|
## Usage
|
2018-08-09 17:58:02 +08:00
|
|
|
|
- 自行编译安装ffmpeg,wiringpi
|
|
|
|
|
- 运行 `sudo modprobe bcm2835-v4l2`解决摄像头驱动
|
|
|
|
|
- <a href="https://github.com/gwuhaolin/livego/releases">点此</a>下载对应版本的livego
|
|
|
|
|
- 运行sh目录下的 `openCam.sh`
|
2018-08-09 18:08:20 +08:00
|
|
|
|
- 更改car.php文件第64行的url为livego的flv路径(具体请参考[这里](https://github.com/gwuhaolin/livego/blob/master/README.md))
|
2018-08-09 17:58:02 +08:00
|
|
|
|
- 访问car.php页面应该就可以了吧
|
2018-08-09 18:08:20 +08:00
|
|
|
|
- 完了记得执行 `closeCam.sh`关掉摄像头
|
2018-08-09 17:50:09 +08:00
|
|
|
|
</ol>
|
2018-08-09 17:47:29 +08:00
|
|
|
|
|
|
|
|
|
|
2018-08-09 17:33:54 +08:00
|
|
|
|
用到的开源项目:<a href="https://github.com/Bilibili/flv.js">flv.js</a>、<a href="https://github.com/gwuhaolin/livego">livego</a>、<a href="https://ffmpeg.org/">FFmpeg</a>、<a href="http://wiringpi.com/">Wiring Pi</a>。感谢大佬们。
|
2018-08-09 18:22:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 它最后长这b样
|
|
|
|
|
|
2018-08-09 18:34:49 +08:00
|
|
|
|
#### 没开摄像头时:
|
2018-08-09 18:28:51 +08:00
|
|
|
|
![demo1](https://raw.githubusercontent.com/jiacai-wang/PiCamCar/master/picture/demo1.png)
|
2018-08-09 18:34:49 +08:00
|
|
|
|
#### 开了摄像头:
|
2018-08-09 18:28:51 +08:00
|
|
|
|
![demo2](https://raw.githubusercontent.com/jiacai-wang/PiCamCar/master/picture/demo2.png)
|
2018-08-09 18:34:49 +08:00
|
|
|
|
#### 小车:
|
2018-08-09 18:28:51 +08:00
|
|
|
|
![demo3](https://raw.githubusercontent.com/jiacai-wang/PiCamCar/master/picture/demo3.jpg)
|
2018-08-09 18:22:27 +08:00
|
|
|
|
|