CamStreamer App 2.x functionality can be controlled using API once the application is installed and licensed. There are several parameters described below. Mind that CamStreamer App/stream is restarted every time any parameter is changed.
Global Parameters
You can get or set multiple global parameters at once usign the following calls:
http://IPADDR[:PORT]/local/camstreamer/param/set.cgi?PARAMNAME=PARAMVALUE[&PARAMNAME=PARAMVALUE]
where
IPADDR[:PORT]
is an IP address:port of the camera. E.g. 192.168.1.5
PARAMNAME
is a name of any parameter listed below.PARAMVALUE
is a value you would like to save to CamStreamer App. Special characters in the value has to be urlenmarkd. See URL encoding
http://IPADDR[:PORT]/local/camstreamer/param/get.cgi?list=PARAMNAME[,PARAMNAME]
where
IPADDR[:PORT]
is an IP address:port of the camera. E.g. 192.168.1.5
PARAMNAME
is a name of any parameter listed below.
In CamStreamer App it is possible to set up several output streams directly by setting JSON array to StreamList parameter or by using simpler HTTP API. Every stream has its own parameters (listed below) which can be set or gained by calling HTTP API.
Parameter AutomateType
Specify the type of automatization. Available values:
none
disable automatization.schedule
use the schedule.inputX
use the hardware input of number X.
Parameter AutomateSchedule
Schedule consists of intervals separated by |
.
Schedule format: DAYNUM TIMEH:TIMEM..DAYNUM TIMEH:TIMEM[|DAYNUM TIMEH:TIMEM..DAYNUM TIMEH:TIMEM]
where
DAYNUM
is a number of day in week (1 for monday, 7 for sunday)TIMEH
is a hour in day in two digits format.TIMEM
is a minute in two digits format.
example: 1 10:45..1 14:50|6 12:00..6 18:00
Parameter HttpServerPort
Port where HLS stream is available for download when HLS pull streaming is enabled.
Parameter LiveLED
Enable LED light indication on the camera. The light is ON if the stream is established. The light is off once the CamStreamer App is not able to broadcast the video. Valid values: 0
, 1
Stream Parameters
The following HTTP API call list all streams.
http://IPADDR[:PORT]/local/camstreamer/stream/list.cgi
You can add / update a stream by the set.cgi HTTP API call bellow. Mind that the stream added by API is not visible in the CamStreamer App user interface. If you'd like to start a broadcast on YouTube, please use YouTube Live Streaming API. It's necessary to obtain an RTMP ingestion url / key.
http://IPADDR[:PORT]/local/camstreamer/stream/set.cgi?stream_id=STREAMID&PARAMNAME=PARAMVALUE[&PARAMNAME=PARAMVALUE]
where
IPADDR[:PORT]
is an IP address:port of the camera. E.g. 192.168.1.5
STREAMID
is a stream identifier (string). A new stream is created if sent stream_id does not exist. If stream_id exists current stream is modified. For API are reserved identifiers with "api" prefix.PARAMNAME
is a name of any stream parameter listed below.PARAMVALUE
is a value you would like to save to the stream. Special characters in the value has to be urlenmarkd. See URL encoding
http://IPADDR[:PORT]/local/camstreamer/stream/get.cgi?stream_id=STREAMID
where
IPADDR[:PORT]
is an IP address:port of the camera. E.g. 192.168.1.5
STREAMID
is a stream identifier.
http://IPADDR[:PORT]/local/camstreamer/stream/remove.cgi?stream_id=STREAMID
where
IPADDR[:PORT]
is an IP address:port of the camera. E.g. 192.168.1.5
STREAMID
is a stream identifier.
Parameter enabled
Stop or start the stream using parameter "Enabled". Valid values: 0
, 1
Parameter mediaServerUrl
Valid values (for selected protocol):
- RTMP
rtmp://[user:pass@]server:port[/app][/stream_name]
- MPEG-TS TCP
tcp://server:port
- MPEG-TS UDP
udp://server:port[?pkt_size=XXX&ttl=XXX]
- HLS PULL
http://IPADDR:PORT/local/camstreamer/live.m3u8
- where:
IPADDR:PORT
is an IP address:port of the camera andPORT
is a value of HttpServerPort stream parameter. - HLS PUSH
ftp://your_ftp_server/live.m3u8
You can stop or start the stream using parameter "Enabled". Valid values: 0
, 1
Parameter userVapixParameters
Overwrite the default video parameters. See parameter description. You can e.g. choose different camera or View Area using parameter camera=2&resolution=1280x720&overlaypos=200%2C600
.
Parameter audioSource
Specify the audio channel. Available values:
none
disable the audio channel.default
use the audio channel from the camera (e.g. mic./line input).file: FILEPATH
use an audio file FILEPATH (mka/mp3) on the file system on the camera (e.g. SD card).url: URL
use an external (network) audio source (markc AAC or MP3). E.g. internet radio, another camera or Axis P8221 audio enmarkr. For Axis device: rtsp://root:password@IPaddress/axis-media/media.amp?audio=1&video=0 Use audio sample rate 44.1KHz and bitrate 128Kbps. CamStreamer App is not streaming once the external audio is not available.
Parameter avSyncMsec
Time offset for audio/video channel in milliseconds.
Get current YouTube Live broadcast
Redirect your viewers to the current broadcast.
https://camstreamer.com/yt-broadcast-api/SECTOKEN/CSID
where SECTOKEN and CSID are used in "Permanent link" in CamStreamer App user interface. Mind that the SECTOKEN is changed once you use a different YouTube channel.
Example:
https://camstreamer.com/yt-broadcast-api/b7133489237eee1/S-78
Response:
{"broadcast_id":"XCIfaGvbXSs"}
Status of YouTube Live broadcast
Check whether the YouTube broadcast is live and whether the you Get information from our watchdog. It is suitable for integration with monitoring systems like Nagios, Centreon...
https://camstreamer.com/api/youtubeStatus/SECTOKEN/CSID
where SECTOKEN and CSID are used in "Permanent link" in CamStreamer App user interface. Mind that the SECTOKEN is changed once you use a different YouTube channel.
Response HTTP code:
- 200 Stream ok
- 404 Stream not found or bad security token
- 400 Stream not checked yet
- 400 Stream interrupted