Anda di halaman 1dari 10

TVSIP API

Software
Development
Kit

Table of Contents
Introduction ................................................................................................................1
Overview ....................................................................................................................2
Properties list .............................................................................................................3
Method list..................................................................................................................4
Event list.....................................................................................................................8

Introduction
This documentation lists the functionality included in TVSIP API and explains how the components
can be integrated and used in containing applications.

TVSIP API SDK / Rev:2.1

Overview
TVSIP SDK is a components-library whose main purpose is to play media streams originating from
DVR / IPCAM / NVR products.
Networked device means DVR / IPCAM / NVR at network connection in this document.
TVSIP SDK supports the following main features:
1.

Audio / Video Streaming







2.

Camera Control


3.

PTZ camera function control, supporting PELCO-P and PELCO-D protocol


PTZ controls remote camera and supports PELCO-P and PELCO-D protocol.

Event trigger





5.

Brightness /Saturation /Contrast /Hue

Camera PTZ



4.

Play live media streams from a networked device.


Play file media streams, which is recorded at networked device HDD.
Record media streams to PC side storage.
Playback recorded files from local HDD at PC side.

GPIO Alarm Input / Output


Manually trigger from Software button
Video loss, Motion detection
HDD fail, Fan fail

Two-way audio


Real time communication between networked device and PC at control center.

TVSIP API SDK / Rev:2.1

Properties list
Property
sSaveVideoFileFolder

Description
String, Max-Size: 256, readable/writable, runtime changeable
Path name for saving streaming data on PC-side local storage
 Default: c:\recording\
 runtime changeable, new value active for next new clips

sSaveCaptureFileFolder

String, Max-Size: 256, readable/writable, runtime changeable


Path name for saving frame Snapshot on PC-side local storage
 Default: c:\recording\Snapshot
 runtime changeable, new value active for next new clips

sSearchFileFolder

String, Max-Size: 256, readable/writable, runtime changeable


Path name for searching folder on PC-side local storage for playback.
 Default: c:\recording\

lCutFileSec

Long, readable/writable, runtime changeable


Length of recording interval of a single file
 Default: 600 seconds
 ex: lCutFileSec = 600, clip duration is 600 seconds.
 runtime changeable, , new value active for next new clips

lAutoReConnectGapSec

Long, readable/writable, runtime changeable


Auto-reconnecting interval while connection failing
 Default: 10 seconds
 The value < 0 indicates never re-connect

TVSIP API SDK / Rev:2.1

Method list
Method

Description

System
bool GetSDKVersion(
string *version)

 Get SDK version


[version] return SDK version

bool GetDeviceModel(
string *version)

 Get Networked Device Model number, the function must


be call after Connect(),
Return: true = OK, fail = NG
[version] return Networked Device Model number

Bool SetVideoWindow(
HWND hwnd)

 Specify a Windows handle for video display


Return: true = OK, fail = NG
[hwnd] Specify a Windows handle from the application to
the API for video playing

Bool SetVideoSize(
int Width,
int Height)

 Set horizontal/vertical pixels of video, which is displayed


on the window.
[Width] horizontal of the video image.
[Height] vertical of the video image

RET_CODE Connect(
string ipAddress,
string user,

 Connect to networked device and ready to receive event


messages.
Return: RET_CODE to identify what error is.

string password,
short port)

[ipAddress] Network address for selected networked device


[user] login user name
[password] login password
[port] Network port number

bool StartLive(
int chanNum,
bool enableVideo,
bool enableAudio);

 Get media streaming from networked device and decode it


to screen or audio output
Return: true = OK, fail = NG
[chanNum] channel number
[enableVideo] true for enable, false for disable.
[enableVideo] true for enable, false for disable.

bool StopLive(
int chanNum)

 Stop media stream


Return: true = OK, fail = NG
[chanNum] channel number

bool StartRemoteFile(

 Get a media stream storage at network device


4

TVSIP API SDK / Rev:2.1

int chanNum,

Return: true = OK, fail = NG

string fileName,
DateTime startTime,
DateTime endTime,
Bool enableDecode,

[chanNum] channel number


[fileName] file name for local saving, if enabeSavefile is true
[startTime] start time of the requested video
[endTime] end time of the requested video

Bool enabeSavefile)

[enableDecode] true : decode and display to screen


[enabeSavefile] true: save stream to local HDD

bool StartRecord(void)

Record current media streams to a file.


Return: true = OK, fail = NG

bool StopRecord(void)

 Stop Recording current media streams to a file.


Return: true = OK, fail = NG

bool StartLocalFile(
Int chanNum,
DateTime startTime)

Playback a file on local storage of PC side. The library will


use startTime to find files matching the time period, for
playback.
Playing position and total duration of the file will be sent
back to application.
Return: true = OK, fail = NG
[chanNum] channel number
[startTime] start time of the requested video

bool PlaybackCtl(
PlayControl mode,
Int pos)

 Playback control only for StartLocalFile().


Return: true = OK, fail = NG
[PlayControl]:
REWIND
PLAY_REVERSE,
PAUSE,
STEP_FORWARD,
PLAY_FORWARD,
FAST_FORWARD,
JUMP_TO
[pos] jump to user selected position

Audio interface
bool StartTalk(int chanNum)

 Two-way audio between networked device and PC


Return: true = OK, fail = NG
[chanNum] channel number. Default DVR/IPCAM is 0.

bool StopTalk()

 Stop Two-way audio


5

TVSIP API SDK / Rev:2.1

bool AuidoInVolumeControl(
int value)
bool AuidoOutVolumeControl(
int value)

Setting volume for audio input


Return: true = OK, fail = NG
[value] range from 0 to 10
 Setting volume for audio output
Return: true = OK, fail = NG
[value] range from 0 to 10

Camera Control
bool CameraSetImageCtl(
ImageCtl mode,
int value)

 Set Brightness, Saturation, Contrast and Hue values to


Device,
Return: true = OK, fail = NG
[ImageCtl]
Brightness
Saturation
Contrast
Hue
[value] range from 0 to 63

bool CameraGetImageCtl(
int mode,
int *value)

 Get Brightness, Saturation, Contrast and Hue values from


Device,
Return: true = OK, fail = NG
[ImageCtl]
Brightness
Saturation
Contrast
Hue
[value] range from 0 to 63

bool CameraPTZ(
PtzCommand command,
int speed)

 Send PTZ command to PTZ controller


Return: true = OK, fail = NG
[PtzCommand]
Left,
Right,
Up,
Down,
ZoomIn,
ZoomOut,
FocusNear,
FocusFar,
IrisOpen,
6

TVSIP API SDK / Rev:2.1

IrisClose,
PanActionStop,
TiltActionStop,
PanTiltActionStop,
ZoomActionStop,
ZoomInStop,
ZoomOutStop,
FocusActionStop,
FocusNearStop,
FocusFarStop,
IrisActionStop,
IrisOpenStop,
IrisCloseStop
[speed] range from 1 to 5
Frame Capture
bool Snapshot(string fileName)

 Save a snapshot of the currently played frame into a file


Return: true = OK, fail = NG
[fileName] file name for save file.

TVSIP API SDK / Rev:2.1

Event list
Event

Description

Alarm
GPIO Alarm Input /
Output

GPIO status change

Manually Trigger.

User click software trigger button

Video loss

Video unlock or disconnect

Motion Alarm

Motion detection

HDD fail

HDD R/W error

Fan fail

Fan stop or fail

Playback
Playback position

Local file playing position and clip duration.

TVSIP API SDK / Rev:2.1

Anda mungkin juga menyukai