Video Manipulation and Control
All of the picture manipulation settings of Video Pitcher are available in XTension via the xVideoStream class. You can change them in response to time of day or backlighting conditions via scripting.
set exposure of xVideoStream “video: my cam name” to true set exposure amount of xVideoStream “video: my cam name” to 75
if you’re making many changes you should wrap them in a single tell block to reduce the amount of typing and make it easier to change the target later:
tell xVideoStream “video: my cam name" set exposure to true set exposure amount to 75 set denoise to true set denoise level to 100 end tell
The current values for any setting can be read out in XTEnsion as well like:
write log (exposure amount of xVideoStream “video: my cam name”)
If you have a setting that works well in video picture the actual setting parameters are visible in the monitor window in Video Pitcher and you can move those numbers into a script in XTension to re-create that setting.
The following properties of the xVideoStream class are processed in Video Pitcher by core image. Adding too many adjustments can use a lot of CPU time. None of the following affect the camera directly at all but only post process each frame in VP. Some direct camera settings are supported, see below. Each individual filter has a boolean on/off setting as well as the separate settings for the filters parameters.
flip vertically (boolean R/W) turn on or off the flip vertically setting in VP.
scale (boolean R/W) turn on or off image scaling.
scale factor (integer R/W) image scaling percent. Valid values from 10 to 100.
denoise (boolean R/W) turn on or off denoise processing.
denoise level (integer R/W) amount of denoise processing. Valid values from 0 to 100.
denoise sharpness (integer R/W) valid values from 0 to 200.
blur (boolean R/W) turn on or off a gaussian blur.
blur amount (integer) the gaussian blur radius. valid values from 0 to 100
adjust shadows (boolean R/W) turn on or off the adjust shadows filter. This is a very useful filter for increasing the visibility of things in darker parts of the image without blowing out the brighter areas as would happen by increasing the exposure or brightness.
shadow level (integer R/W) adjust the brightness of just the areas in shadow. Valid values from 0 to 200.
highlight level (integer R/W) reduce the brightness of the bright areas without darkening the shadowed areas. Valid values from 20 to 100.
adjustment radius (integer R/W) how large an area to use to calculate the shadow or highlight borders. Increasing this value uses much more CPU with very little effect. Valid values from 0 to 100.
exposure (boolean R/W) turn on or off exposure adjustment.
exposure amount (integer R/W) valid values from 50 to 150.
adjust levels (boolean R/W) turn on or off picture level adjustment.
brightness (integer R/W) adjust brightness level. Valid values from 75 to 175.
contrast (integer R/W) adjust contrast. Valid values from 25 to 300.
saturation (integer R/W) adjust the color saturation. Valid values from 0 to 200.
If you have a camera with one of the supported CGI API’s then you can make some changes to the camera directly. The camera API is selected in Video Pitcher in the edit camera dialog “Camera API” popup. As of VP version 81 there are 3 supported camera protocols. Older MJPEG Foscam cameras, newer h264 HD Foscam cameras and X10 Airsight cameras. The following adjustments are made in the camera itself and are write only properties. You cannot read the values out of the camera through these properties and the valid values are different for each camera type and may be different for many different models that otherwise support the same API.
cam brightness (integer, w/o) changes the brightness in the camera.
- MJPEG Foscam: range 0-255
- HD h264 Foscam: range 0-100
- Airsight: range -128-127 but don’t seem to apply values less than 0
cam contrast (integer, w/o) changes the contrast in the camera.
- MJPEG Foscam: range 0-6
- HD h264 Foscam: range 0-100
- Airsight: range 0-255
For supported camera API’s you can also control their Pan/Tilt/Zoom presets and speed.
cam preset (any, w/o) moves the camera to the named or indexed preset.
- MJPEG Foscam: 1-16 (though some may support up to 31 presets)
- HD h264 Foscam: set preset by name, pass the name you’ve given to the location as opposed to an index.
- Airsight: 0-31
cam PTZ Speed (integer, w/o) the speed of movement when going to a preset or being controlled. This can be very useful when you want to pan slowly across the lawn when nothing is happening, but want to quickly zip to look at the front door when someone rings the bell.
- MJPEG Foscam: 0 (fast) to 15 (slow)
- HD h264 Foscam: 0 (slow) to 4 (fast)
- Airsight: 0 (slow) to 10 (fast)
NOTE the xtension verbs for “pan”, “tilt”, “move”, “center”, “sweep” are for controlling X10 Ninja mount camera platforms are are not applicable yet to Video Pitcher controlled cameras.
at any time you can trigger recording from a video pitcher stream by using the record from verb.
record from (text) name of the video stream
- for (integer, optional) number of seconds to record the snippet for. If a recording was already running when you execute this verb the record time is reset to the new for value and continues until that new time runs out. For example motion sensing may continue to keep a snippet recording for as long as it keeps happening. If no for value is included then the time of an already running recording is not changed, or if no recording is outstanding then a snippet of the default snippet duration as set in the Video Pitcher preferences window is created.
- info (text, optional) this should be the name of whatever triggered the recording. for example “front door motion” or “driveway sensor” any text you pass is added to the recorded movie along with the date/time to mark the recording as to why you’re recording. It is also displayed in a separate list of all events for this movie when viewed in the web archive of the web remote.
Each video stream also creates a RECORD video stream name unit in XTension that will show the state of the recording of that stream. If you manually turn on the record unit then the stream will be continually recorded from with no timeout until the unit is turned off. If you turn off a RECORD unit then no matter how recording was triggered the final movie will be flattened and written to disk ready to be viewed.
record from “video: front door” for 5 * minutes info “front door motion"