├── README.md
├── PDF
└── RaspiCam-Documentation.pdf
├── crtmpserver 简介.md
├── Dummy camera made smart with Raspberry Pi.md
├── Raspberry Surveillance.md
├── Streaming Raspberry Pi Camera H264 into HTML over RTMP.md
├── Raspberry PI with Camera Module and ArchLinux.md
├── 树莓派摄像头模块基础知识.md
└── RaspiCam Documentation.md
/README.md:
--------------------------------------------------------------------------------
1 | 树莓派
2 | ======
3 |
--------------------------------------------------------------------------------
/PDF/RaspiCam-Documentation.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silianlinyi/Raspberry-Pi/HEAD/PDF/RaspiCam-Documentation.pdf
--------------------------------------------------------------------------------
/crtmpserver 简介.md:
--------------------------------------------------------------------------------
1 | # crtmpserver 简介
2 |
3 | crtmpserver(C++ RTMP Server)是高性能的流媒体服务器,支持以下协议(直播或录制):
4 |
5 | * 支持Flash(RTMP,RTMPE,RTMPS,RTMPS,RTMPT,RTMPTE)
6 | * 支持嵌入式设备:iPhone,Android
7 | * 支持监控摄像机
8 | * 支持IP-TV(MPEG-tS,RTSP/RTCP/RTP)
9 |
10 | 此外,crtmpserver可以作为高性能rendes-vous服务器,可以让你做:
11 |
12 | * 音视频会议
13 | * 在线游戏
14 | * 在线协作
15 | * 简单/复杂的聊天应用
16 |
17 | crtmpserver不同之处
18 |
19 | * 支持多种流媒体技术之间的通信(Adobe flash, Apple streaming, Silverlight, etc)
20 | * 高性能,并发几千路连接
21 | * 占用资源少
22 | * 可移植性强,只要GCC支持,crtmpserver可以运行在: IP cameras, Android, ARM or MIPS based systems, SoC, etc
23 | * 依赖少:lua, openssl
24 |
25 | 参考网址:
26 |
27 | * 内核开发者 Gavriloaie Eugen-Andrei: http://www.rtmpd.com/
28 | * 开发者论坛 https://groups.google.com/forum/?fromgroups#!forum/c-rtmp-server
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Dummy camera made smart with Raspberry Pi.md:
--------------------------------------------------------------------------------
1 | # Dummy camera made smart with Raspberry Pi
2 |
3 | I'd like to share how I build my camera using Raspberry Pi. I used a dummy camera and turned into a smart camera!
4 | The total cost is about £100 / 1000 SEK / $150 =)
5 |
6 | I have also developed software to help use the Raspberry Camera for surveillance(监控). Check out these blog posts for
7 | further information.
8 |
9 | * 树莓派监控(Raspberry Surveillance)
10 | * Raspberry PI with Camera Module and ArchLinux
11 | * Owncloud 5 Server with Lighttpd, Sqlite on ArchLinux
12 |
13 | ## Camera
14 |
15 | I found these parts on Amazon.co.uk.
16 |
17 | * Raspberry PI Starter Kit - Power, SD-card, Raspberry 512MB
18 | * USB Wifi Adapter
19 | * Byron - CS11D Dummy CCTV Camera Unit
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ### 原文地址:http://bjurr.se/cam+dummy+made+pi+raspberry+smart
36 |
--------------------------------------------------------------------------------
/Raspberry Surveillance.md:
--------------------------------------------------------------------------------
1 | # 树莓派监控(Raspberry Surveillance)
2 |
3 | I reccently bought a Raspberry PI. The main reason was that I had an idea of making some video surveillance software.
4 | I have made 2 previous blog posts regarding the Raspberry Pi and both of them are sort of related this one. One where
5 | I wrote some notes on the initial setup of the hardware and basic software. One where I wrote about how to setup
6 | Owncloud. This post is about https://github.com/tomasbjerre/RaspberrySurveillance. It is project where I've developed,
7 | mainly, a web interface that can:
8 |
9 | * Show snapshot of camera
10 | * Setup motion triggering
11 | * Start and stop motion triggering
12 | * Save captured videos to disk
13 | * Save captured videos to Webdav (Supported by Owncloud)
14 |
15 | This means you can start and stop motion triggering from a web interface. Whenever a video is captured you can have
16 | it uploaded to Owncloud and have it automatically synced to you Windows PC.
17 |
18 |
19 |
20 | When camera triggers it will store pictures and/or vieos, it is configurable. Here is a very small example of a
21 | captured event.
22 |
23 | * Picture that detected change
24 | * Video recorded on trigger
25 | * Picture showing what was changed in picture
26 |
27 | ### 原文地址:http://bjurr.se/raspberry+surveillance
28 |
--------------------------------------------------------------------------------
/Streaming Raspberry Pi Camera H264 into HTML over RTMP.md:
--------------------------------------------------------------------------------
1 | ### Streaming Raspberry Pi Camera H264 into HTML over RTMP
2 |
3 | #### SPD Raspberry Pi Camera setup instructions for Raspbian Wheezy
4 |
5 | Requirements: Raspbian Wheezy with hard float enabled. I assume you have avahi, wifi, and have updated to the latest
6 | firmware and enabled the camera. 并且在树莓派上配置了一个Web服务器。
7 |
8 | 安装crtmpserver流媒体服务器:
9 |
10 | sudo aptitude install crtmpserver
11 |
12 | 注:aptitude 是 Debian GNU/Linux 系统中, 非常神奇的的软件包管理器,基于大名鼎鼎的 APT 机制, 整合了 dselect 和 apt-get的
13 | 所有功能, 并提供的更多特性,特别是在依赖关系处理上。
14 |
15 | 添加crtmpserver流媒体服务器日志目录
16 |
17 | sudo mkdir /var/log/crtmpserver
18 |
19 | 改变/etc/crtmpserver/applications/flvplayback.lua目录下的flvplayback.lua文件的某些值。
20 |
21 | validateHandshake=false,//验证握手
22 | keyframeSeek=false,//关键帧寻找
23 | seekGranularity=0.1
24 | clientSideBuffer=30//客户端缓存区
25 |
26 | 重启crtmpserver流媒体服务器
27 |
28 | sudo /etc/init.d/crtmpserver restart
29 |
30 | 源码方式安装ffmpeg,这一步骤是非常重要的。
31 | Install ffmpeg from source. This step is very important. It won't work with the Raspbian version of ffmpeg because the
32 | Debian version of libavcodec doesn't contain the H264 libraries needed for the flash streaming protocol.
33 |
34 | sudo aptitude remove ffmpeg
35 | cd /usr/src
36 | sudo mkdir ffmpeg
37 | sudo chown `whoami`:users ffmpeg
38 | git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
39 | cd ffmpeg
40 | ./configure
41 | make
42 | sudo make install
43 |
44 | Stream from raspberry pi camera to crtmpserver and wrap the raw video in flv metadata
45 |
46 | raspivid -t 0 -w 960 -h 540 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f flv -metadata
47 | streamName=myStream tcp://0.0.0.0:6666
48 |
49 | Check the crtmpserver logs. You should see the incoming connection from ffmpeg show up like this:
50 |
51 |
59 |
60 | Download jwplayer from http://www.longtailvideo.com/, unzip it and place the jwplayer folder in a directory of your
61 | web server. I got jwplayer version 3359, YMMV. Then, place the following in an html file in the same directory of
62 | your web server:
63 |
64 | > index.html
65 |
66 |
67 |
pi, and the default password is raspberry.
22 | (Note: if you have changed these from the default then you will need to supply your own user/password details).
23 |
24 | 在终端中输入以下命令,让树莓派固件升级到最新版本。
25 |
26 | sudo apt-get update
27 |
28 |
29 |
30 | sudo apt-get upgrade
31 |
32 |
33 |
34 | 运行以下命令来访问树莓派配置设置:
35 |
36 | sudo raspi-config
37 |
38 | 切换到“camera”并且选择“enable”
39 |
40 |
41 |
42 |
43 |
44 | 选择“Finish”并重启
45 |
46 |
47 |
48 | ## 如何使用树莓派摄像头软件(How to use the Raspberry Pi camera software)
49 |
50 | raspivid是一个命令行应用程序,可以让你录制视频,同时raspistill应用可以让你捕捉图像。
51 |
52 | -o或者-output可以指定输出文件名字,-t或者-timeout可以指定预览时长
53 | (毫秒)。Note that this set to 5s by default and that raspistill will capture the final frame of
54 | the preview period.
55 |
56 | -d or –demo runs the demo mode that will cycle through the various image effects that are available.
57 |
58 | ## 例子
59 |
60 | 截一张jpeg格式的图片:
61 |
62 | raspistill -o image.jpg
63 |
64 | 录一段5秒钟的h264格式的视频:
65 |
66 | raspivid -o video.h264
67 |
68 | 录一段10秒钟的视频:
69 |
70 | raspivid -o video.h264 -t 10000
71 |
72 | 在演示模式下录一段10秒钟的视频:
73 |
74 | raspivid -o video.h264 -t 10000 -d
75 |
76 | To see a list of possible options for running raspivid or raspistill, you can run:
77 |
78 | raspivid | less
79 | raspistill | less
80 |
81 | 使用方向键滚动,输入q退出。
82 |
83 | 想了解更多:https://github.com/raspberrypi/userland/blob/master/host_applications/linux/apps/raspicam/RaspiCamDocs.odt
84 |
85 | 请注意:如果你使用了一个摄像头,请修改SSH密码,以防止非法访问。
86 |
87 | ## 如何通过网络将树莓派摄像头中的视频流传播出去
88 |
89 | ### 1. To view the feed on Linux
90 |
91 | 通过在终端中输入以下命令来安装依赖:
92 |
93 | sudo apt-get install mplayer netcat
94 |
95 | Find your IP address by running ifconfig. (Your IP address will be listed in the console output and will probably be
96 | of the form 192.168.1.XXX).
97 |
98 | Run the following command in a terminal to view the feed using MPlayer:
99 |
100 | nc -l -p 5001 | mplayer -fps 31 -cache 1024 -
101 |
102 | ### 2. To view the feed on Windows
103 |
104 | Install and run Linux instead.
105 |
106 | Find your IP address by running ipconfig. (Your IP address will be listed in the console output and will probably be
107 | of the form 192.168.1.XXX).
108 |
109 |
110 | Download MPlayer.
111 | raspivid and raspicam here.
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/RaspiCam Documentation.md:
--------------------------------------------------------------------------------
1 | # RaspiCam Documentation
2 |
3 | ## July 2013
4 | This document describes the use of the three Raspberry Pi camera applications as of July 2013.
5 |
6 | 这份文档介绍了如何使用树莓派的三个摄像头应用程序。
7 |
8 | There are three applications provided: raspistill, raspivid and raspistillyuv. Both raspistill and raspistillyuv
9 | are very similar and are intended for capturing images, while raspivid is for capturing video.
10 |
11 | 树莓派提供了三个应用程序:raspistill,raspivid,raspistillyuv。其中raspistill和
12 | raspistillyuv是非常类似的,它们都被用于截图,raspivid用于录像。
13 |
14 | All the applications are command-line driven, written to take advantage of the mmal API which runs over OpenMAX. The
15 | mmal API provides an easier to use system than that presented by OpenMAX. Note that mmal is a Broadcom specific API used
16 | only on Videocore 4 systems.
17 |
18 | The applications use up to four OpenMAX(mmal) components camera, preview, encoder and null_sink. All applications
19 | use the camera component: raspistill uses the Image Encode component, raspivid uses the Video Encode component,
20 | and raspistillyuv does not use an encoder, and sends its YUV or RGB output direct from camera component to file.
21 |
22 | The preview display is optional, but can be used full screen or directed to a specific rectangular area on the display.
23 | If preview is disabled, the null_sink component is used to 'absorb' the preview frames. It is necessary for the camera
24 | to produce preview frames even if not required for display, as they are used for calculating exposure and white balance
25 | settings.
26 |
27 | In addition it is possible to omit the filename option, in which case the preview is displayed but no file is written,
28 | or to redirect all output to stdout. Command line help is available by typing just the application name in on the
29 | command line.
30 |
31 | ## Setting up the camera hardware
32 | Please note that camera modules are static-sensitive. Earth yourself prior to handling the PCB: a sink tap/faucet or
33 | similar should suffice if you don’t have an earthing strap.
34 |
35 | The camera board attaches to the Raspberry Pi via a 15-way ribbon cable. There are only two connections to make:
36 | the ribbon cable need to be attached to the camera PCB and the Raspberry Pi itself. You need to get it the right way
37 | round, or the camera will not work. On the camera PCB, the blue backing on the cable should be facing away from the PCB,
38 | and on the Raspberry Pi it should be facing towards the Ethernet connection (or where the Ethernet connector would be
39 | if you are using a model A).
40 |
41 | Although the connectors on the PCB and the Pi are different, they work in a similar way. On the Raspberry Pi, pull up
42 | the tabs on each end of the connector. It should slide up easily, and be able to pivot around slightly. Fully insert
43 | the ribbon cable into the slot, ensuring it is straight, then gently press down the tabs to clip it into place. The
44 | camera PCB itself also requires you to pull the tabs away from the board, gently insert the cable, then push the tabs
45 | back. The PCB connector is a little more awkward than the one on the Pi itself. You can watch a video showing you how
46 | to attach the connectors at www.raspberrypi.org/archives/3890 (scroll down for the video).
47 |
48 | ## Setting up the Camera software
49 |
50 | ## 通用命令行选项
51 |
52 | ### 预览窗口(Preview Window)
53 | > --preview, -p 预览窗口设置 <'x,y,w,h'>
54 |
55 | raspivid -o out.h264 -t 0 -p '0,0,400,300'
56 |
57 | Allows the user to define the size and location on the screen that the preview window will be placed. Note this will be
58 | superimposed over the top of any other windows/graphics.
59 |
60 | > --fullscreen, -f 全屏预览模式
61 |
62 | Forces the preview window to use the whole screen. Note that the aspect ratio of the incoming image will be retained,
63 | so there may be bars on some edges.
64 |
65 | > --nopreview, -n, 禁用预览窗口
66 |
67 | 完全禁用预览窗口。请注意:尽管预览窗口被禁用,摄像头还是会产生帧,所以也会耗电。
68 |
69 | > --opacity, -op 设置预览窗口透明度
70 |
71 | 设置预览窗口透明度。0 = 透明,255 = 完全不透明
72 |
73 | ### 摄像头控制选项(Camera Control Options)
74 |
75 | > --sharpness, -sh 设置图像清晰度(-100 to 100)
76 |
77 | 设置图像清晰度,默认是0.
78 |
79 | > --contrast, -co 设置图像对比度(-100 to 100)
80 |
81 | 设置图像对比度,默认是0.
82 |
83 | > --brightness, -br 设置图像亮度(0 to 100)
84 |
85 | 设置图像亮度,默认是50.0是黑的,100是白的。
86 |
87 | > --saturation, -sa 设置图像色彩饱和度(-100 to 100)
88 |
89 | 设置图像色彩饱和度,默认是0.
90 |
91 | > --ISO, -ISO Set capture ISO
92 |
93 | Sets the ISO to be used for captures. Range is 100 to 800.
94 |
95 | > --vstab, -vs 打开视频防抖
96 |
97 | 打开视频防抖,只用于视频模式下。
98 |
99 | > --ev, -ev 设置曝光补偿
100 |
101 | 设置图像曝光补偿。范围是-10到+10,默认是0.
102 |
103 | > --exposure, -ex 设置曝光模式
104 |
105 | 可选项包括:
106 |
107 | * auto 自动曝光模式
108 | * night 夜间拍摄模式
109 | * nightpreview
110 | * backlight 背光
111 | * spotlight
112 | * sports 运动Select setting for sports (fast shutter etc.)
113 | * snow Select setting optimized for snowy scenery
114 | * beach Select setting optimized for beach
115 | * verylong Select setting for long exposures
116 | * fixedfps Constrain fps to a fixed value
117 | * antishake Antishake mode
118 | * fireworks Select setting optimized for fireworks
119 |
120 | > 请注意并非所有这些设置都已实现,依赖于camera tuning
121 |
122 | > --awb, -awb 设置自动白平衡(AWB)
123 |
124 | * off Turn off white balance calculation
125 | * auto 自动模式(默认)
126 | * sun Sunny mode
127 | * cloud shade Cloudy mode
128 | * tungsten Tungsten lighting mode
129 | * fluorescent Fluorescent lighting mode
130 | * incandescent Incandescent lighting mode
131 | * flash Flash mode
132 | * horizon Horizon mode
133 |
134 | > --imxfx, -ifx 设置图像特效
135 |
136 | * none 无
137 | * negative 负片
138 | * solarise 过度曝光的图像
139 | * whiteboard Whiteboard effect
140 | * blackboard Blackboard effect
141 | * sketch 素描特效
142 | * denoise 去噪图像
143 | * emboss 浮雕特效
144 | * oilpaint 油画特效
145 | * hatch Cross-hatch sketch style
146 | * gpen 石墨素描风格
147 | * pastel 柔光特效
148 | * watercolour 水彩效果
149 | * film Grainy film effect
150 | * blur 模糊效果
151 | * saturation Colour-saturate the image
152 | * colourswap 没有完全实现
153 | * washedout 没有完全实现
154 | * posterise 没有完全实现
155 | * colourpoint 没有完全实现
156 | * colourbalance 没有完全实现
157 | * cartoon 没有完全实现
158 |
159 | > --colfx, -cfx 设置色彩效果average Average the whole frame for metering
168 | * spot Spot metering
169 | * backlit Assume a backlit image
170 | * matrix Matrix metering
171 |
172 | > --rotation, -rot Set image rotation (0-359)
173 |
174 | Sets the rotation of the image in viewfinder and resulting image. This can take any value from 0 upwards, but due to
175 | hardware constraints only 0, 90, 180 and 270-degree rotations are supported.
176 |
177 | > --hflip, -hf Set horizontal flip
178 |
179 | Flips the preview and saved image horizontally.
180 |
181 | > --vflip, -vf Set vertical flip
182 |
183 | Flips the preview and saved image vertically.
184 |
185 | > --roi, -roi Set sensor region of interest
186 |
187 | Allows the specification of the area of the sensor to be used as the source for the preview and capture. This is defined
188 | as x,y for the top left corner, and a width and height, all values in normalised coordinates (0.0-1.0). So to set a ROI
189 | at half way across and down the sensor, and an width and height of a quarter of the sensor use :-roi 0.5,0.5,0.25,0.25
190 |
191 | ## 特定应用设置(Application-‐specific settings)
192 |
193 | ### raspistill
194 |
195 | --width, -w Set image width stdout。
208 |
209 | --verbose, -v 运行过程中输出详细信息。
210 |
211 | 在运行过程期间输出调试/信息消息。
212 |
213 | --timeout, -t Time before capture and shut down
214 |
215 | The program will run for this length of time, then take the capture (if output is specified). If not specified,
216 | this is set to 5 seconds.
217 |
218 | --timelapse, -tl 间隔拍摄模式
219 |
220 | The specific value is the time between shots in milliseconds. Note you should specify %04d at the point in the filename
221 | where you want a frame count number to appear. For example:
222 |
223 | -t 30000 -tl 2000 -o image%04d.jpg
224 |
225 | 上面的代码意思是,在30秒时间内,每两秒截一张图,依次命名为image1.jpg, image0002.jpg...image0015.jpg. Note that the %04d
226 | indicates a four-digit number with leading zeros added to pad to the required number of digits. So, for example,
227 | %08d would result in an eight-digit number.
228 |
229 | --thumb, -th 设置缩略图参数(x:y:quality)
230 |
231 |
232 | Allows specification of the thumbnail image inserted in to the JPEG file. If not specified, defaults are a size of
233 | 64x48 at quality 35.
234 |
235 | --demo, -d 运行演示模式