Skip to main content
Skip table of contents

Create a stream for Analytics

Creating a stream

Creating a stream for Analytics.

JSON
{
    "CameraGroupUid": "3bc11a36-06bf-4f5f-b45d-5ee3bf702b09",
    "CaseType": "camera-obstacle",
    "Regions": [
        "minsk"
    ],
    "Collections": [
        "n5da4c68-4247-417f-9abc-b820fa75820v",
        "m6da4c68-4247-417f-9abc-b720fa75820s"
    ],
    "Pipeline": {
        "Processing": {
            "fps": 10,
            "min_obj_size": 20
        },
        "Detector": {
            "ScoreThreshold": 496
        },
        "Fences": [],
        "Areas": [
            [
                0.25,
                0.21
            ],
            [
                0.69,
                0.21
            ],
            [
                0.89,
                0.7
            ],
            [
                0.24,
                0.72
            ],
            [
                0.27,
                0.23
            ]
        ]
    },
    "Source": {
        "Uid": "3bc21a36-06bf-4f5f-b45d-5cc3bf702b33",
        "Url": "rtsp://labnsms3.navekscreen.video:5554/live/b1da4c68-4247-417f-9abc-b720fa75820a/?token=XnC-UVgDSUgL8WT8iFCki04pvw49lS2hYbq2EsuIB2MsBgzkNqg6S1-apHozSsFgPi409K_6gmMvJukxmyjFXwC7QQ1Y-3p1e8wdeI67gW5MJu7XWColxQmjH2Tn6tdRknyn_7VH2EdJu7to0N4t9g~~&"
    }
}

POST /api/streams/?format=json

Parameters

array Collections, An array of collection identifiers that will be applied when processing events for this stream, if necessary.


string CaseType REQUIRED, Type of analytics.


array Regions, An array of region (zone) identifiers.


string CameraGroupUid, Identifier of the camera group that multiple streams are grouped under.


object Source REQUIRED, Description of the video stream for analytics.

object object

stringSource.Uid, Stream identifier.


stringSource.Url, URL to retrieve the stream.


object Pipeline, Stream configuration, specifying the required parameters for the analytics to work.

object object

arrayPipeline.Areas, Coordinates of the designated zones.


objectPipeline.Detector, Description of the detector used for analytics.


float Pipeline.Detector.ScoreThreshold, Threshold value for "License Plate Recognition" and "Face Recognition," determining whether events will be classified as recognized or unrecognized.


arrayPipeline.Fences, Coordinates of the lines.


objectPipeline.Processing, Configuration of the case depending on the type of analytics.


200 OK

Returns a JSON object with the identifier of the created stream

JSON
{
    "stream_uid": "b1da4c68-4247-417f-9abc-b720fa75820a"
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/streams/?format=json' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "Collections": [],
    "CaseType": "string",
    "Regions": [],
    "CameraGroupUid": "string",
    "Source": {
        "Uid": "string",
        "Url": "string"
    },
    "Source.Uid": "void",
    "Source.Url": "void",
    "Pipeline": {
        "Processing": {},
        "Detector": {
            "ScoreThreshold": 0
        },
        "Fences": [],
        "Areas": []
    },
    "Pipeline.Processing": "void",
    "Pipeline.Detector": "void",
    "Pipeline.Detector.ScoreThreshold": "void",
    "Pipeline.Fences": "void",
    "Pipeline.Areas": "void"
}'
PHP
PHP
$data = array (
  'Collections' => 
  array (
  ),
  'CaseType' => 'string',
  'Regions' => 
  array (
  ),
  'CameraGroupUid' => 'string',
  'Source' => 
  array (
    'Uid' => 'string',
    'Url' => 'string',
  ),
  'Source.Uid' => 'void',
  'Source.Url' => 'void',
  'Pipeline' => 
  array (
    'Processing' => 
    (object) array(
    ),
    'Detector' => 
    array (
      'ScoreThreshold' => 0.0,
    ),
    'Fences' => 
    array (
    ),
    'Areas' => 
    array (
    ),
  ),
  'Pipeline.Processing' => 'void',
  'Pipeline.Detector' => 'void',
  'Pipeline.Detector.ScoreThreshold' => 'void',
  'Pipeline.Fences' => 'void',
  'Pipeline.Areas' => 'void',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/streams/?format=json', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.