everetptz
v2025.11.8
Published
Rest API wrapper for Everet PTZ cameras with 0 dependencies.
Readme
EveretPTZ
A TypeScript REST API wrapper for Everet EVP212N PTZ cameras with zero dependencies.
Overview
EveretPTZ is a lightweight TypeScript library for controlling Everet EVP212N professional PTZ cameras over HTTP. It provides a simple, promise-based API for camera control, image settings, and configuration management.
Supported Camera: Everet EVP212N Professional Grade FHD NDI PTZ Camera
Features
- Zero Dependencies - Pure TypeScript implementation
- Complete PTZ Control - Pan, tilt, zoom, and focus operations
- Image Settings - Exposure, white balance, iris, shutter control
- Advanced Features - WDR, noise reduction, gamma correction
- Type Safety - Full TypeScript support with type definitions
- Promise-based - Modern async/await API
Installation
npm install everetptzBasic example
import { EveretPTZ } from 'everetptz';
// Initialize camera connection
const camera = new EveretPTZ('192.168.1.100', 'admin', 'password');
// Wait for authentication
await camera.whenReady();
// Get streaming URL
const streamUrl = await camera.getRTSPUrl('main');
console.log('Stream URL:', streamUrl);
// Move camera up for 2 seconds
await camera.move('up', true, 15);
setTimeout(() => {
//Stop moving up
await camera.move('up', false);
// Save current position as preset 1
await camera.setPreset(1);
}, 2000);API Reference
Constructor
Return values
Camera
Movement
Presets
Focus
Exposure
- setExposureMode
- getExposureMode
- setShutter
- getShutter
- setExposureGain
- getExposureGain
- setIris
- getIris
- setExposureBrightness
- getExposureBrightness
- setAntiFlicker
- getAntiFlicker
White Balance
- setWhiteBalanceMode
- getWhiteBalanceMode
- setRedGain
- getRedGain
- setBlueGain
- getBlueGain
- setColorTemperature
- getColorTemperature
Image
- setMirror
- getMirror
- setFlip
- getFlip
- setBacklightCompensation
- getBacklightCompensation
- setGamma
- getGamma
- setWideDynamicRange
- getWideDynamicRange
Image Quality
Noise Reduction
Streaming
Constructor
new EveretPTZ(ip: string, username: string, password: string)ip- Camera IP addressusername- Camera login usernamepassword- Camera login password
Return Values
Important: All set methods return a Promise<boolean>:
true- Command executed successfullyfalse- Command failed or something went wrong
Note: get methods return the actual values, while control methods (move, zoom, focus) return boolean success indicators.
Camera
whenReady
await camera.whenReady(): Promise<void>Wait for authentication to complete before sending commands.
onError
camera.onError(callback: (error: Error) => void): voidSet error handler for authentication and request failures.
getInfo
await camera.getInfo(): Promise<{
app_version: string;
bootloader_version: string;
device_name: string;
serial_number: string;
system_version: string;
}>Get camera system information including firmware versions and device details.
Movement
home
await camera.home(): Promise<boolean>Returns the camera to the home position.
move
await camera.move(
direction: 'up' | 'down' | 'left' | 'right',
active: boolean,
speed?: number // 0-24, default: 10
): Promise<boolean>Start or stop pan/tilt movement in the specified direction.
zoom
await camera.zoom(
direction: 'in' | 'out',
active: boolean,
speed?: number // 0-7, default: 7
): Promise<boolean>Control zoom operation.
focus
await camera.focus(
direction: 'near' | 'far',
active: boolean,
speed?: number // 0-7, default: 7
): Promise<boolean>Only applicable when focus mode is set to
manual
Manual focus control.
Presets
setPreset
await camera.setPreset(presetNumber: number): Promise<boolean> // 0-127Save current camera position to preset slot.
recallPreset
await camera.recallPreset(presetNumber: number): Promise<boolean> // 0-127Recall saved preset position.
clearPreset
await camera.clearPreset(presetNumber: number): Promise<boolean> // 0-127Clear preset from slot.
Focus
setFocusMode
await camera.setFocusMode(mode: 'auto' | 'manual'): Promise<boolean>Set focus mode.
getFocusMode
await camera.getFocusMode(): Promise<'auto' | 'manual'>Get current focus mode.
Exposure
setExposureMode
await camera.setExposureMode(
mode: 'auto' | 'manual' | 'iris priority' | 'shutter priority' | 'brightness priority'
): Promise<boolean>Set exposure mode.
getExposureMode
await camera.getExposureMode(): Promise<string>Get current exposure mode.
setShutter
await camera.setShutter(speed: string): Promise<boolean>Only applicable when exposure mode is set to
manualorshutter priority
Set shutter speed.
Available shutter speeds: '1/25', '1/50', '1/75', '1/100', '1/120', '1/150', '1/215', '1/300', '1/425', '1/600', '1/1000', '1/1250', '1/1750', '1/2500', '1/3500', '1/6000', '1/10000'
getShutter
await camera.getShutter(): Promise<string>Get current shutter speed.
setExposureGain
await camera.setExposureGain(gain: string): Promise<boolean>Only applicable when exposure mode is set to
manual
Set exposure gain.
Available gain values: '0dB' to '30dB' in 2dB increments
getExposureGain
await camera.getExposureGain(): Promise<string>Get current exposure gain.
setIris
await camera.setIris(aperture: string): Promise<boolean>Only applicable when exposure mode is set to
manualoriris priority
Set iris aperture.
Available apertures: 'Close', 'F14.0', 'F11.0', 'F9.6', 'F8.0', 'F6.8', 'F5.6', 'F4.8', 'F4.0', 'F3.4', 'F2.8', 'F2.4', 'F2.0', 'F1.8'
getIris
await camera.getIris(): Promise<string>Get current iris aperture.
setExposureBrightness
await camera.setExposureBrightness(brightness: number): Promise<boolean> // 0-27Only applicable when exposure mode is set to
brightness priority
Set exposure brightness.
getExposureBrightness
await camera.getExposureBrightness(): Promise<number>Get current exposure brightness.
setAntiFlicker
await camera.setAntiFlicker(frequency: 'Off' | '50Hz' | '60Hz'): Promise<boolean>Only applicable when exposure mode is set to
autooriris priority
Set anti-flicker frequency.
getAntiFlicker
await camera.getAntiFlicker(): Promise<string>Get current anti-flicker setting.
White Balance
setWhiteBalanceMode
await camera.setWhiteBalanceMode(
mode: 'auto' | 'indoor' | 'outdoor' | 'one push' | 'auto tracking' | 'manual' | 'temperature'
): Promise<boolean>Set white balance mode.
getWhiteBalanceMode
await camera.getWhiteBalanceMode(): Promise<'auto' | 'indoor' | 'outdoor' | 'one push' | 'auto tracking' | 'manual' | 'temperature'>Get current white balance mode.
setRedGain
await camera.setRedGain(value: number): Promise<boolean> // 0-255Only applicable when white balance mode is set to
manual
Set red gain.
getRedGain
await camera.getRedGain(): Promise<number>Get current red gain.
setBlueGain
await camera.setBlueGain(value: number): Promise<boolean> // 0-255Only applicable when white balance mode is set to
manual
Set blue gain.
getBlueGain
await camera.getBlueGain(): Promise<number>Get current blue gain.
setColorTemperature
await camera.setColorTemperature(value: number): Promise<boolean> // 1800-10000KOnly applicable when white balance mode is set to
temperature
Set color temperature.
getColorTemperature
await camera.getColorTemperature(): Promise<number>Get current color temperature.
Image
setMirror
await camera.setMirror(enabled: boolean): Promise<boolean>Enable or disable image mirroring.
getMirror
await camera.getMirror(): Promise<boolean>Get current mirror setting.
setFlip
await camera.setFlip(enabled: boolean): Promise<boolean>Enable or disable image flipping.
getFlip
await camera.getFlip(): Promise<boolean>Get current flip setting.
setBacklightCompensation
await camera.setBacklightCompensation(enabled: boolean): Promise<boolean>Enable or disable backlight compensation.
getBacklightCompensation
await camera.getBacklightCompensation(): Promise<boolean>Get current backlight compensation setting.
setGamma
await camera.setGamma(value: number): Promise<boolean> // 0-4Set gamma correction value.
getGamma
await camera.getGamma(): Promise<number>Get current gamma correction value.
setWideDynamicRange
await camera.setWideDynamicRange(mode: 'Off' | 1 | 2 | 3 | 4 | 5 | 6): Promise<boolean>Set wide dynamic range mode.
getWideDynamicRange
await camera.getWideDynamicRange(): Promise<string | number>Get current wide dynamic range setting.
Image Quality
setBrightness
await camera.setBrightness(value: number): Promise<boolean> // 0-15Only applicable when exposure mode is set to
auto,iris priorityorshutter priority
Set image brightness.
getBrightness
await camera.getBrightness(): Promise<number>Get current brightness value.
setSharpness
await camera.setSharpness(value: number): Promise<boolean> // 0-15Set image sharpness.
getSharpness
await camera.getSharpness(): Promise<number>Get current sharpness value.
setContrast
await camera.setContrast(value: number): Promise<boolean> // 0-15Set image contrast.
getContrast
await camera.getContrast(): Promise<number>Get current contrast value.
setSaturation
await camera.setSaturation(value: number): Promise<boolean> // 0-15Set image saturation.
getSaturation
await camera.getSaturation(): Promise<number>Get current saturation value.
Noise Reduction
set2dNoiseReduction
await camera.set2dNoiseReduction(enabled: boolean): Promise<boolean>Enable or disable 2D noise reduction.
get2dNoiseReduction
await camera.get2dNoiseReduction(): Promise<boolean>Get current 2D noise reduction setting.
set3dNoiseReduction
await camera.set3dNoiseReduction(mode: 'Off' | 'Auto' | '1' | '2' | '3' | '4'): Promise<boolean>Set 3D noise reduction mode.
get3dNoiseReduction
await camera.get3dNoiseReduction(): Promise<string>Get current 3D noise reduction setting.
Streaming
getRTSPUrl
await camera.getRTSPUrl(type?: 'main' | 'sub'): Promise<string>Get RTSP streaming URL. Defaults to 'main' stream if type not specified.
getRTMPUrl
await camera.getRTMPUrl(type?: 'main' | 'sub'): Promise<string>Get RTMP streaming URL. Defaults to 'main' stream if type not specified.
getFLVUrl
await camera.getFLVUrl(type?: 'main' | 'sub'): Promise<string>Get FLV streaming URL. Defaults to 'main' stream if type not specified.
getWebRTCUrl
await camera.getWebRTCUrl(type?: 'main' | 'sub'): Promise<string>Get WebRTC streaming URL. Defaults to 'main' stream if type not specified.
Stream Types:
'main'- High quality stream (default) - 1920×1080 up to 60fps'sub'- Lower quality stream - Various resolutions up to 1280×720
