This topic consists of the following(子内容) subtopics:CaptureDeviceOptions, MotionDetectionSettings,ImageFileOutput, TuningMotion, MpegFilmsFFmpeg,SnapshotsWebCam, TextFeatures,AdvancedFilenames, ConversionSpecifiers,WebcamServer, RemoteControlHttp,ExternalCommands.html
Once installed the camera(s) will have the device names /dev/video0, /dev/video1, /dev/video2...
FreeBSD has a different naming of devices. When you build Motion for FreeBSD the default device name is /dev/bktr0. Under FreeBSD a TV card has a special device for controlling the tuner(调谐器) (e.g. /dev/tuner0). The option tunerdevice is only valid when Motion is built and running under FreeBSD. For Linux do not include this option in the config file (remove or comment out).
USB cameras take a lot of bandwidth. (USB相机消耗不少带宽)。A USB camera connected to a USB 1.1 port or hub consumes all the bandwidth. Even with a small framesize and low framerate you should not expect to have more than one camera per USB 1.1 controller. If you need more than 1 USB camera add extra USB PCI cards to your computer. There exists cards that have 4 inputs each with their own controller and with full bandwidth. Many 4-input cards only have 1 controller. USB cameras do not have the feature of selecting input channels. To disable the input selection the option input must be set to the value 8 for USB cameras.(主要将USB相机的限制)
Composite video cards (视频多路复用器)are normally made with a chip called BT878 (older cards have a BT848). They all use the Linux driver called 'bttv'.
There are cards with more then one video input but still only one BT878 chip. They have a video multiplexer(他们有一个视频多路复用器) which input is selected with the config option input. Input channel numbers start at 0 (which is why the value 8 and not 0 disables input selection). There are video capture cards available with 4 or 8 inputs but only one chip. They present themselves as one single video device and you select input using the 'input' option. If you define e.g. 4 thread config files with the same videodevice name but different input numbers Motion automatically goes into round robin mode. See the round robin section for more information. Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. For video capture cards input 1 is normally the composite video input.(主要讲视频卡,不太懂)
Some capture cards are specially made for surveillance with for example 4 inputs. Others have a TV tuner, a composite input (phono socket) and perhaps also a S-VHS input. For all these cards the inputs are numbered. The numbering varies from card to card so the easiest is to experiment for 5 minutes with a program that can show the videostream. Use a program such as Camstream or xawtv to experiment with the values.linux
If you use the TV tuner input you also need to set the frequency of the TV channel using the option frequency. Otherwise set 'frequency' to 0.
Finally you need to set the TV norm. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default is 0 (PAL). If your camera is a PAL black and white you may get a better result with norm=3 (PAL no colour).(这几段主要讲TV协调器,也不太懂)
If the netcam_url option is defined all the video4linux options are ignored so make sure the netcam_url option is commented out if you do not need it.(意思是若是选项netcam_url你用不着,那么就把它注释掉,不然全部的video4linux 选项在运行时都会被忽略 )
+++++++video4linux (普通的视频设备)+++++++
web
These are the parameters used for video4linux devices(video4linux 设备用到的一些参数)
算法
由于参数不少,因此采起用谁看谁的针对性策略。具体参数可看各自的蓝色字体。express
auto_brightness(自动亮度)windows
这个参数取默认值,若是运行后发现所用相机不支持自动亮度调节,再将其配置为on也不迟。promise
Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.(说:你的相机设备不可能支持任何尺寸的图像,因此,你要搞清楚你的相机设备所支持的帧的尺寸,假如你不清楚这些,那么,就把高度和宽度设为大部分相机设备都支持240*320便可)缓存
Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.(这一段话也要注意,说:motion须要相机图像的高度和宽度均为16的倍数,这一般都不是问题。640, 480, 352, 320, 288, 240, ...这些标准的尺寸都是16的倍数。)
服务器
Normally only relevant for NTSC cameras.(一般只跟NTSC 的cameras有关)
网络
Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras.(video/TV cards设置为1,USB cameras设置为8)
If you have a video capture card you can define the channel to tune to using this option. If you are using a USB device, network camera or a capture card without tuner you should set the value to the default 8.(若是你用的是video capture card,那么能够用这个选项定义一个通道;若是你用的是 USB device, network camera 或者a capture card without tune,那么就用默认值。)
Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. It is recommended to set the parameter to 8 for USB cameras as your first try. For video capture cards input 1 is normally the composite video input.(这段话主要举一些通道设置的例子,不过一般状况下用8就行。)
Note that the CPU load increases when using this feature with a value other than 0. Also note that Motion automatically swaps width and height if you rotate 90 or 270 degrees, so you don't have to touch these options.(
Make sure to remove or comment out this option when running Motion under Linux.(若是是在Linux下运行motion,请确保删除或者注释掉这个选项)
The video device to be used for capturing. Default for Linux is /dev/video0. for FreeBSD the default is /dev/bktr0.
This is the video4linux device name. Ignore this for net cameras.
人家说的很清楚,Linux下默认值为/dev/video0,FreeBSD下默认值为/dev/bktr0,因此,不用管它。
When the netcam_url is defined all the video4linux options above are ignored!!(注意:一旦设置了选项netcam_url ,则选项video4linux 中全部的设置都将被忽略)
Note that Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16. But if you intend to monitor a network camera which is saving jpeg images you may have to pay attention to the dimensions of the picture.(意思是:若是你用网络摄像机,那么你要特别注意图像尺寸的问题,由于motion要求高度和宽度为16的倍数)
Use this if you need to connect to a network camera through a proxy server.
Example of syntax: "http://myproxy.mydomain.com:1024
If the proxy port number is 80 you can ommit the port number. Then the syntax is use "http://myproxy.mydomain.com" .
Leave this option undefined if you do not use a proxy server(代理服务器).
主要意思:用的话就定义它,不用的话别管它。
Example of URL: http://www.gate.com/pe1rxq/jeroen.jpg.(URL示例)
For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication(认证).(意思是不要动它)
To use no authentication simply remove this option from the config file comment it out with "#" or ";" in front.(这里提供两种注释代码的方法,用“#”或者用分号“;”)
This feature is automatically activated where multiple threads are sharing the same video device (for example /dev/video0). (当多个线程共享同一个视频设备时,这个特性会被自动激活。)
Round Robin is not relevant for Network cameras or standard USB web cameras. The Round Robin feature is used with video capture cards which have multiple inputs per video chip.(说:这种特性与Network cameras 或standard USB web cameras无关。这种特性用在视频采集卡中,而且一个视频芯片有多个输入。)
These are the special Round Robin options
Example: You want to monitor if the center of motion occurrs in the lower third of the image - that is area 7, 8 and 9. Simply set 'area_detect' to '789' and 'on_area_detect' will be executed as soon as the center of motion was detected in area 7, 8 or 9. If you want to monitor area 2, 3, 5 and 6, set '2356'.(教你定义的方法)
Any motion detected before the gap timer times out resets the gap timer so it starts counting over again.(在间隔结束以前,若是有检测到运动则重置间隔,即用一个新的间隔时间继续检测)
Detailed Description
The option 'gap' is important. It defines how long a period of no motion detected it takes before we say an event is over. An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. Motion detected includes post_captured frames set by the 'post_capture' option. The 'gap' option defines how long a pause between detected motions that is needed to be defined as a new event. A good starting value is 60 seconds.(这段话说gap这个选项很重要,以及gap的具体含义)
Note that 'gap' and 'minimum_gap' have nothing to do with each other.(说:gap和minimum_gap毫无关系)
Full path of the PGM (portable gray map) mask file (binary format).(要使用文件的绝对路径)
If you have one or more areas of the camera image in which you do NOT want motion detected (e.g. a tree that moves in the wind or a corner of the picture where you can see cars/pedestrians passing by) you need a mask file. This file is a picture that you create in your favorite photo editing program. The areas that you want detected must be white. The error that you want ignored must be black. The pgm image must be the same size (number of pixels high and wide) as the pictures that are taken by the camera (video4linux device).(教你怎样设置你要用的pgm文件)
If you do not have a mask file disable this option by not having it in the config file or comment it out ("#"or ";" as first character in line). If you are using therotate
option, note that the mask is applied after the rotation.(若是你不是用该选项,那么把它注释掉)
One easy method for generating the mask file is as follows.(教你一个制做mask file 的简单方法,往下读一下吧)
You can just take a motion captured picture, edit it with black and white for the mask and save it as a pgm file. If you cannot save in this format save as a grayscale jpg and then you can convert it to pgm format with
djpeg -grayscale -pnm [inputfile] > mask.pgm
(assuming you have djpeg installed - part of the jpeg lib package).
Note that the mask file option masks off the detection of motion. The entire picture is still shown on the picture. This means that you cannot use the feature to mask off an area that you do not want people to see.
The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length.(一个mpeg视频的最大长度,以秒计。设为0表示不限制长度)
The feature is used when you get many false detections when the camera changes light sensitivity or light changes.(这个特性用在对亮度变化敏感的相机或者亮度发生变化的场合,前提是这种场合出现不少检测错误,不然不用管它。)
Experiment for best setting. Even though Motion accepts large values you should set this to a relatively low number (below 10). For each step larger than 1 Motion reserves space in RAM for the picture frame buffer. If you have a large value Motion will miss many frames from the camera while it is processing the all the pictures in the buffer.(意思仍是不要把它的只设置太大,不然会出问题)
This is different from the threshold parameter. This is changes at pixel level. The purpose is to eliminate the changes generated by electric noise in the camera. Especially in complete darkness you can see the noise as small grey dots that come randomly in the picture. This noise can create false motion detection. What this parameter means is that the intensity of a pixel must change more than +/- the noise threshold parameter to be counted.(说:这个值不一样于threshold parameter。它是像素级的变化。目的是评估由相机产生的电信号干扰。特别是在全黑的环境下,你可以看到图像有一些随机的灰点。这可能产生错误的运动判断。这个参数是指一个像素密度变化必须多余+/-噪声的threshold parameter值。)
Activates the automatic tuning of noise level.(激活后,自动调整noise_level的值)
This feature makes Motion continuously adjust the noise threshold for distinguishing between noise and motion. The 'noise_level' setting is ignored when activating this feature. This is a new feature and new algorithm. It may give different results depending on camera and light conditions. Report your experience with it on the Motion mailing list. If it does not work well, deactivate the 'noise_tune' option and use the manual setting of 'noise_level' instead.(意思是:这是一种新特性和新算法,激活后,能够自动调整noise_level的值。另外,不一样的相机和光线条件可能会有不一样的结果。因而,欢迎您作实验而后给反馈以便改进。若是效果很差,请把它关了,而后手动设置noise_level的值。)
Picture are saved continuously as if motion was detected all the time.(打开该选项后,若是检测到一直有运动,则一直保存图像。)
This feature is not meant to be the normal mode of operation. Especially not if you have the output_normal or output_motion features enabled since it will keep on saving pictures on the disk and you will soon run out of disk space. So be careful with this command.(意思是,这个选项会耗尽硬盘存储,因此当心使用它,若是确实有须要的话。)
The idea of this feature is that you can turn the feature on and off for a short period of time to test or to generate continuous mpeg films when needed.(告诉你使用该选项的状况)
Specifies the number of frames to be captured after motion has been detected(检测到运动后采集帧的数量)
The purpose of this is mainly to create smooth video clips each time motion is detected. Use it to you personal taste (and disk space)..(给你说使用目的)
This option is the preferred way to create continuous movies. Post_capture does not consume extra RAM and it does not create pauses in the movie even with large values.(意思是值没有限制)
If you only store mpegs movies and do not have output_normal on, then the recommended post_capture value is what is equivalent to 1-5 seconds of movie.(意思是最好值最好仍是小一些~)
写到这里说一下感觉:虽然看motion有点意思,可是一直读英文还要去理解真的不是轻松的事,有种想吐的感受!很少说了,继续吧!
Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.(说:这个特性指明输出探测到运动前的帧的数量。推荐值:0~5,默认为0,即不使用此特性。不要使用较大的值!大值会形成Motion失真卡顿。可使用比较大的post_capture 来获得流畅的mpegs 。)
总之:此特性使得motion好像有预知的能力,其实motion老是缓存一段以前的内容,当探测到运动时,那么就把缓存中的内容加到探测到的运动视频中,这个特性的值就是让你选择motion预知能力的大小。可是值千万不要太大,绝对利大于弊,大值极有可能让你丢掉一些探测到运动后的重要的信息。按着推荐值选择吧!
这个特性具备自学习的能力,很厉害,用来消除像风吹动树叶这种运动的干扰,建议值为5。
Practical values would be from a few hundred to 2000 indoors and 1000-10000 outdoors.(实际应用中,室内的话取值在几百到2000之间,室外的话取值在1000到10000之间。)
The threshold setting is ignored when activating this feature. It may give different results depending on your camera, light conditions, indoor/outdoor, the motion to be detected etc. If it does not work well, deactivate the 'threshold_tune' option and use the manual setting of threshold instead.(意思是,若是这个特性被设定了,那么motion将忽略threshold 选项,根据实际状况来决定threshold 值大小。若是你发现设定它以后,motion效果不理想,那么就关了他吧,本身手动设定一个threshold 值。)
100 means hardly compressed. A small number means a much smaller file size but also a less nice quality image to look at. 50 is a good compromise for most.(100表示不压缩,一个小值就表明图像的质量稍次,占的存储空间也小。50是一个比好的值。)
一、With 'motion -s' Motion runs in console mode instead of daemon. It outputs a lot of useful information for each frame from the camera. Each message is prefixed by [number] where number is the camera number (thread number).二、When you look at the mjpeg webcam stream you see a black image with numbers. What you see is the number of changed pixels, number of labeled areas and noise setting. When something moves you see the pixels detected as Motion in black and white. The largest labelled area (assuming despeckle is enabled and with the 'l' at the end) is blue. It is only the blue areas which is counted as Motion. If smartmask is enabled you see this as red areas.
Here is a suggestion how to initially setup Motion.(下面教你怎样开始Motion的设置模式,能够试一下)
In normal mode you can use the same setting with two browser windows and experiment with settings of the camera if needed.
From the web interface you can ask Motion to write all your changes back to the config files (motion.conf and thread config files). It will even tidy them up for you so they look nice.
There are two sets of options to adjust.