What is PTZ Control?
Pelco cameras that support pan, tilt, and zoom motion can be controlled using the Pelco SDK. After you find the IP camera on your network and display its live stream on a display, you can start adjusting your camera’s viewing position up and down, left and right, as well as modifying magnification (zoom), focus, and camera iris settings. To do so, use the PTZ class, as discussed in this chapter. PTZ works the same across all Pelco VMS systems
Instantiating a PTZ Object
To create an instance of the PTZ class, call the PTZ constructor and specify a Camera object.
Note: In this and the following sections, StopContinuous() will stop all continuous movement triggered by ContinuousMove, ContinuousPan, and ContinuousTilt.
To move the camera left and right:
1. Call the PTZ object's ContinuousPan() method.
To pan the IP camera left, pass in a negative value for the rotational x parameter.
To pan the IP camera right, pass in a positive value for the rotational x parameter.
2. To stop the camera from continually moving, call the StopContinuous() method.
To move the camera up and down:
1. Call the ContinuousTilt() method.
To tilt the IP camera down, pass in a negative rotational y value.
To tilt the IP camera up, pass in a positive value for the rotational y parameter.
2. To stop the camera from continuous tilting, use the StopContinuous() method as shown in the following example.
Zoom refers to the camera magnification level. "Zooming in" increases the magnification, while "zooming out" decreases the magnification. Continuous zoom starts the zoom process in the direction provided. The magnification level at which a camera will cease zooming is model dependent.
To zoom the camera in or out, use the following values:
1. Call the ContinuousZoom() method.
2. To stop the camera from continuous zooming, use the StopContinuous() method.
The camera can be tilted and panned simultaneously, which moves the camera view diagonally.
1. Call the ContinuousMove() method.
The first parameter represents both speed and direction on the X plane. Use a negative integer to pan left and a positive integer to pan right.
The second parameter represents both speed and direction on the Y plane. Use a negative integer to tilt down and a positive integer to tilt up.
2. When you want to stop the camera from continually moving, use the StopContinuous() method.
Stopping Continuous Movement
To stop the camera from continuously moving, call the StopContinuous() method.
Panning to a Specific Position
You can move a camera to a specific point in 2D space. Units are in centidegrees (hundredths of a degree). Generally, the panning range is limited to 0 to 360 degrees (0 to 36,000 centidegrees). This limit might differ depending on the camera model.
To pan to a specific position:
Call the AbsolutePan() method, passing in the appropriate position on the rotational X plane.
Tilting to a Specific Position
You can move a camera to a specific point in 2D space. Units are shown in centidegrees (hundredths of a degree).
Generally, the tilting range is limited to 0 to -90 degrees (0 to -9000 centidegrees). This limit might differ, depending on the camera model.
To tilt a camera to a specific location:
Call the PTZ Object’s AbsoluteTilt() method, passing in the appropriate position on the rotational Y plane.
Moving to a Specific Position
You can tilt and pan a camera at the same time, which moves the camera view diagonally. See your camera model’s specifications for position limits.
To move a camera diagonally:
Call the AbsoluteMove() method, passing in the appropriate position on the rotational X and Y planes.
Getting the Camera’s Current Position and Zoom Value
To get a camera's current viewing position:
Call the GetPosition() method, passing placeholders for the x, y, and z values.
The returned value is a specific point in 3D space.
Note: It is best practice to let your IP camera manage its iris automatically.
To open and close your camera’s iris, use the following enumerated values from PTZ.h:
To focus nearer or focus farther away, use the following values:
1. Call the ContinuousIris() method, passing in the appropriate iris command to stop, close, or open the iris.
If the request is successful, your camera’s iris begins to change (unless you passed in a IRIS_STOP). This does not stop until you call ContinuousIris with a different value, or if you call the StopContinuous() method, which stops all movement- or lens-related action that the camera is currently doing.
2. For best iris control, let your IP camera manage it automatically. To enable this feature, call the AutoIris() method and pass in a Boolean value of true. To turn AutoIris off, pass in a Boolean value of false.
Creating a Preset
A preset is a script that allows you to save a camera's stationary position, zoom, and other settings such as auto iris and autofocus, collectively known as a bookmark. Users can save multiple presets per camera. For example, if you are monitoring several specific points using the same camera, you can set one preset for each location that needs to be monitored, each with its own set of zoom, iris, and focus values.
Presets that you create must be named, such as "PRESETX", where the keyword PRESET must be used (uppercase) followed by a positive integer. For example, PRESET9. The number of presets that can be saved and activated is dependent on the Pelco device.
These steps show you how to create a preset.
1. Set up your Pelco IP camera with a combination of settings that you want to save.
For example, the IP camera’s current viewing position, iris setting, focus setting, zoom, and so on.
2. Call the SetPreset() method, passing in the name of the preset.
The method creates a preset or modifies an existing preset by that name.
Creating a Pattern
A pattern is a sequence of presets. For example, you might control an IP PTZ camera guarding a hallway with two entrances and a window. With patterns, you can set a bookmark for camera behavior that changes the camera’s view from one of the three points of interest to another every 15 seconds. Patterns that you create must be names as "PATTERNX", where the keyword PATTERN must be used (uppercase) followed by a positive integer. For example, PATTERN5.
Note: There are preconfigured patterns that cannot be created. You cannot create a Pattern by combining existing Presets.
Like a preset, patterns are typically only relevant for IP cameras. The number of patterns that can be recorded and activated is dependent on the Pelco device.
Creating a pattern is like creating a preset, except that you are saving more than one camera state.
To create a pattern:
1. Set up your Pelco IP camera with the combination of settings that you want to save.
For example, the IP camera’s current viewing position, iris setting, focus setting, zoom, and so on.
2. Call the StartPatternRecording() method, passing in the appropriate name of the preset.
The method creates a pattern or modifies an existing one by that name.
3. Start performing the actions that you want your camera to perform as a pattern.
For example, if you have three points of interest you would first go to the first point of interest with a certain zoom and focus level. After waiting for some predetermined time, move the camera’s view into the second point of interest which has a different zoom level and iris setting; and do the same for the final point of interest.
4. Finally, call the StopPatternRecording() method, passing in the same pattern name as previously.
Autofocus is the ability of the lens to remain in focus during zoom-in, zoom-out, and motion functions.
Abbreviation for binary digit; the smallest component of information a computer can use. A bit is either one or zero (a voltage state).
Bit rate is the number of bits that are transferred between devices in a specified amount of time, typically one second.
In NTSC and PAL video signals, the brightness information at any particular instant in a picture is conveyed by the corresponding instantaneous direct current level of active video. Brightness control should be adjusted so that the black picture content shows as true black on your display.
Bits per second. This is a bit rate measurement.
Bytes per second. Also abbreviated as B/s.
In an IP network environment, broadcast refers to sending information from one device to every device on the network. When broadcasting, it is not possible to control or specify which devices can receive this information.
A byte is a string of bits processed together by a digital computer. A byte is equal to eight bits (256 possibilities) and is large enough to hold one character (like an "A") or an unsigned integer from 0 to 255.
codec is an acronym for compression/decompression. This term is commonly used in the context of multimedia compression and decompression, such as video or audio.
Common Intermediate Format (CIF)
A standard video and digital image size. See SIF for NTSC resolutions.
CIF: 352 x 288 for PAL
2CIF: 704 x 288 for PAL
4CIF: 704 x 480 for PAL
QCIF: 176 x 144 for PAL
Compression is any algorithm used to reduce the size of a file.
Contrast is a common term used in reference to the difference between the darkest and the brightest parts of an image. After brightness is set correctly, contrast should be set for comfortable viewing brightness.
D1 is a digital video format developed by Society of Motion Picture and Television Engineers (SMPTE). The D1 format resolution is 720 ? 480 for NTSC and 720 ? 576 for PAL.
The decoder is a high-performance video device that converts digital video streams back into analog output for viewing on an analog video monitor, S-video monitor, or VGA monitor.
Decoding is the opposite of encoding: decompressing a compressed digital image and then turning it back into an analog signal.
A device is a piece of hardware (camera, alarm, DVR, NVR, storage expansion box) that is part of a network.
A device ID is a unique identifier for an individual device on a network.
The encoder is a high-performance MPEG-4 device that takes analog video signals through a standard BNC coaxial cable and digitizes, compresses, signs, and packetizes them for the network. It also provides an interface for relays, alarms, and audio connections.
Encoding is the process of taking an analog signal and converting it to a digital format (A to D conversion). Compression is applied at this point in the process.
Firmware is a software process that is embedded in a hardware platform that instructs the hardware how to behave and what action to perform.
Focus means to adjust a lens so objects at various distances from the camera can be sharply defined.
The frame rate is the number of frames or images that are captured, stored, projected, or displayed per second.
Gamma is the correction of the linear response of a camera to compensate for the nonlinear response of a display's phosphor screen. It is measured with the exponential value of the curve describing the nonlinearity. A typical monochrome display gamma is 2.2, and a camera needs to be set to the inverse value of 2.2 (which is 0.45) for the overall system to respond linearly (that is, unity).
Developed by the ITU-T Video Coding Experts Group (VCEG), H.264 is a low-bit-rate compressed video format standard.
Hue is one of the characteristics that distinguishes one color from another. Hue defines color on the basis of its position in the spectrum, that is, whether red, blue, green or yellow, and so forth. Hue is one of the three characteristics of TV color; the other two are saturation and luminance. In NTSC and PAL video signals, the hue information at any particular point in the picture is conveyed by the corresponding instantaneous phase of the active video subcarrier.
In a compressed digital image, I-frames (intraframes) are the frames that are compressed independently of the other frames in the sequence.
Internet Protocol. IP is the main method of transmitting data across the Internet.
(static and DHCP) The IP address identifies a particular computer on a network to other computers. An IP address is similar to your home address. In a neighborhood, each house has a unique address; on a network each computer must have a unique address. An IP address is a four-byte number, usually written in dotted-decimal notation with periods separating the bytes (for example, 192.168.0.1). There are two types of IP addresses: static and DCHP. A static address is assigned when someone physically connects to a computer and defines the IP address for that computer. A static address does not change unless someone physically changes it. A DHCP (Dynamic Host Configuration Protocol) address is assigned dynamically from a server that contains a pool of addresses. The server leases the computer one of the available addresses for a specified amount of time. After the time has expired, the computer renews the lease or requests an IP address.
An IP camera is a digital video camera that outputs IP packets over Ethernet cabling. An IP camera can use TCP protocol, as well as UDP or RTP.
An IP packet can be divided into two main parts: the payload and the header. The header is the part of the packet that contains the routing information, and comprise many parts. The header contains all IP and MAC addressing information. The header is the only part of the packet that a router examines when trying to determine where to send a packet.
The iris is a means of controlling the size of a lens aperture and therefore the amount of light passing through the lens.
Marshalling is synonymous with serialization.
Developed by Moving Picture Experts Group (MPEG), MPEG-4 expands the MPEG-1 specification to support AV "objects", 3D content, low bit rate encoding, and Digital Right Management (DRM).
A single device sends information across a network and that stream is received by all listening devices on the network. A special IP address range has been reserved for this purpose: 22.214.171.124-126.96.36.199 with a subnet mask of 255.255.0.0. Each multicast transmitting device sends a data stream to an address from the above range. Any device on the network can then listen for transmissions to that IP address and receive the stream. Multicast offers a reduction of bandwidth consumption over the unicast and broadcast delivery methods. Multicast also offers control over which devices on a network can receive a multicast stream.
A multicast server is any server that takes a unicast transmission on behalf of a client and converts it to a multicast transmission on the network.
Namespace is an identifier that denotes a group of names. It is used to prevent resource identifier conflicts.
Network Time Protocol (NTP)
NTP is a protocol designed to synchronize the clocks of computers over a network. On systems that have an NTP server, you can use the WS5050 to configure the NTP settings (NTP server IP and renew interval). By default, time and date information is included with video streams and other device data. The software relies on the PC system clock for other needed time information.
National Television System Committee (NTSC)
NTSC developed the U.S. color TV specifications. It specifies 525 lines/screen. It also specifies 59.94 fields per second, although most people see this frame rate as 30 frames per second. NTSC now describes the American system of color telecasting. It is used in North America, Japan, and some parts of South America.
Network Storage Manager (NSM)
A combination of high-performance, scalable hardware and advanced software for managing pooled storage of recorded video and audio streams.
Phase Alternation by Line (PAL)
PAL is the European (50 Hz) color TV standard. It is used by most countries outside the US. It specifies 625 lines/screen, and 25 frames per second.
Parity is a method of checking the accuracy of data to identify whether the bits being moved arrived successfully. Parity bit checking can be either odd or even bits. No parity means that a parity bit is not transmitted or checked.
In a compressed digital image, a P-frame (predicted frame) is a frame calculated depending on the change from one frame to the next. An area of the display that does not change from one frame to the next does not need to be contained in the P-frame. If an area of the display does not change but does move on the screen, only the vector describing this movement is contained in the P-frame. This allows a reduction in overall file size.
Personal Identification Number. PIN is used to provide security in a system.
Power over Ethernet (PoE)
PoE enables both power and video to transmit on a single cable.
Protocol is a set of rules governing the transmission of data between equipment:
D Pelco protocol that uses seven bytes to send a command.
M Pelco protocol for communicating with M devices (KBD960/KBR960 keyboards, ALM2064 alarm interface units, and REL2064 relay interface units).
P Pelco protocol that uses a variable number of bytes to send a command. Eight bytes are used to send commands to dome systems.
A relay group is a defined set of relays acting in a coordinated pattern.
Remote Procedure Calls (RPCs)
RPC is a protocol that allows software running on one host to cause other software to be run on another host.
Real-time Transport Protocol (RTP)
A protocol that uses a standardized packet format for delivering data over networks.
Real Time Streaming Protocol (RTSP)
A protocol for streaming data, which allows clients to remotely control the server streaming the data.
Saturation is the intensity of the colors in the active picture: the amount by which the eye perceives a color as departing from a gray or white scale of the same brightness. A 100% saturated color does not contain any white; adding white reduces saturation. In NTSC and PAL video signals, the color saturation at any particular instant in the picture is conveyed by the corresponding instantaneous amplitude of the active video subcarrier.
To view a group of cameras, one after the other, either manually or automatically.
A server is a computer and its software that provides some service for other computers connected to it through a network.
Service is the ability of a device within the system to perform such functions as pan/tilt/zoom, record video, and playback video. When a device comes online, these services are automatically advertised to other devices on the network. To use these services, the user must be assigned a role with the proper permissions.
Sharpness refers to a function that allows a user to adjust the image between a "soft" look and a sharp look.
Source Input Format. Resolution depends on the source: NTSC SIF equals 352 x 240 pixels. See CIF for PAL resolutions.
System Manager (SM)
A piece of software that authenticates devices on the network. This software runs on an DVR or NVR or as a standalone device.
Transmission Control Protocol/Internet Protocol. TCP/IP is the standard way of communicating over a network that ensures all devices on a network can communicate and information is passed without any errors.
Universal Device Number.
User Data-gram Protocol is a connectionless protocol that, like TCP, runs on top of IP networks. Unlike TCP/IP, UDP/IP provides very few error recovery services, offering instead a direct way to send and receive data-grams over an IP network. It is used primarily for broadcasting messages over a network.
Universal Identification Number.
The standard method to transport IP traffic. In a unicast transmission, information is sent from one computer directly to another computer on the network.
UPnP is a family of networking protocols used to create a "hands off" network. In a Universal Plug and Play network, objects are plugged into a network and automatically recognized and configured. All IP addresses in a UPnP network are assigned dynamically through DHCP. If DHCP becomes unavailable in a UPnP network, devices default to AutoIP. Devices use the UPnP process when plugged into a network.
Uniform Resource Identifier (URI)
URI is used to identify a resource over a network.
Uniform Resource Name (URN)
A URN identifies, or more specifically, names a resource within a namespace.
Varifocal refers to a lens with a variable focal length. Varifocal lenses are low cost zoom lenses that can be adjusted (zoomed) over a range of focal lengths. These lenses are cost much less than normal zoom lenses because they have fewer elements in them.
Disadvantage: Unlike a zoom lens, a varifocal lens does not maintain focus when zoomed. It is practical only for use with cameras where the zoom is set only at installation.
Advantage: The installer can adjust a varifocal lens for optimum field of view without changing the lens.
Web Services Description Languages (WSDLs).
1 Active only if the attached IP camera is PTZ capable.
2 Active only if an active System Manager is available on the network. Endura Express contains a built-in System Manager, and therefore no additional System Manager is required.
RS-485 ÄËß ÓÏÐÀÂËÅÍÈß ÏÎÂÎÐÎÒÍÛÌÈ ÊÀÌÅÐÀÌÈ Â ÑÈÑÒÅÌÀÕ ÎÕÐÀÍÍÎÃÎ ÒÅËÅÂÈÄÅÍÈß.
ÏÐÎÈÇÂÎÄÑÒÂÎ ÏÎÂÎÐÎÒÍÛÕ ÓÑÒÐÎÉÑÒÂ. ÂÈÄÅÎÍÀÁËÞÄÅÍÈÅ.
ÌÎÑÊÂÀ-ÑÈÒÈ, ÏÐÅÑÍÅÍÑÊÈÉ ÐÀÉÎÍ, ÌÎÑÊÂÀ, ÐÎÑÑÈß.