This is an old revision of the document!
Save the schedule jobs in the Database.
data Parse the JSON formatted data and retrieve the schedule activities..
rowcnt Get the number of row count.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Check the operation mode whether its in encoder or decoder. Save the preseting value of the mode in the Database.
dec_current_preset Save the decoder current preseting values.
enc_current_preset Save the encoder current preseting values.
preset Settings for encoder or decoder.
enc_channels Number of channels. Maximum number of channels is 2 for decoder and 4 for encoder.
opmode Operation mode. Default is Encoder. Possible values: Encoder / Decoder.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the state, preset, encoder/decoder settings in the Database.
enc_current_preset Get the encoder preseting values for the current channel.
dec_current_preset Get the decoder preseting values for the current channel.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the encoder advance settings in the Database.
enc_adv_setting Get the encoder advance setting values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the wifi and its password.
passwd Get the wifi password
passwden Get wifi enable / disable. Default value is disable.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the audio input settings in the Database.
aport Get the audio port. Default value is MIC. Possible values are MIC , MICL
analog_gain_db Get the analog gain decibal value. Default value is 0. The value ranges are -97 to 30.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the color table and pixel format values in the Database and set the color table and pixel format in the fpga.
val Get the value for color table and pixel format.
opt The options are color table and pixel format.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the console value as ttyAMA0 or none.
console_enable Get console value is enabled / disabled.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the Dynamic Domain Name System settings in the Database.
ddns_enable Get the ddns enable value. Default value is Off. Possible values; (On, Off)
ddns_provider Get the ddns provider. Default value is freedns. Possible values: (freedns, freemyip, dyn, domains.google.com, duckdns.org, no-ip.com, tunnelbroker.net, dynv6.com, cloudxnv.net, dnspod.cn, cloudflare.com).
ddns_username Provide the username.
ddns_password Provide the password.
ddns_hostname Hostname for DDNS login.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the logging level. The setting is persistent.
sysdebuglevel Get the system debug level. Possible values 0=None, 1=Error, 2=Information, 3=Diagnostics, 4=Codeflow, 5=Dataflow.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the device name in the Database.
sysdevicename Get the system device name.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Controls composite output (passthru video from camera).
disp_std Get display standard for encoder. Default value is Auto.
disp_input Get display input for encoder. Default value is MACRO_DEFAULT_DISP_INPUT.
save_only Possible values: (True / False)
disp_layout Display layout for decoder. Default value is 1×1.
disp_mode Display mode for decoder. Default value is UltraHD.
disp_std2 Display standard for decoder. Default value is auto.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the DSCP configuration settings in the Database.
diff_serve Get the DSCP configuration value. Default value is 0x00. Possible values are ( 0x00, 0xB8, 0x88, 0x90, 0x98, 0x80, 0x68, 0x70, 0x78, 0x60, 0x48, 0x50, 0x58, 0x28, 0x30, 0x38, 0x01).
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the fpga settings in the Database.
fpgafileglob Get fpga value. Possible values are (boson / cvbs / tamarisk / tau2).
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Control networking settings of the Z3 device such as local IPv4 IP address, netmask, etc. Additionally control Encoder Auto-Start after boot-up and enable/disable showing of advanced WebUI settings.
do_autostart Control automatic stream start after bootup. Possible values: 1 = do autostart 0 = do not autostart.
enc_adv_setting Control appearance of advanced settings on WebUI. Possible values: off, on.
ipmtu Control Ethernet IP Maximum Transmission Unit (MTU) size in bytes. Possible values: 576 to 1500.
eth_speed Control Gigabit Ethernet auto-negotiation allowed speeds. Possible values: AUTO, AUTO-100, 1000, 100, 10.
eth_duplex Control Ethernet auto-negotiation allowed duplex. Possible values: AUTO, FULL, HALF.
local_ip IPv4 address.
local_netmask IPv4 netmask.
default_gw IPv4 default gateway.
local_dnsip DNS server primary.
local_dnsip2 DNS server secondary.
use_dhcp Controls use of DHCP or static IP. Possible values: 1 (DHCP enabled), 0 (DHCP disabled, use static IP).
local_hostname Network hostname.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the login limit settings in the Database
maxlogin mximum number of login limit. Possible value in range (3 to 99 ).
login_window Login window period, the value are considered in seconds. Possible value in range (60 to 32768).
lockout_interval Lockout interval values are mentioned in seconds, which is used when maximum number of login limit is reached. Possible value in range (-1 to 32768)
login_timeout Login timeout
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the NFS settings in the Database.
nfs_enable Enable/Disable nfs
nfs_server Get the nfs server ip address. Default is 192.168.1.6
nfs_server_root Get the server root path / location.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set SNTP (Simple Network Time Protocol) settings in the Database.
enable Enable/Disable SNTP. Possible value: true, false. Default value true.
servers NTP server or list of NTP servers.
timezone Linux TZ database value for Timezone.
timezone_name Name for a time zone. Default is America/Chicago.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the SNMP settings in the database.
power_trap_en Enable/Disable power trap.
input_loss_trap_en Enable/Disable input loss trap.
input_recover_trap_en Enable/Disable input recover trap.
temp_high_trap_en Enable/Disable temp high trap.
temp_recover_trap_en Enable/Disable temperature recover trap.
trap_hosts Trap hosts ipaddress. Default ip address value is 192.168.0.6.
high_temp_suppress hiigh temperature. Default value is 30.
nominal_temp_suppress nominal temperature default value is 30.
snmp_v3_en Enable/Disable SNMP
snmp_v3_encrypt SNMP v3 encrypt value.
snmp_v3_user z3user.
snmp_v3_passwd z3password.
snmp_v3_usrpro snmp v3 usrpro default value is md5.
snmp_v3_encrypt_passwd z3password.
snmp_v3_encpro decrypt value.
snmp_v3_engineid Default value for engineid is 0.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the GPS NMEA enable/disable value in the Database.
nmea_enable Enable/Disable the NMEA. Possible value: on, off.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the ONVIF settings in the Database.
fixed_profile_max Get the Maximum ONVIF profiles to allow (1 or 2).
en_persistent_audio Enable/Disable ONVIF persistent audio channel.
onvif_enable Enable/Disable ONVIF.
list_all_video_sources List all the video source.
ptz_timeout Get the PTZ timeout values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the ONVIF video motion detection and too darkness settings in the Database.
vmd_enable Enable/Disable video motion detection.
vmd_sens sensitivity value required for vmd. Possible value in range: (1 to 100).
vmd_zone_modify Enable/Disable video motion and too darkness zone coordinates.
vmd_vcrop_width crop width of the coordinates.
vmd_vcrop_height crop height for VMD and too_darkness.
vmd_vcrop_x crop startx for VMD and too_darkness.
vmd_vcrop_y crop starty for VMD and too_darkness.
td_enable Enable/Disable too darkness.
td_thresh Threshold value for too darkness. Possible values in range: 1 to 100.
vmd_td_channel Get the channel number. Possible values: 1, 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the RTSP settings in the Database.
rtspd_port Get rtsp port. Default value is 554.
rtspd_timeout Timeout value required for the rtsp connection.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Sett the term server value in the Database.
termserve_remote_enable Enable/Disable remote access to terminal server. Possible values are : on, off.
termserve_shared_enable Enable/Disable shared access to terminal server. Possible values are : on, off.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the video group configuration settings in the Database.
group Video config groups. Default value 0.
nr_enable Enable / Disable NR. Default value is on. Possible value: on/off.
crop_enable Enabled / Disable the crop.
crop_x Crop x coordinates.
crop_y Crop y coordinates.
crop_width Crop width
crop_height Crop height
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the view port for the decoder and update in the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
viewport viewport settings. The default value is fit.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the ViVpss mode settings in the Database.
enc_vivpss_mode_enable Enable/Disable the vivpss mode. Default value is off. Possible values: on, off.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the wifi network settings in the Database.
ssid Get the Wifi service set identifier value.
psk Get the Wifi password.
wifi_client_local_ip Local IP addres.
wifi_client_local_local_netmask Subnet mask for Wifi network.
wifi_client_default_gw Default Gateway be used for Wifi Network.
wifi_client_use_dhcp DHCP server used with Wifi network for DNS resolutions.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save ZFinder enable / disable in the Databse.
zfinder_enable Get ZFinder enable/disable value. Possible values: off, on
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Start the encoder channel and update the state as running in the Database. Once you start the channel, it will not transmit data until the video input is detected.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
actv_preset
vsource video source. Default value is Camera1. Possible values: Camera1 / Camer2 / HDMI1.
vres video resolution. Default value is Follow Input. Possible values: Follow Input, 3840 x 2160, 1920 x 1080, 1440 x 1080, 1280 x 1024, 1280 x 720, 1024 x 768, 960 x 720, 1024 x 576.
vcodec video codec. Default value is H265. Possible values: H265, H264, MJPEG, none.
vgdr video gradual data refresh. Default value is on. Possible value on, off.
vprofile video profile. Default value is high. Possible value high, main, baseline.
vratectrl video rate control. Default value is cbr. Possible value cbr, vbr.
vbitrate video bit rate.
vframeratediv video frame rate. Default value is 1. Possible values: 1 (Full), 2 (Half), 4 (Quarter), 6 (Sixth).
vgopsize video group of picture size. Default value is 60. Possible values: 1 (1 Frame Only), 5 (5 Frames), 8 (8 Frames), 10 (10 Frames), 12 (12 Frames), 15 (15 Frames), 25 (25 Frames), 30 (30 Frames), 50 (50 Frames), 60 (60 Frames), 90 (90 Frames), 100 (100 Frames), 120 (120 Frames), 200 (200 Frames), 240 (240 Frames).
vprotocol video protocol.
vdest video destination port.
vpid video packet identifier. Default value is 221.
vdelay video delay. Default value is 300.
pcrpid PCR packet identifier. Default value is 521.
pcrinterval Default value is 50.
pmtpid program map table packet identifier. Default value is 31.
tsrate bit rate for transport stream. Default value is 5000K.
tslowlat transport stream low latency mode. Default value is off. Possible values: on, off.
feconoff Forward error correction in transport stream enable/ disable. Default value is off. Possible values: on, off.
fecrow Forward error correction row. Default value is 1.
feccol Forward error correction column, Default value is 5.
zixioverhead ZIXI Forward Error Correction total overhead as a percentage of transport rate. Default value is 15.
zixilatency ZIXI target latency (to allow ARQ) in milliseconds. Default value is 500.
zixifecblock ZIXI Forward Error Correction block size in milliseconds. Max value is 1/2 of Zixi Latency. Default value is 50.
zixirateadjen ZIXI dynamic bitrate adjustment according to network conditions. Default value is on. Possible values: on, off.
zixiauthen ZIXI dynamic authentication enable/disable . Default value is off. Possible values: on, off.
zixisession ZIXI session id. Default value is test.
zixiuser ZIXI user identifier. Default value is user.
aenable Audio enable/disable. Default value is on. Possible values: on, off.asource. Default value is MICL.
apair Stereo pair select for digital inputs. Default value is 0. Possible values: (0 (1 2), 1 (3 4), 2 (5 6), 3 (7 8), 260 (1 2,3 4), 548 (1 2,3 4,5 6), 1252 (1 2,3 4,5 6,7 8)).
acodec Audio codec. Default value is fdk_aaclc.
abitrate Audio bit rate. Default value is 128000.
asamplerate Audio sample rate. Default value is 48000.
aport Audio port. Default value is 8700.
apid Audio packet identifier. Default value is 120.
aptspcr Maximum difference between the PTS and PCR in the audio stream Default value is 250.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Start the MTS.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Stop the encoder channel and update the state in the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Stop the MTS.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the current temperature status for CPU and lense.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update/Change whether web login credential required or not in the Database.
require Required web login value. Possible values: 1 or 0
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update the PTZ value in the Database.
data Parse the JSON formatted data and retrieve the PTZ values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update the PTZ preset value in the Database.
data Parse the JSON formatted data and retrieve the PTZ preset values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update the PTZ tour spots value in the Database.
data Parse the JSON formatted data and retrieve the PTZ tour spots values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Control serial port terminal server for VISCA
data Parse the JSON formatted data and retrieve the terminal server values.
term_mode Possible values: client, server
term_protocol Possible values: clearchannel, telnet
term_localport Local TCP port (for server mode)
term_servaddr Remote IP address (for client mode only)
term_servport Remote TCP port (for client mode only)
term_data_bits number of data bits.
term_parity Possible values: None, Odd, Even, Mark, Space
term_stop_bits Stop bits sent at the end of every character.
term_baudrate Possible values: 9600, 19200, 38400, 57600, 115200
term_devicefile device fine name
term_function functionality
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Add a new user in the Database.
Name Get new user name
Level Get the level of permission for the new user name. Possible value: 0 to 7.
Password Get the password for the new user name.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Remove the user from the database.
data Parse the JSON formatted data and retrieve the user name.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update/change the level of permission to the given user name.
data Parse the JSON formatted data and retrieve the user name and level of the permission.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update/change the password to the given user name.
data Parse the JSON formatted data and retrieve the user name and password.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
http://Encoder_IP/cgi-bin/control.cgi?action=download_remove&data=FILENAME http://192.168.0.120/cgi-bin/control.cgi?action=download_remove&data=/media/sda/MOV1_000040.mp4
remove the downloaded media content from the usb drive or sd card.
data Filename from the downloaded media content to be removed from the removable media device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the exthernet 802x information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
interface TEXT,
enable TEXT.
eap TEXT.
anonymous_identity TEXT.
identity TEXT.
password TEXT.
private_key_password TEXT.
Get the schedule job from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
enable INTEGER,
cron TEXT.
func TEXT.
func_args TEXT.
type TEXT.
minutes INTEGER.
hours INTEGER.
day INTEGER.
month INTEGER.
cron TEXT.
Get the Network File Sharing mounted infromation from the device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
mounted TEXT,
Get the video resolution for the current channel from the Database and calculate the aspect ratio.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
numerator INTEGER,
denominator INTEGER.
Get the board and model information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
logo_enable TEXT,
logo_filename TEXT.
logo_width INTEGER.
logo_height INTEGER.
logo_blob BLOB.
ico_blob BLOB.
model_enable TEXT.
model_name TEXT.
Get the current camera state information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
preset TEXT,
enc_channels TEXT.
opmode TEXT.
enc_current_preset TEXT.
dec_current_preset TEXT.
Get the current camera settings from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
zoom_direct_value INTEGER.
white_balance_mode TEXT.
color_gain INTEGER.
color_hue INTEGER.
chroma_suppress INTEGER.
wb_manual_rgain_direct INTEGER.
wb_manual_bgain_direct INTEGER.
visca_localport TEXT.
optical_zoom_only BOOL. 0 or 1.
focus_direct_value INTEGER.
manual_focus TEXT.
flexio_localport TEXT.
exposure_mode INTEGER.
shutter INTEGER.
iris INTEGER.
gain INTEGER.
high_sensitivity INTEGER.
hlc_level INTEGER.
hlc_level_mask INTEGER.
stable_zoom INTEGER.
eflip INTEGER.
lr_reverse INTEGER.
monitor_mode TEXT.
genlock_source INTEGER.
manual_icr TEXT.
zoom_step_size INTEGER.
focus_step_size INTEGER.
img_freeze INTEGER.
hr_mode INTEGER.
img_stabilizer INTEGER.
img_bw INTEGER.
nr_2d_level INTEGER.
nr_3d_level INTEGER.
icr_threshold INTEGER.
slow_shutter BOOL. 0 or 1.
slow_shutter_limit INTEGER.
flicker_reduction BOOL. 0 or 1.
img_stabilizer_level INTEGER.
wide_dynamic_range TEXT.
ve_brightness TEXT.
ve_compensation_type TEXT.
ve_compensation_level TEXT.
tab_index TEXT.
imgvflip INTEGER.
imghflip INTEGER.
imgrotate INTEGER.
Get the current camera exposure values from the visca camera.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
ae_mode TEXT,
shutter TEXT.
iris TEXT.
gain_inquiry TEXT.
sensitivity TEXT.
hls_inquiry TEXT.
min_shutter INTEGER.
max_shutter INTEGER.
shutter_label TEXT.
min_iris INTEGER.
max_iris INTEGER.
iris_label TEXT.
min_gain INTEGER.
max_gain INTEGER.
gain_label TEXT.
Get the current camera monitor mode values from the visca camera.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
modes TEXT.
current_mode TEXT.
Get the current decoder settings from the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
preset TEXT.
channel INTEGER.
url TEXT.
aenable TEXT.
viewport TEXT.
latency_mode TEXT.
max_latency_ms TEXT.
srt_mode TEXT.
srt_latency TEXT.
srt_decrypt TEXT.
srt_pass TEXT.
zixi_fec TEXT.
zixi_fecoverhead TEXT.
zixi_fecblock TEXT.
zixi_latency TEXT.
zixi_decrypt TEXT.
zixi_pass TEXT.
rtsp_flags TEXT.
Get the downloaded file information from the removable storage media.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
job Optional. The job from the schedule tab.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
FileName TEXT.
FileSize TEXT.
LastModified TEXT.
Get the camera model of drs tamarisk settings fromt the Database.
job Optional. The job from the schedule tab.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
color_pallette TEXT.
tab_index TEXT.
color_pallette_disabled TEXT.
Get the current channel encoder settings from the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
preset TEXT,
channel INTEGER.
vbitrate TEXT.
vframeratediv INTEGER.
vsource TEXT.
vcodec TEXT.
vprofile TEXT.
vprotocol TEXT.
avmux_index TEXT.
vgdr TEXT.
vdest TEXT.
aenable TEXT.
acodec TEXT.
abitrate TEXT.
asamplerate TEXT.
aport TEXT.
apair INTEGER.
vres TEXT.
vgopsize INTEGER.
vpid INTEGER.
apid INTEGER.
zixiauthen TEXT.
zixisession TEXT.
zixiuser TEXT.
zixioverhead TEXT.
zixifecblock TEXT.
zixilatency TEXT.
zixirateadjen TEXT.
fecrow INTEGER.
feccol INTEGER.
feconoff TEXT.
aptspcr INTEGER.
tslowlat TEXT.
tsrate TEXT.
pcrpid INTEGER.
pcrinterval INTEGER.
pmtpid INTEGER.
klvenable TEXT.
klvmode TEXT.
klvmuxmethod TEXT.
klvsrc TEXT.
klvbrate TEXT.
klvserialbaud TEXT.
klvpid TEXT.
vratectrl TEXT.
vdelay INTEGER.
storage TEXT.
fprefix TEXT.
asource TEXT.
authonoff TEXT.
auth_user TEXT.
auth_passwd TEXT.
auxonoff TEXT.
filesize TEXT.
nfstrength TEXT.
telopenable TEXT.
teloptext TEXT.
teloplocation TEXT.
telopcharsize TEXT.
teloptextcolor TEXT.
telopoutlineenable TEXT.
telopoutlinecolor TEXT.
gps_overlay_enable TEXT.
gps_overlay_device TEXT.
gps_overlay_location TEXT.
gps_overlay_char_size TEXT.
pipenable TEXT.
piplocation TEXT.
vquality TEXT.
vinterlacemode TEXT.
vmulticastdest TEXT.
amulticastdest TEXT.
rtsp_auth_enable TEXT.
rtsp_auth_username TEXT.
rtsp_auth_password TEXT.
rtsp_transport_mode TEXT.
lowdelay_opt TEXT.
vcropaspect TEXT.
vcrop_enable TEXT.
vcrop_width INTEGER.
vcrop_height INTEGER.
vcrop_x INTEGER.
vcrop_y INTEGER.
rotate_enable INTEGER.
rotate_angle INTEGER.
rtmp265_enable TEXT.
srt_pass TEXT.
srt_encrypt INTEGER.
srt_mode INTEGER.
srt_destAddr TEXT.
mmulticastdest TEXT.
mport TEXT.
frame_loss_mode TEXT.
frame_loss_gap INTEGER.
frame_loss_overshot INTEGER.
mounts TEXT.
source_status_str TEXT.
Get the file type and its information from the removable storage media.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
filepicker_filename TEXT,
filepicker_size INTEGER.
filepicker_lastmodified TEXT.
Get the removable storage infromation from the device using fdisk command.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
mounts TEXT,
Get the current camera focus step values from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
focus_step_size INTEGER,
Get the current fpga from firmware filename.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
fpgafileglob TEXT,
options TEXT.
Get the decoder history infromation from the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
channel TEXT,
histidx TEXT.
url TEXT.
Get the internet protocol infromation from the board.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
local_ip TEXT,
local_netmask TEXT.
default_gw TEXT.
ipmtu TEXT.
eth_speed TEXT.
eth_duplex TEXT.
do_autostart BOOLEAN.
Get the ONVIF miscallenous settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
list_all_video_sources INTEGER,
dns_from_dhcp INTEGER,
ntp_from_dhcp INTEGER,
ntp_enable INTEGER,
daylightsaving INTEGER,
timezone TEXT.
http_enable INTEGER,
http_port INTEGER,
https_enable INTEGER,
https_port INTEGER,
rtsp_enable INTEGER,
rtsp_port INTEGER,
discoverable INTEGER,
ntp TEXT.
dns_search TEXT.
ptz_timeout TEXT.
primary fixed_profile_max INTEGER,
secondary fixed_profile_max INTEGER,
en_persistent_audio TEXT.
onvif_enable BOOLEAN.
vmd_enable BOOLEAN.
Get the ONVIF video motion detection and too darkness settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
vmd_sens INTEGER,
vmd_zone_modify TEXT.
vmd_vcrop_width INTEGER.
vmd_vcrop_height INTEGER.
vmd_vcrop_x INTEGER.
vmd_vcrop_y INTEGER.
td_enable TEXT.
td_thresh INTEGER.
vmd_td_channel TEXT.
Get the current permission settings for admin, operators, and users from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
username TEXT,
userlevel TEXT.
api_command TEXT.
superadmin TEXT.
admin TEXT.
operator1 TEXT.
operator2 TEXT.
user1 TEXT.
user2 TEXT.
user3 TEXT.
anonymous TEXT.
Get the current PTZ settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
token TEXT,
node TEXT.
name TEXT.
enabled BOOLEAN.
pelcoaddr INTEGER.
tcpport INTEGER.
ptztype TEXT.
flip TEXT.
pos TEXT.
maxtilt INTEGER.
Get the PTZ preseting values from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
profiletoken TEXT,
token TEXT.
name TEXT.
pan FLOAT.
tilt FLOAT.
zoom FLOAT.
Get the PTZ tour information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
ProfileToken TEXT,
PresetTourToken TEXT.
name TEXT.
autostart BOOLEAN.
RecurringTime INTEGER.
RecurringDuration TEXT.
PresetTourDirection INTEGER.
RandomPresetOrder BOOLEAN.
ProfileToken TEXT.
PresetTourToken TEXT.
RowIndex INTEGER.
PresetDetailToken TEXT.
PresetDetailHome BOOLEAN.
StayTime TEXT.
pan FLOAT.
tilt FLOAT.
zoom FLOAT.
pspeed FLOAT.
tspeed FLOAT.
zspeed FLOAT.
Get the Simple Network Management Protocol values from the Database
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
power_trap_en INTEGER,
input_loss_trap_en INTEGER.
input_recover_trap_en INTEGER.
temp_high_trap_en INTEGER.
temp_recover_trap_en INTEGER.
high_temp INTEGER.
nominal_temp INTEGER.
high_temp_suppress INTEGER.
nominal_temp_suppress INTEGER.
trap_hosts INTEGER.
snmp_v3_en INTEGER.
snmp_v3_user TEXT.
snmp_v3_passwd TEXT.
snmp_v3_usrpro TEXT.
snmp_v3_encrypt INTEGER.
snmp_v3_encrypt_passwd TEXT.
snmp_v3_encpro TEXT.
snmp_v3_engineid TEXT.
Get the Secure Socket Layer settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
https_enable TEXT,
http_enable TEXT.
https_port INTEGER.
http_port INTEGER.
cert_status TEXT.
key_status TEXT.
Get the available memory infromation from the device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
mem_free_kb TEXT,
Get the current system settings from the Database and the ip information from the device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
local_ip TEXT,
local_netmask TEXT.
preset TEXT.
enc_channels TEXT.
opmode TEXT.
username TEXT.
userlevel TEXT.
do_autostart BOOLEAN.
syspassword TEXT.
session_id TEXT.
disp_std TEXT.
disp_std2 TEXT.
disp_input TEXT.
disp_mode TEXT.
disp_layout TEXT.
enc_adv_setting TEXT.
enc_vivpss_mode_enable TEXT.
enable_sntp TEXT.
sntp_servers TEXT.
enable_snmp TEXT.
sysdevicename TEXT.
timezone TEXT.
timezone_name TEXT.
termserve_remote_enable TEXT.
termserve_shared_enable TEXT.
zfinder_enable TEXT.
diff_serve INTEGER.
enable_ptp TEXT.
ptp_role TEXT.
nmea_enable TEXT.
nfs_enable TEXT.
nfs_server TEXT.
nfs_server_root TEXT.
ddns_enable TEXT.
ddns_provider TEXT.
ddns_username TEXT.
ddns_password TEXT.
rtspd_port INTEGER.
rtspd_timeout INTEGER.
maxlogin INTEGER.
login_window INTEGER.
lockout_interval INTEGER.
login_timeout INTEGER.
require_web_login BOOLEAN.
Get the remote terminal information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
term_mode TEXT,
term_protocol TEXT.
term_localport TEXT.
term_servaddr TEXT.
term_servport TEXT.
term_data_bits TEXT.
term_parity TEXT.
term_stop_bits TEXT.
term_baudrate TEXT.
term_devicefile TEXT.
term_function TEXT.
Get the ONVIF user information and the permission level from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
Name TEXT,
Level INTEGER.
Password TEXT.
Password_MD5 TEXT.
Password_SHA256 TEXT.
Password_SHA512_256 TEXT.
Get the current video group settings from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
vgroup INTEGER.
crop_enable TEXT.
crop_width INTEGER.
crop_height INTEGER.
crop_x INTEGER.
crop_y INTEGER.
nr_enable TEXT.
Get the Wifi details from the device and wifi client information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
networks TEXT,
cur_network TEXT,
cur_pass TEXT,
ap_pass TEXT,
ap_pass_en BOOLEAN.
ap_ssid TEXT,
wifi_client_local_ip TEXT,
wifi_client_local_netmask TEXT.
wifi_client_default_gw TEXT.
wifi_client_use_dhcp BOOLEAN.
Get the current camera zoom step values from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
zoom_step_size INTEGER,
Upload the z3 image for e.g. (z3-30-0139-mfr.img or z3-30-0139-upd.img) in the z3 device.
Before uploading the new image, it checks, whether the device has enough free memory or not and removes the coredump files. If the image is *mfr.img then it removes the default database from the data partition. If its *upd.img then it will not remove the database values.
Note:
It takes approximately 5 minutes to update; DO NOT SEND ANY OTHER API Commands after uploading the image for at least 5 minutes. (time.sleep(300) or equivalent in scripts)
img_file Get the file name which needs to be flashed in the z3 device.
Flash the image and reboot the device.
Note:
It takes approximately 5 minutes to update; DO NOT SEND ANY OTHER API Commands after uploading the image for at least 5 minutes. (time.sleep(300) or equivalent in scripts)
See download_remove to remove files from the Generic Actions (POST) action
http://<ENCODER_IP>/download_media.cgi?mediafile=/location/filename
For e.g.
http://<ENCODER_IP>/download_media.cgi?mediafile=/media/sda1/MOV1_000001.mp4
Download the media file. If the output format is mp4 or TS file, then only z3 device allows downloading the files. Also provides the option for deleting the file.
mediafile Get the media file name.
JSON formatted table with values below.
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
File Name Name of the download file name .
File Size Size of the download file name.
Last Modified Last modified the file date and time.
http://<ENCODER_IP>/download.html?chn=1
chn =[1,2,3,4]
List the download content. The content will be either .mp4 or .ts file format.
Write encoder settings to active preset. See Python example code for Seting Configuration below
Requests an update to encoder_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
Requests an update to stream_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
Requests an update to astream_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
Requests an update to source_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
To set the encode configuration per channel the SetEncoder action is used with a post. All variables should be present or they will be replaced with a defualt that may not be valid for your application. More than one channel can be set per command. It is recommended you first read the current settings from the encoder then modify them and send the new settings back as in the Python example below:
import requests, json, sys
server_url='http://192.168.0.120/cgi-bin/control.cgi'
channel = 1
enc_cfg = requests.get(server_url, params='ctrl=enc&chn={}'.format(channel))
print enc_cfg.json()
enc_cfg_json=enc_cfg.json()
enc_cfg_json['vframeratediv'] = 2 #set frame rate divider to 2
new_cfg = {}
new_cfg['action'] = 'SetEncoder'
for key, value in enc_cfg_json.iteritems():
print "key = {} value = {}".format(key,value)
new_idx = "enc_{}_{}".format(channel,key)
print "setting {} to {}".format(new_idx,value)
new_cfg[new_idx] = value
print new_cfg
requests.post(server_url, data=new_cfg)
http://<ENCODER_IP>/snapshot.cgi?size=3840x2160&quality=100 http://<ENCODER_IP>/snapshot.cgi?chn=1&size=1280x720&quality=80
valid options are:
* *size =[any supported valid resolution]
chn =[1,2,3,4]
quality** =[0-100] supported resolutions are: 4K Models Only 3840×2160 2560×1440 4K and HD Models 1920×1080 1440×1080 1280×1024 1280×720 1024×768 960×720 1024×576 800×600 720×576 704×576 720×480 640×512 640×480 640×360 352×576 420×380 352×288 352×240 336×256 320×240 320×180 **
Python example of updating and reading encoder statistics:
import requests, json, sys
server_url='http://192.168.0.120/cgi-bin/control.cgi'
requests.post(server_url, {'action': 'EncoderStatus'} )
requests.post(server_url, {'action': 'StreamStatus'} )
requests.post(server_url, {'action': 'AStreamStatus'} )
requests.post(server_url, {'action': 'SourceStatus'} )
requests.post(server_url, {'action': 'TempStatus'} )
print requests.get(server_url, params='ctrl=stats&chn=null').json()
Example output:
{u'status': u'OK',
u'astream_status_str': u'\tChannel 6 Codec fdk_aaclc Samplerate 48000 Input MICL Frames 32287820 OK',
u'temp_status_str': u' LENS 29 CPU 78.700 FPGA 89.8 OK',
u'ret': u'0',
u'encoder_status_str': u' *** Encode Bitstream Received Statistics *** CH | Bitrate (Kbps) | Actual Bitrate | FPS | Actual FPS | Key-frame FPS | Width | Height ------------------------------------------------------------------------------------------------------------
1 | 4000.00 | 4092.18 | 60.0 | 59.8 | 1.0 | 1920 | 1080 | OK',
u'source_status_str': u' CAMERA 1920x1080p 60.00 fps\n',
u'stream_status_str': u'Channel 1 URL rtsp Frames 12883581 OK'}
By default, no authentication is required to access the HTTP API.
To enable authentication, go to the “System” tab “Device Management” section. Click on the “Set Password” button.
The username will be “admin” The authentication method is HTTP Digest authentication. HTTP Basic authentication is not supported.
import requests,json, sys
from requests.auth import HTTPDigestAuth
auth=HTTPDigestAuth('admin','mypassword')
print requests.get(server_url, params='ctrl=stats&chn=null', auth=auth).json()
The sample python scripts below require Python3.x.
The requests package must be installed.
You can install using
1) Use the Ubuntu package manager
sudo apt install python3-requests
2) Use the Python3 native package installer
sudo pip3 install requests
Save the state, preset, encoder/decoder settings for the user.
import requests
import json
import sched
import time
import enum
import datetime
import argparse
from requests.auth import HTTPDigestAuth
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
print(msg, flush=True)
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
payload = "action=SaveUser&enc_current_preset=charles";
rs = http_request(payload)
print_immediately(
"{:>6}: {} setip_respose response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 saveUser_DIGEST_ARGPARSE.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
SaveUser response: {"ret":"0","status":"OK"}
Control networking settings of the Z3 device such as local IPv4 IP address, netmask, DNS Server primary, DNS Server secondary, etc. Additionally control Encoder Auto-Start after boot-up and enable/disable showing of advanced WebUI settings.
import requests
import json
import sched
import time
import enum
import datetime
import argparse
from requests.auth import HTTPDigestAuth
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
print(msg, flush=True)
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-newip', help='Set this IP')
parser.add_argument('-mask', help='Subnet Mask',default='255.255.255.0')
parser.add_argument('-gateway', help='Network Gateway',default='172.30.1.1')
parser.add_argument('-dns1', help='DNS 1',default='8.8.8.8')
parser.add_argument('-dns2', help='DNS 2',default='8.8.4.4')
parser.add_argument('-ipmtu', help='MTU Speed',default=1500)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
payload = "action=SetIp&local_ip=172.30.1.112&local_netmask=255.255.255.0&default_gw=172.30.1.1&local_dnsip=8.8.8.8&local_dnsip2=8.8.4.4&use_dhcp=no&ipmtu=1500ð_speed=AUTOð_duplex=AUTO&do_autostart=1&enc_adv_setting=off";
rs = http_request(payload)
print_immediately(
"{:>6}: {} setip_respose response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 set_ip_DIGEST_ARGPARSE.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
dns1='8.8.8.8', dns2='8.8.4.4', gateway='172.30.1.1', ip='192.168.1.105', ipmtu=1500, mask='255.255.255.0', newip=None, passwd='admin', username='admin'
setip_respose response: {"ret":"0","status":"OK"}
Get the current camera state information from the Database.
import requests
import json
import sched
import time
import enum
import datetime
import argparse
from requests.auth import HTTPDigestAuth
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
print(msg, flush=True)
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
def http_request_get(payload):
try:
if args.username:
r = requests.get(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.get(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
payload='ctrl=cam_state&chn=null';
rs = http_request_get(payload)
print_immediately(
"{:>6}: {} Sys response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 sys_DIGEST_ARGPARSE.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
(ip='192.168.1.105', passwd='admin', username='admin')
Sys response: {"camera1_if_type":"Sony_LVDS","camera2_if_type":"CVBS","enc_channels":"1,2","enc_current_preset":"charles","fpgafileglob":"fpga_none.bin|fpga2_0139_cvbs.bin","preview_auto_start":"1","ret":"0","visca_present":"true"}
Send control commands to boson camera. Only one command can be sent at a time;
import requests
import json
import sched
import time
import enum
import datetime
import argparse
import sys
from requests.auth import HTTPDigestAuth
if sys.version_info[0] <3:
raise Exception("Python 3 or a more recent version is required.")
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
# print(msg, flush=True)
print(msg)
sys.stdout.flush()
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
def http_request_get(payload):
try:
if args.username:
r = requests.get(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.get(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
# Set Zoom STEP
zooms=args.zs;
zoomstep=args.zoom_step;
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
# Boson min Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000000000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson mid Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000015000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson mid Zoom xB0 yA0
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000015000000B0000000A0';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson max Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000030000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson no Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000000000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 Zoom_Boson.py -ip 172.28.30.103
Example output:
(ip='172.28.30.103', passwd='admin', username=None, zoom_step=False, zs='3')
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000000000000A000000080","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000015000000A000000080","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000015000000B0000000A0","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000030000000A000000080","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Send control commands to visca camera. Only one command can be sent at a time;
import requests
import json
import sched
import time
import enum
import datetime
import argparse
import sys
from requests.auth import HTTPDigestAuth
if sys.version_info[0] <3:
raise Exception("Python 3 or a more recent version is required.")
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
# print(msg, flush=True)
print(msg)
sys.stdout.flush()
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
def http_request_get(payload):
try:
if args.username:
r = requests.get(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.get(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
parser.add_argument('-z', help='Zoom STEP level 0 - 7; Default 3',default='3')
parser.add_argument('-zs', help='Do Zoom STEP defined using -z, else normal zoom',action='store_true')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
# Set Zoom STEP
zooms=args.z;
zoomstep=args.zs;
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
if zoomstep == True:
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_wide_var ' zooms;
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_tele_var ' zooms;
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
else:
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_tele_std';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(5)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_wide_std';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(5)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute with out zoom step size
python3.8 Zoom_visca.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
(ip='192.168.1.105', passwd='admin', username='admin', z='3', zs=False)
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":3040,"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":0,"ret":"0","status":"OK"}
Command to execute with zoom step size
python3.8 Zoom_visca.py -ip 192.168.1.105 -username admin -passwd admin -z 3 -zs
Example output:
(ip='192.168.1.105', passwd='admin', username='admin', z='3', zs=True)
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":0,"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":7304,"ret":"0","status":"OK"}
Read the encoder status.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
status The encoder status can be RUNNING/ STOPPED/ IDLE/ Couldn't deduct input on camera.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the sensor id and read the video inputs from the Database.
sensorid Sensor ID.
vport video port is Camera source. Possible values: 1 = Camera 1, 2 = Camera 2.
friendly_name name of the video source.
vdevice Video device. Possible values: MIPI, SONYLVDS, LT6911
input_index input device. Possible values: 0, 1.
bus device address. Default NULL
enabled Video input enabled or disabled. Default is 1. Possible values: 0, 1.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the Wifi password.
ssid Read the service set identifier
psk Provide the wifi password.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Querry the PTZ values for the angle.
data Read the json table and retrieve the index and querry type. Possible querry are YawAngle, PitchAngle, RollAngle, All.
YawAngle provide the yaw angle value from the PTZ.
PitchAngle provide the pitch angle value from the PTZ.
RollAngle provide the roll angle value from the PTZ.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Load the active preset value from the Database and update in the state table database.
enc_current_preset Get the preset row and check the opermation mode. The operation modes are encoder / decoder.
cur_preset Provide the current presetting values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the password for the login user.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Logout from the system and update in the Database.
Authorization Get the permission level.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Add/Update the overlay values in the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
rgn_idx Index to map overlay to.
type Type of overlay to be used possible values: text or png.
source In the case of text overlay this would be the source text for png overlay this is the path to the png on the encoder. Images must be uploaded to board to be used.
location This is the location of the overlay. Possible values: 'top_left', 'top_right', 'top_center', 'bottom_left', 'bottom_right', 'bottom_center', 'x,y' (negative numbers not supported for x or y).
char_size For text overlay this is the character size. Possible values: 16,32,64, 128.
layer This will set the layer for the overly higher numbers will overlay over lower numbers if overlapping.
alpha Sets the transparency of the text. Possible values: 0-255.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Stop overlay.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
rgn_idx Index of overly for this channel.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Send absolute move command to the PTZ.
data Parse the JSON formatted data and retrieve the mode, position and speed value. The mode values can be PanTilt / Zoom / Both.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Send PTZ auxiliary value to the PTZ.
data Parse the JSON formatted data and retrieve the mode, position and speed value.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Remove the Ptz preset values for the user.
data Parse the JSON formatted data and retrieve the mode, position and speed value. The mode values can be PanTilt / Zoom / Both.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Send continous move command to the PTZ.
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Send preset value to PTZ.
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the new tour spot and update in the Database.
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Move the Ptz to the input position
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Preset the Ptz based on the value.
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the ptz status and degree value from the ptz
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Remove the ptz tour spot
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the preseting value in the PTZ
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Start the PTZ tour
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Stop the PTZ
data Parse the JSON formatted data and retrieve the mode, position, speed value, ptz_timeout, profile token.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Delete the schedule jobs from the Database.
purgelist List of schedule jobs to be removed.
rowcnt Number of rows.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Read the operation mode. Whether its encoding / decoding. Stop the channel encoding and restart the board
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Saving the camera settings in the Database.
zoom_direct_value Zoom value. Possible values: 0 (wide) to 0x7ac0 (full zoom)
white_balance_mode White balance mode. Default value is auto. Possible values: auto / manual / indoor/ one-push / auto trace / sodium lamp auto / sodium lamp fixed / sodium lamp outdoor.
color_gain color gain. Default value is 4. Possible values: Range from 0 (60%) to 14 (200%)
color_hue color hue. Default value is 7. Possible values: Range from 0 (60%) to 14 (200%)
chroma_suppress Chroma suppress. Default value is 1. Possible values: 0=none, 1, 2, 3
wb_manual_rgain_direct white balance manual red gain. Default value is 190. Possible values: 0 to 255
wb_manual_bgain_direct white balance manual blue gain. Default value is 190. Possible values: 0 to 255
optical_zoom_only optical zoom only. Default value is 0. Possible values: 0, 1
focus_direct_value focus direct value. Default value is 4096. Possible values: 0x1000 to 0xf000
manual_focus Manual focus. Default value is auto. Possible values: auto, manual
exposure_mode Exposure mode. Default value is 0. Possible values: 0 - Auto, 10 - Shutter Priority, 11 - Iris -Priority, 3 - Manual.
shutter Shutter. Default value is 7.
iris Iris. Default value is 0.
gain Gain. Default value is 0.
high_sensitivity high sensitivity value. Default value is 3. Possible values 0, 1.
hlc_level hlc level. Default value is 0. Possible values in range 0 to 3.
hlc_level_mask mask value of hlc level. Default value is 0. Possible values 0, 1.
stable_zoom stable zoom on or off. Default value is off.
eflip Default value is 5. Possible values 0, 1.
lr_reverse Default value is 0. Possible values 0, 1.
monitor_mode Default value is 1080p-59.94.
genlock_source Default value is 2.
zoom_step_size Default value is 4. Possible values in range (1 - 7).
focus_step_size Default value is 1. Possible values in range (0 - 7).
manual_icr Default value is Off. Possible values: On, Off, Auto, Auto Color
img_freeze Default value is 0. Possible values: 0, 1.
hr_mode High resolution mode. Default value is 0. Possible values: 0, 1.
img_stabilizer Default value is 0. Possible values 0, 1.
img_bw Image black white. Default value is 0. Possible values 0, 1.
nr_2d_level Default value is 5. Possible values in range (0 - 5).
nr_3d_level Default value is 4. Possible values in range (0 - 5).
icr_threshold Default value is 14. Possible values in range (0-255 for 4K camera, 0-28 for HD camera).
slow_shutter Default value is 0. Possible values: 0, 1.
slow_shutter_limit Default value is 4. Possible values in range: (1 to 6)
flicker_reduction Default value is 0. Possible values: 0, 1.
img_stabilizer_level Default value is 0. Possible values: 0, 2.
wide_dynamic_range Default value is 3.
ve_brightness Default value is 3. Possible values in range: 0, 6.
ve_compensation_type Default value is 2. Possible values in range: 0, 3.
ve_compensation_level Default value is 1. Possible values in range: 0, 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save color pallete settings of boson camera in the Database.
color_pallette Color pallete. Default value is whitehot.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save color pallete settings of DRS Tamarisk camera in the Database.
color_pallette Color pallete. Default value is whitehot.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Saving camera link settings in the Database.
pxl_format Pixel format. Default value is 1.
color_table Color table. Default value is whitehot.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Saving camera Lx settings in the Database.
SONY_ExposureMode Exposure Mode. Default value is 32852. Possible values: 32848 (Program Auto), 32849 (Aperture Priority), 32850 (Shutter Priority), 32851 (Manual Exposure), 32852 (Intelligent Auto).
SONY_ShutterSpeed Shutter speed. Defualt value is NULL.
SONY_ISO ISO. Defualt value is NULL.
SONY_ExposureComp Exposure comp. Defualt value is NULL.
SONY_WhiteBalance White balance. Defualt value is NULL.
SONY_ColorTemp Color temperature. Defualt value is NULL.
SONY_APS_C APS_C. Defualt value is NULL.
SONY_NtscPalSelect NTSC / PAL selection. Defualt value is NULL.
SONY_MovieSteadyMode Movie steady mode. Defualt value is NULL.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Saving camera TAU settings in the Database.
color_table color table value .
is_active Active/Deactive. Default value is 0.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the schedule jobs in the Database.
data Parse the JSON formatted data and retrieve the schedule activities..
rowcnt Get the number of row count.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Check the operation mode whether its in encoder or decoder. Save the preseting value of the mode in the Database.
dec_current_preset Save the decoder current preseting values.
enc_current_preset Save the encoder current preseting values.
preset Settings for encoder or decoder.
enc_channels Number of channels. Maximum number of channels is 2 for decoder and 4 for encoder.
opmode Operation mode. Default is Encoder. Possible values: Encoder / Decoder.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the state, preset, encoder/decoder settings in the Database.
enc_current_preset Get the encoder preseting values for the current channel.
dec_current_preset Get the decoder preseting values for the current channel.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the encoder advance settings in the Database.
enc_adv_setting Get the encoder advance setting values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the wifi and its password.
passwd Get the wifi password
passwden Get wifi enable / disable. Default value is disable.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the audio input settings in the Database.
aport Get the audio port. Default value is MIC. Possible values are MIC , MICL
analog_gain_db Get the analog gain decibal value. Default value is 0. The value ranges are -97 to 30.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the color table and pixel format values in the Database and set the color table and pixel format in the fpga.
val Get the value for color table and pixel format.
opt The options are color table and pixel format.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the console value as ttyAMA0 or none.
console_enable Get console value is enabled / disabled.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the Dynamic Domain Name System settings in the Database.
ddns_enable Get the ddns enable value. Default value is Off. Possible values; (On, Off)
ddns_provider Get the ddns provider. Default value is freedns. Possible values: (freedns, freemyip, dyn, domains.google.com, duckdns.org, no-ip.com, tunnelbroker.net, dynv6.com, cloudxnv.net, dnspod.cn, cloudflare.com).
ddns_username Provide the username.
ddns_password Provide the password.
ddns_hostname Hostname for DDNS login.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the logging level. The setting is persistent.
sysdebuglevel Get the system debug level. Possible values 0=None, 1=Error, 2=Information, 3=Diagnostics, 4=Codeflow, 5=Dataflow.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the device name in the Database.
sysdevicename Get the system device name.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Controls composite output (passthru video from camera).
disp_std Get display standard for encoder. Default value is Auto.
disp_input Get display input for encoder. Default value is MACRO_DEFAULT_DISP_INPUT.
save_only Possible values: (True / False)
disp_layout Display layout for decoder. Default value is 1×1.
disp_mode Display mode for decoder. Default value is UltraHD.
disp_std2 Display standard for decoder. Default value is auto.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the DSCP configuration settings in the Database.
diff_serve Get the DSCP configuration value. Default value is 0x00. Possible values are ( 0x00, 0xB8, 0x88, 0x90, 0x98, 0x80, 0x68, 0x70, 0x78, 0x60, 0x48, 0x50, 0x58, 0x28, 0x30, 0x38, 0x01).
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the fpga settings in the Database.
fpgafileglob Get fpga value. Possible values are (boson / cvbs / tamarisk / tau2).
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Control networking settings of the Z3 device such as local IPv4 IP address, netmask, etc. Additionally control Encoder Auto-Start after boot-up and enable/disable showing of advanced WebUI settings.
do_autostart Control automatic stream start after bootup. Possible values: 1 = do autostart 0 = do not autostart.
enc_adv_setting Control appearance of advanced settings on WebUI. Possible values: off, on.
ipmtu Control Ethernet IP Maximum Transmission Unit (MTU) size in bytes. Possible values: 576 to 1500.
eth_speed Control Gigabit Ethernet auto-negotiation allowed speeds. Possible values: AUTO, AUTO-100, 1000, 100, 10.
eth_duplex Control Ethernet auto-negotiation allowed duplex. Possible values: AUTO, FULL, HALF.
local_ip IPv4 address.
local_netmask IPv4 netmask.
default_gw IPv4 default gateway.
local_dnsip DNS server primary.
local_dnsip2 DNS server secondary.
use_dhcp Controls use of DHCP or static IP. Possible values: 1 (DHCP enabled), 0 (DHCP disabled, use static IP).
local_hostname Network hostname.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the login limit settings in the Database
maxlogin mximum number of login limit. Possible value in range (3 to 99 ).
login_window Login window period, the value are considered in seconds. Possible value in range (60 to 32768).
lockout_interval Lockout interval values are mentioned in seconds, which is used when maximum number of login limit is reached. Possible value in range (-1 to 32768)
login_timeout Login timeout
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the NFS settings in the Database.
nfs_enable Enable/Disable nfs
nfs_server Get the nfs server ip address. Default is 192.168.1.6
nfs_server_root Get the server root path / location.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set SNTP (Simple Network Time Protocol) settings in the Database.
enable Enable/Disable SNTP. Possible value: true, false. Default value true.
servers NTP server or list of NTP servers.
timezone Linux TZ database value for Timezone.
timezone_name Name for a time zone. Default is America/Chicago.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the SNMP settings in the database.
power_trap_en Enable/Disable power trap.
input_loss_trap_en Enable/Disable input loss trap.
input_recover_trap_en Enable/Disable input recover trap.
temp_high_trap_en Enable/Disable temp high trap.
temp_recover_trap_en Enable/Disable temperature recover trap.
trap_hosts Trap hosts ipaddress. Default ip address value is 192.168.0.6.
high_temp_suppress hiigh temperature. Default value is 30.
nominal_temp_suppress nominal temperature default value is 30.
snmp_v3_en Enable/Disable SNMP
snmp_v3_encrypt SNMP v3 encrypt value.
snmp_v3_user z3user.
snmp_v3_passwd z3password.
snmp_v3_usrpro snmp v3 usrpro default value is md5.
snmp_v3_encrypt_passwd z3password.
snmp_v3_encpro decrypt value.
snmp_v3_engineid Default value for engineid is 0.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the GPS NMEA enable/disable value in the Database.
nmea_enable Enable/Disable the NMEA. Possible value: on, off.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the ONVIF settings in the Database.
fixed_profile_max Get the Maximum ONVIF profiles to allow (1 or 2).
en_persistent_audio Enable/Disable ONVIF persistent audio channel.
onvif_enable Enable/Disable ONVIF.
list_all_video_sources List all the video source.
ptz_timeout Get the PTZ timeout values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save the ONVIF video motion detection and too darkness settings in the Database.
vmd_enable Enable/Disable video motion detection.
vmd_sens sensitivity value required for vmd. Possible value in range: (1 to 100).
vmd_zone_modify Enable/Disable video motion and too darkness zone coordinates.
vmd_vcrop_width crop width of the coordinates.
vmd_vcrop_height crop height for VMD and too_darkness.
vmd_vcrop_x crop startx for VMD and too_darkness.
vmd_vcrop_y crop starty for VMD and too_darkness.
td_enable Enable/Disable too darkness.
td_thresh Threshold value for too darkness. Possible values in range: 1 to 100.
vmd_td_channel Get the channel number. Possible values: 1, 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the RTSP settings in the Database.
rtspd_port Get rtsp port. Default value is 554.
rtspd_timeout Timeout value required for the rtsp connection.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Sett the term server value in the Database.
termserve_remote_enable Enable/Disable remote access to terminal server. Possible values are : on, off.
termserve_shared_enable Enable/Disable shared access to terminal server. Possible values are : on, off.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the video group configuration settings in the Database.
group Video config groups. Default value 0.
nr_enable Enable / Disable NR. Default value is on. Possible value: on/off.
crop_enable Enabled / Disable the crop.
crop_x Crop x coordinates.
crop_y Crop y coordinates.
crop_width Crop width
crop_height Crop height
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the view port for the decoder and update in the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
viewport viewport settings. The default value is fit.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the ViVpss mode settings in the Database.
enc_vivpss_mode_enable Enable/Disable the vivpss mode. Default value is off. Possible values: on, off.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Set the wifi network settings in the Database.
ssid Get the Wifi service set identifier value.
psk Get the Wifi password.
wifi_client_local_ip Local IP addres.
wifi_client_local_local_netmask Subnet mask for Wifi network.
wifi_client_default_gw Default Gateway be used for Wifi Network.
wifi_client_use_dhcp DHCP server used with Wifi network for DNS resolutions.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Save ZFinder enable / disable in the Databse.
zfinder_enable Get ZFinder enable/disable value. Possible values: off, on
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Start the encoder channel and update the state as running in the Database. Once you start the channel, it will not transmit data until the video input is detected.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
actv_preset
vsource video source. Default value is Camera1. Possible values: Camera1 / Camer2 / HDMI1.
vres video resolution. Default value is Follow Input. Possible values: Follow Input, 3840 x 2160, 1920 x 1080, 1440 x 1080, 1280 x 1024, 1280 x 720, 1024 x 768, 960 x 720, 1024 x 576.
vcodec video codec. Default value is H265. Possible values: H265, H264, MJPEG, none.
vgdr video gradual data refresh. Default value is on. Possible value on, off.
vprofile video profile. Default value is high. Possible value high, main, baseline.
vratectrl video rate control. Default value is cbr. Possible value cbr, vbr.
vbitrate video bit rate.
vframeratediv video frame rate. Default value is 1. Possible values: 1 (Full), 2 (Half), 4 (Quarter), 6 (Sixth).
vgopsize video group of picture size. Default value is 60. Possible values: 1 (1 Frame Only), 5 (5 Frames), 8 (8 Frames), 10 (10 Frames), 12 (12 Frames), 15 (15 Frames), 25 (25 Frames), 30 (30 Frames), 50 (50 Frames), 60 (60 Frames), 90 (90 Frames), 100 (100 Frames), 120 (120 Frames), 200 (200 Frames), 240 (240 Frames).
vprotocol video protocol.
vdest video destination port.
vpid video packet identifier. Default value is 221.
vdelay video delay. Default value is 300.
pcrpid PCR packet identifier. Default value is 521.
pcrinterval Default value is 50.
pmtpid program map table packet identifier. Default value is 31.
tsrate bit rate for transport stream. Default value is 5000K.
tslowlat transport stream low latency mode. Default value is off. Possible values: on, off.
feconoff Forward error correction in transport stream enable/ disable. Default value is off. Possible values: on, off.
fecrow Forward error correction row. Default value is 1.
feccol Forward error correction column, Default value is 5.
zixioverhead ZIXI Forward Error Correction total overhead as a percentage of transport rate. Default value is 15.
zixilatency ZIXI target latency (to allow ARQ) in milliseconds. Default value is 500.
zixifecblock ZIXI Forward Error Correction block size in milliseconds. Max value is 1/2 of Zixi Latency. Default value is 50.
zixirateadjen ZIXI dynamic bitrate adjustment according to network conditions. Default value is on. Possible values: on, off.
zixiauthen ZIXI dynamic authentication enable/disable . Default value is off. Possible values: on, off.
zixisession ZIXI session id. Default value is test.
zixiuser ZIXI user identifier. Default value is user.
aenable Audio enable/disable. Default value is on. Possible values: on, off.asource. Default value is MICL.
apair Stereo pair select for digital inputs. Default value is 0. Possible values: (0 (1 2), 1 (3 4), 2 (5 6), 3 (7 8), 260 (1 2,3 4), 548 (1 2,3 4,5 6), 1252 (1 2,3 4,5 6,7 8)).
acodec Audio codec. Default value is fdk_aaclc.
abitrate Audio bit rate. Default value is 128000.
asamplerate Audio sample rate. Default value is 48000.
aport Audio port. Default value is 8700.
apid Audio packet identifier. Default value is 120.
aptspcr Maximum difference between the PTS and PCR in the audio stream Default value is 250.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Start the MTS.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Stop the encoder channel and update the state in the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Stop the MTS.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the current temperature status for CPU and lense.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update/Change whether web login credential required or not in the Database.
require Required web login value. Possible values: 1 or 0
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update the PTZ value in the Database.
data Parse the JSON formatted data and retrieve the PTZ values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update the PTZ preset value in the Database.
data Parse the JSON formatted data and retrieve the PTZ preset values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update the PTZ tour spots value in the Database.
data Parse the JSON formatted data and retrieve the PTZ tour spots values.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Control serial port terminal server for VISCA
data Parse the JSON formatted data and retrieve the terminal server values.
term_mode Possible values: client, server
term_protocol Possible values: clearchannel, telnet
term_localport Local TCP port (for server mode)
term_servaddr Remote IP address (for client mode only)
term_servport Remote TCP port (for client mode only)
term_data_bits number of data bits.
term_parity Possible values: None, Odd, Even, Mark, Space
term_stop_bits Stop bits sent at the end of every character.
term_baudrate Possible values: 9600, 19200, 38400, 57600, 115200
term_devicefile device fine name
term_function functionality
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Add a new user in the Database.
Name Get new user name
Level Get the level of permission for the new user name. Possible value: 0 to 7.
Password Get the password for the new user name.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Remove the user from the database.
data Parse the JSON formatted data and retrieve the user name.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update/change the level of permission to the given user name.
data Parse the JSON formatted data and retrieve the user name and level of the permission.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Update/change the password to the given user name.
data Parse the JSON formatted data and retrieve the user name and password.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
http://Encoder_IP/cgi-bin/control.cgi?action=download_remove&data=FILENAME http://192.168.0.120/cgi-bin/control.cgi?action=download_remove&data=/media/sda/MOV1_000040.mp4
remove the downloaded media content from the usb drive or sd card.
data Filename from the downloaded media content to be removed from the removable media device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, 1 on failure.
status String describing the failure when ret is 1. “OK” on success.
Get the exthernet 802x information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
interface TEXT,
enable TEXT.
eap TEXT.
anonymous_identity TEXT.
identity TEXT.
password TEXT.
private_key_password TEXT.
Get the schedule job from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
enable INTEGER,
cron TEXT.
func TEXT.
func_args TEXT.
type TEXT.
minutes INTEGER.
hours INTEGER.
day INTEGER.
month INTEGER.
cron TEXT.
Get the Network File Sharing mounted infromation from the device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
mounted TEXT,
Get the video resolution for the current channel from the Database and calculate the aspect ratio.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
numerator INTEGER,
denominator INTEGER.
Get the board and model information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
logo_enable TEXT,
logo_filename TEXT.
logo_width INTEGER.
logo_height INTEGER.
logo_blob BLOB.
ico_blob BLOB.
model_enable TEXT.
model_name TEXT.
Get the current camera state information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
preset TEXT,
enc_channels TEXT.
opmode TEXT.
enc_current_preset TEXT.
dec_current_preset TEXT.
Get the current camera settings from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
zoom_direct_value INTEGER.
white_balance_mode TEXT.
color_gain INTEGER.
color_hue INTEGER.
chroma_suppress INTEGER.
wb_manual_rgain_direct INTEGER.
wb_manual_bgain_direct INTEGER.
visca_localport TEXT.
optical_zoom_only BOOL. 0 or 1.
focus_direct_value INTEGER.
manual_focus TEXT.
flexio_localport TEXT.
exposure_mode INTEGER.
shutter INTEGER.
iris INTEGER.
gain INTEGER.
high_sensitivity INTEGER.
hlc_level INTEGER.
hlc_level_mask INTEGER.
stable_zoom INTEGER.
eflip INTEGER.
lr_reverse INTEGER.
monitor_mode TEXT.
genlock_source INTEGER.
manual_icr TEXT.
zoom_step_size INTEGER.
focus_step_size INTEGER.
img_freeze INTEGER.
hr_mode INTEGER.
img_stabilizer INTEGER.
img_bw INTEGER.
nr_2d_level INTEGER.
nr_3d_level INTEGER.
icr_threshold INTEGER.
slow_shutter BOOL. 0 or 1.
slow_shutter_limit INTEGER.
flicker_reduction BOOL. 0 or 1.
img_stabilizer_level INTEGER.
wide_dynamic_range TEXT.
ve_brightness TEXT.
ve_compensation_type TEXT.
ve_compensation_level TEXT.
tab_index TEXT.
imgvflip INTEGER.
imghflip INTEGER.
imgrotate INTEGER.
Get the current camera exposure values from the visca camera.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
ae_mode TEXT,
shutter TEXT.
iris TEXT.
gain_inquiry TEXT.
sensitivity TEXT.
hls_inquiry TEXT.
min_shutter INTEGER.
max_shutter INTEGER.
shutter_label TEXT.
min_iris INTEGER.
max_iris INTEGER.
iris_label TEXT.
min_gain INTEGER.
max_gain INTEGER.
gain_label TEXT.
Get the current camera monitor mode values from the visca camera.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
modes TEXT.
current_mode TEXT.
Get the current decoder settings from the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
preset TEXT.
channel INTEGER.
url TEXT.
aenable TEXT.
viewport TEXT.
latency_mode TEXT.
max_latency_ms TEXT.
srt_mode TEXT.
srt_latency TEXT.
srt_decrypt TEXT.
srt_pass TEXT.
zixi_fec TEXT.
zixi_fecoverhead TEXT.
zixi_fecblock TEXT.
zixi_latency TEXT.
zixi_decrypt TEXT.
zixi_pass TEXT.
rtsp_flags TEXT.
Get the downloaded file information from the removable storage media.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
job Optional. The job from the schedule tab.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
FileName TEXT.
FileSize TEXT.
LastModified TEXT.
Get the camera model of drs tamarisk settings fromt the Database.
job Optional. The job from the schedule tab.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
color_pallette TEXT.
tab_index TEXT.
color_pallette_disabled TEXT.
Get the current channel encoder settings from the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
preset TEXT,
channel INTEGER.
vbitrate TEXT.
vframeratediv INTEGER.
vsource TEXT.
vcodec TEXT.
vprofile TEXT.
vprotocol TEXT.
avmux_index TEXT.
vgdr TEXT.
vdest TEXT.
aenable TEXT.
acodec TEXT.
abitrate TEXT.
asamplerate TEXT.
aport TEXT.
apair INTEGER.
vres TEXT.
vgopsize INTEGER.
vpid INTEGER.
apid INTEGER.
zixiauthen TEXT.
zixisession TEXT.
zixiuser TEXT.
zixioverhead TEXT.
zixifecblock TEXT.
zixilatency TEXT.
zixirateadjen TEXT.
fecrow INTEGER.
feccol INTEGER.
feconoff TEXT.
aptspcr INTEGER.
tslowlat TEXT.
tsrate TEXT.
pcrpid INTEGER.
pcrinterval INTEGER.
pmtpid INTEGER.
klvenable TEXT.
klvmode TEXT.
klvmuxmethod TEXT.
klvsrc TEXT.
klvbrate TEXT.
klvserialbaud TEXT.
klvpid TEXT.
vratectrl TEXT.
vdelay INTEGER.
storage TEXT.
fprefix TEXT.
asource TEXT.
authonoff TEXT.
auth_user TEXT.
auth_passwd TEXT.
auxonoff TEXT.
filesize TEXT.
nfstrength TEXT.
telopenable TEXT.
teloptext TEXT.
teloplocation TEXT.
telopcharsize TEXT.
teloptextcolor TEXT.
telopoutlineenable TEXT.
telopoutlinecolor TEXT.
gps_overlay_enable TEXT.
gps_overlay_device TEXT.
gps_overlay_location TEXT.
gps_overlay_char_size TEXT.
pipenable TEXT.
piplocation TEXT.
vquality TEXT.
vinterlacemode TEXT.
vmulticastdest TEXT.
amulticastdest TEXT.
rtsp_auth_enable TEXT.
rtsp_auth_username TEXT.
rtsp_auth_password TEXT.
rtsp_transport_mode TEXT.
lowdelay_opt TEXT.
vcropaspect TEXT.
vcrop_enable TEXT.
vcrop_width INTEGER.
vcrop_height INTEGER.
vcrop_x INTEGER.
vcrop_y INTEGER.
rotate_enable INTEGER.
rotate_angle INTEGER.
rtmp265_enable TEXT.
srt_pass TEXT.
srt_encrypt INTEGER.
srt_mode INTEGER.
srt_destAddr TEXT.
mmulticastdest TEXT.
mport TEXT.
frame_loss_mode TEXT.
frame_loss_gap INTEGER.
frame_loss_overshot INTEGER.
mounts TEXT.
source_status_str TEXT.
Get the file type and its information from the removable storage media.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
filepicker_filename TEXT,
filepicker_size INTEGER.
filepicker_lastmodified TEXT.
Get the removable storage infromation from the device using fdisk command.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
mounts TEXT,
Get the current camera focus step values from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
focus_step_size INTEGER,
Get the current fpga from firmware filename.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
fpgafileglob TEXT,
options TEXT.
Get the decoder history infromation from the Database.
chn Get the encoder channel number. The default is encoder channel 1. Select between encoder channels. Possible values: 1, 2, 3, or 4.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
channel TEXT,
histidx TEXT.
url TEXT.
Get the internet protocol infromation from the board.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
local_ip TEXT,
local_netmask TEXT.
default_gw TEXT.
ipmtu TEXT.
eth_speed TEXT.
eth_duplex TEXT.
do_autostart BOOLEAN.
Get the ONVIF miscallenous settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
list_all_video_sources INTEGER,
dns_from_dhcp INTEGER,
ntp_from_dhcp INTEGER,
ntp_enable INTEGER,
daylightsaving INTEGER,
timezone TEXT.
http_enable INTEGER,
http_port INTEGER,
https_enable INTEGER,
https_port INTEGER,
rtsp_enable INTEGER,
rtsp_port INTEGER,
discoverable INTEGER,
ntp TEXT.
dns_search TEXT.
ptz_timeout TEXT.
primary fixed_profile_max INTEGER,
secondary fixed_profile_max INTEGER,
en_persistent_audio TEXT.
onvif_enable BOOLEAN.
vmd_enable BOOLEAN.
Get the ONVIF video motion detection and too darkness settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
vmd_sens INTEGER,
vmd_zone_modify TEXT.
vmd_vcrop_width INTEGER.
vmd_vcrop_height INTEGER.
vmd_vcrop_x INTEGER.
vmd_vcrop_y INTEGER.
td_enable TEXT.
td_thresh INTEGER.
vmd_td_channel TEXT.
Get the current permission settings for admin, operators, and users from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
username TEXT,
userlevel TEXT.
api_command TEXT.
superadmin TEXT.
admin TEXT.
operator1 TEXT.
operator2 TEXT.
user1 TEXT.
user2 TEXT.
user3 TEXT.
anonymous TEXT.
Get the current PTZ settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
token TEXT,
node TEXT.
name TEXT.
enabled BOOLEAN.
pelcoaddr INTEGER.
tcpport INTEGER.
ptztype TEXT.
flip TEXT.
pos TEXT.
maxtilt INTEGER.
Get the PTZ preseting values from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
profiletoken TEXT,
token TEXT.
name TEXT.
pan FLOAT.
tilt FLOAT.
zoom FLOAT.
Get the PTZ tour information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
ProfileToken TEXT,
PresetTourToken TEXT.
name TEXT.
autostart BOOLEAN.
RecurringTime INTEGER.
RecurringDuration TEXT.
PresetTourDirection INTEGER.
RandomPresetOrder BOOLEAN.
ProfileToken TEXT.
PresetTourToken TEXT.
RowIndex INTEGER.
PresetDetailToken TEXT.
PresetDetailHome BOOLEAN.
StayTime TEXT.
pan FLOAT.
tilt FLOAT.
zoom FLOAT.
pspeed FLOAT.
tspeed FLOAT.
zspeed FLOAT.
Get the Simple Network Management Protocol values from the Database
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
power_trap_en INTEGER,
input_loss_trap_en INTEGER.
input_recover_trap_en INTEGER.
temp_high_trap_en INTEGER.
temp_recover_trap_en INTEGER.
high_temp INTEGER.
nominal_temp INTEGER.
high_temp_suppress INTEGER.
nominal_temp_suppress INTEGER.
trap_hosts INTEGER.
snmp_v3_en INTEGER.
snmp_v3_user TEXT.
snmp_v3_passwd TEXT.
snmp_v3_usrpro TEXT.
snmp_v3_encrypt INTEGER.
snmp_v3_encrypt_passwd TEXT.
snmp_v3_encpro TEXT.
snmp_v3_engineid TEXT.
Get the Secure Socket Layer settings from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
https_enable TEXT,
http_enable TEXT.
https_port INTEGER.
http_port INTEGER.
cert_status TEXT.
key_status TEXT.
Get the available memory infromation from the device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
mem_free_kb TEXT,
Get the current system settings from the Database and the ip information from the device.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
local_ip TEXT,
local_netmask TEXT.
preset TEXT.
enc_channels TEXT.
opmode TEXT.
username TEXT.
userlevel TEXT.
do_autostart BOOLEAN.
syspassword TEXT.
session_id TEXT.
disp_std TEXT.
disp_std2 TEXT.
disp_input TEXT.
disp_mode TEXT.
disp_layout TEXT.
enc_adv_setting TEXT.
enc_vivpss_mode_enable TEXT.
enable_sntp TEXT.
sntp_servers TEXT.
enable_snmp TEXT.
sysdevicename TEXT.
timezone TEXT.
timezone_name TEXT.
termserve_remote_enable TEXT.
termserve_shared_enable TEXT.
zfinder_enable TEXT.
diff_serve INTEGER.
enable_ptp TEXT.
ptp_role TEXT.
nmea_enable TEXT.
nfs_enable TEXT.
nfs_server TEXT.
nfs_server_root TEXT.
ddns_enable TEXT.
ddns_provider TEXT.
ddns_username TEXT.
ddns_password TEXT.
rtspd_port INTEGER.
rtspd_timeout INTEGER.
maxlogin INTEGER.
login_window INTEGER.
lockout_interval INTEGER.
login_timeout INTEGER.
require_web_login BOOLEAN.
Get the remote terminal information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
term_mode TEXT,
term_protocol TEXT.
term_localport TEXT.
term_servaddr TEXT.
term_servport TEXT.
term_data_bits TEXT.
term_parity TEXT.
term_stop_bits TEXT.
term_baudrate TEXT.
term_devicefile TEXT.
term_function TEXT.
Get the ONVIF user information and the permission level from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
Name TEXT,
Level INTEGER.
Password TEXT.
Password_MD5 TEXT.
Password_SHA256 TEXT.
Password_SHA512_256 TEXT.
Get the current video group settings from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
vgroup INTEGER.
crop_enable TEXT.
crop_width INTEGER.
crop_height INTEGER.
crop_x INTEGER.
crop_y INTEGER.
nr_enable TEXT.
Get the Wifi details from the device and wifi client information from the Database.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
networks TEXT,
cur_network TEXT,
cur_pass TEXT,
ap_pass TEXT,
ap_pass_en BOOLEAN.
ap_ssid TEXT,
wifi_client_local_ip TEXT,
wifi_client_local_netmask TEXT.
wifi_client_default_gw TEXT.
wifi_client_use_dhcp BOOLEAN.
Get the current camera zoom step values from the Database.
chn Get the channel number. The default is Camera 1. Select between connected cameras. Possible values: 1 = Camera 1, 2 = Camera 2.
JSON formatted table with values below
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
zoom_step_size INTEGER,
Upload the z3 image for e.g. (z3-30-0139-mfr.img or z3-30-0139-upd.img) in the z3 device.
Before uploading the new image, it checks, whether the device has enough free memory or not and removes the coredump files. If the image is *mfr.img then it removes the default database from the data partition. If its *upd.img then it will not remove the database values.
Note:
It takes approximately 5 minutes to update; DO NOT SEND ANY OTHER API Commands after uploading the image for at least 5 minutes. (time.sleep(300) or equivalent in scripts)
img_file Get the file name which needs to be flashed in the z3 device.
Flash the image and reboot the device.
Note:
It takes approximately 5 minutes to update; DO NOT SEND ANY OTHER API Commands after uploading the image for at least 5 minutes. (time.sleep(300) or equivalent in scripts)
See download_remove to remove files from the Generic Actions (POST) action
http://<ENCODER_IP>/download_media.cgi?mediafile=/location/filename
For e.g.
http://<ENCODER_IP>/download_media.cgi?mediafile=/media/sda1/MOV1_000001.mp4
Download the media file. If the output format is mp4 or TS file, then only z3 device allows downloading the files. Also provides the option for deleting the file.
mediafile Get the media file name.
JSON formatted table with values below.
ret Custom return code of the HTTP POST request. 0 on success, -1 on failure.
File Name Name of the download file name .
File Size Size of the download file name.
Last Modified Last modified the file date and time.
http://<ENCODER_IP>/download.html?chn=1
chn =[1,2,3,4]
List the download content. The content will be either .mp4 or .ts file format.
Write encoder settings to active preset. See Python example code for Seting Configuration below
Requests an update to encoder_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
Requests an update to stream_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
Requests an update to astream_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
Requests an update to source_status_str variable.
To read the result, you need to POST the “stats” control as shown\ in the Python example code below.
To set the encode configuration per channel the SetEncoder action is used with a post. All variables should be present or they will be replaced with a defualt that may not be valid for your application. More than one channel can be set per command. It is recommended you first read the current settings from the encoder then modify them and send the new settings back as in the Python example below:
import requests, json, sys
server_url='http://192.168.0.120/cgi-bin/control.cgi'
channel = 1
enc_cfg = requests.get(server_url, params='ctrl=enc&chn={}'.format(channel))
print enc_cfg.json()
enc_cfg_json=enc_cfg.json()
enc_cfg_json['vframeratediv'] = 2 #set frame rate divider to 2
new_cfg = {}
new_cfg['action'] = 'SetEncoder'
for key, value in enc_cfg_json.iteritems():
print "key = {} value = {}".format(key,value)
new_idx = "enc_{}_{}".format(channel,key)
print "setting {} to {}".format(new_idx,value)
new_cfg[new_idx] = value
print new_cfg
requests.post(server_url, data=new_cfg)
http://<ENCODER_IP>/snapshot.cgi?size=3840x2160&quality=100 http://<ENCODER_IP>/snapshot.cgi?chn=1&size=1280x720&quality=80
valid options are:
* *size =[any supported valid resolution]
chn =[1,2,3,4]
quality** =[0-100] supported resolutions are: 4K Models Only 3840×2160 2560×1440 4K and HD Models 1920×1080 1440×1080 1280×1024 1280×720 1024×768 960×720 1024×576 800×600 720×576 704×576 720×480 640×512 640×480 640×360 352×576 420×380 352×288 352×240 336×256 320×240 320×180 **
Python example of updating and reading encoder statistics:
import requests, json, sys
server_url='http://192.168.0.120/cgi-bin/control.cgi'
requests.post(server_url, {'action': 'EncoderStatus'} )
requests.post(server_url, {'action': 'StreamStatus'} )
requests.post(server_url, {'action': 'AStreamStatus'} )
requests.post(server_url, {'action': 'SourceStatus'} )
requests.post(server_url, {'action': 'TempStatus'} )
print requests.get(server_url, params='ctrl=stats&chn=null').json()
Example output:
{u'status': u'OK',
u'astream_status_str': u'\tChannel 6 Codec fdk_aaclc Samplerate 48000 Input MICL Frames 32287820 OK',
u'temp_status_str': u' LENS 29 CPU 78.700 FPGA 89.8 OK',
u'ret': u'0',
u'encoder_status_str': u' *** Encode Bitstream Received Statistics *** CH | Bitrate (Kbps) | Actual Bitrate | FPS | Actual FPS | Key-frame FPS | Width | Height ------------------------------------------------------------------------------------------------------------
1 | 4000.00 | 4092.18 | 60.0 | 59.8 | 1.0 | 1920 | 1080 | OK',
u'source_status_str': u' CAMERA 1920x1080p 60.00 fps\n',
u'stream_status_str': u'Channel 1 URL rtsp Frames 12883581 OK'}
By default, no authentication is required to access the HTTP API.
To enable authentication, go to the “System” tab “Device Management” section. Click on the “Set Password” button.
The username will be “admin” The authentication method is HTTP Digest authentication. HTTP Basic authentication is not supported.
import requests,json, sys
from requests.auth import HTTPDigestAuth
auth=HTTPDigestAuth('admin','mypassword')
print requests.get(server_url, params='ctrl=stats&chn=null', auth=auth).json()
The sample python scripts below require Python3.x.
The requests package must be installed.
You can install using
1) Use the Ubuntu package manager
sudo apt install python3-requests
2) Use the Python3 native package installer
sudo pip3 install requests
Save the state, preset, encoder/decoder settings for the user.
import requests
import json
import sched
import time
import enum
import datetime
import argparse
from requests.auth import HTTPDigestAuth
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
print(msg, flush=True)
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
payload = "action=SaveUser&enc_current_preset=charles";
rs = http_request(payload)
print_immediately(
"{:>6}: {} setip_respose response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 saveUser_DIGEST_ARGPARSE.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
SaveUser response: {"ret":"0","status":"OK"}
Control networking settings of the Z3 device such as local IPv4 IP address, netmask, DNS Server primary, DNS Server secondary, etc. Additionally control Encoder Auto-Start after boot-up and enable/disable showing of advanced WebUI settings.
import requests
import json
import sched
import time
import enum
import datetime
import argparse
from requests.auth import HTTPDigestAuth
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
print(msg, flush=True)
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-newip', help='Set this IP')
parser.add_argument('-mask', help='Subnet Mask',default='255.255.255.0')
parser.add_argument('-gateway', help='Network Gateway',default='172.30.1.1')
parser.add_argument('-dns1', help='DNS 1',default='8.8.8.8')
parser.add_argument('-dns2', help='DNS 2',default='8.8.4.4')
parser.add_argument('-ipmtu', help='MTU Speed',default=1500)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
payload = "action=SetIp&local_ip=172.30.1.112&local_netmask=255.255.255.0&default_gw=172.30.1.1&local_dnsip=8.8.8.8&local_dnsip2=8.8.4.4&use_dhcp=no&ipmtu=1500ð_speed=AUTOð_duplex=AUTO&do_autostart=1&enc_adv_setting=off";
rs = http_request(payload)
print_immediately(
"{:>6}: {} setip_respose response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 set_ip_DIGEST_ARGPARSE.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
dns1='8.8.8.8', dns2='8.8.4.4', gateway='172.30.1.1', ip='192.168.1.105', ipmtu=1500, mask='255.255.255.0', newip=None, passwd='admin', username='admin'
setip_respose response: {"ret":"0","status":"OK"}
Get the current camera state information from the Database.
import requests
import json
import sched
import time
import enum
import datetime
import argparse
from requests.auth import HTTPDigestAuth
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
print(msg, flush=True)
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
def http_request_get(payload):
try:
if args.username:
r = requests.get(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.get(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
payload='ctrl=cam_state&chn=null';
rs = http_request_get(payload)
print_immediately(
"{:>6}: {} Sys response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 sys_DIGEST_ARGPARSE.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
(ip='192.168.1.105', passwd='admin', username='admin')
Sys response: {"camera1_if_type":"Sony_LVDS","camera2_if_type":"CVBS","enc_channels":"1,2","enc_current_preset":"charles","fpgafileglob":"fpga_none.bin|fpga2_0139_cvbs.bin","preview_auto_start":"1","ret":"0","visca_present":"true"}
Send control commands to boson camera. Only one command can be sent at a time;
import requests
import json
import sched
import time
import enum
import datetime
import argparse
import sys
from requests.auth import HTTPDigestAuth
if sys.version_info[0] <3:
raise Exception("Python 3 or a more recent version is required.")
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
# print(msg, flush=True)
print(msg)
sys.stdout.flush()
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
def http_request_get(payload):
try:
if args.username:
r = requests.get(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.get(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
# Set Zoom STEP
zooms=args.zs;
zoomstep=args.zoom_step;
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
# Boson min Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000000000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson mid Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000015000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson mid Zoom xB0 yA0
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000015000000B0000000A0';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson max Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000030000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
# Boson no Zoom
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000d000200000000000000A000000080';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
# Boson get Zoom pos
payload='action=CameraControl&interface=Boson&cam_index=2&command=raw 000D0003';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute
python3.8 Zoom_Boson.py -ip 172.28.30.103
Example output:
(ip='172.28.30.103', passwd='admin', username=None, zoom_step=False, zs='3')
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000000000000A000000080","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000015000000A000000080","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000015000000B0000000A0","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Response: {"response":"00000030000000A000000080","ret":"0","status":"OK"}
Response: {"response":"","ret":"0","status":"OK"}
Send control commands to visca camera. Only one command can be sent at a time;
import requests
import json
import sched
import time
import enum
import datetime
import argparse
import sys
from requests.auth import HTTPDigestAuth
if sys.version_info[0] <3:
raise Exception("Python 3 or a more recent version is required.")
def print_immediately(msg):
# https://stackoverflow.com/questions/230751/how-can-i-flush-the-output-of-the-print-function/230774#230774
# print(msg, flush=True)
print(msg)
sys.stdout.flush()
def http_request(payload):
try:
if args.username:
r = requests.post(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.post(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
def http_request_get(payload):
try:
if args.username:
r = requests.get(control_cgi_url, data=payload, headers=headers,auth=auth)
else:
r = requests.get(control_cgi_url, data=payload, headers=headers)
except requests.exceptions.HTTPError as err:
raise SystemExit(err)
except requests.exceptions.Timeout:
raise SystemExit()
except requests.exceptions.TooManyRedirects:
raise SystemExit()
except requests.exceptions.RequestException as e:
raise SystemExit(e)
return r
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '-ip_address', type=str, help='IP of Encoder', required=True)
parser.add_argument('-username', help='Username if credentials are required, -passwd is also required')
parser.add_argument('-passwd', help='Password if credentials are required',default='admin')
parser.add_argument('-z', help='Zoom STEP level 0 - 7; Default 3',default='3')
parser.add_argument('-zs', help='Do Zoom STEP defined using -z, else normal zoom',action='store_true')
args = parser.parse_args()
print(args)
if args.ip:
server_url='http://' args.ip
elif args.ip_address:
server_url='http://' args.ip_address
# Set Zoom STEP
zooms=args.z;
zoomstep=args.zs;
if args.username:
auth=HTTPDigestAuth(args.username,args.passwd)
control_cgi_url = server_url '/cgi-bin/control.cgi'
channel = 1
headers = {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
if zoomstep == True:
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_wide_var ' zooms;
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_tele_var ' zooms;
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(4)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
else:
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_tele_std';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(5)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_wide_std';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
time.sleep(5)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_stop';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
payload='action=CameraControl&interface=Visca&cam_index=1&command=zoom_get_pos';
rs = http_request(payload)
print_immediately(
"{:>6}: {} Response: {}".format(
1,
datetime.datetime.now(),
rs.text
)
)
Command to execute with out zoom step size
python3.8 Zoom_visca.py -ip 192.168.1.105 -username admin -passwd admin
Example output:
(ip='192.168.1.105', passwd='admin', username='admin', z='3', zs=False)
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":3040,"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":0,"ret":"0","status":"OK"}
Command to execute with zoom step size
python3.8 Zoom_visca.py -ip 192.168.1.105 -username admin -passwd admin -z 3 -zs
Example output:
(ip='192.168.1.105', passwd='admin', username='admin', z='3', zs=True)
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":0,"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"ret":"0","status":"OK"}
Response: {"response":7304,"ret":"0","status":"OK"}