![]() |
ROC SDK
2.4.0
Scalable Face Recognition Software
|
Process live or pre-recorded videos. This API object handles setting up, running analytics against, and monitoring lists of video streams. More...
Data Structures | |
| struct | roc_stream_tracker_status |
| Holds camera feed processing information for a roc_stream. More... | |
Typedefs | |
| typedef struct roc_video_service_type * | roc_video_service |
| Handle to a private roc_video_service type. | |
| typedef struct roc_stream_tracker_status | roc_stream_tracker_status |
| Holds camera feed processing information for a roc_stream. More... | |
| typedef roc_stream_tracker_status * | roc_stream_tracker_status_array |
Process live or pre-recorded videos. This API object handles setting up, running analytics against, and monitoring lists of video streams.
| struct roc_stream_tracker_status |
Holds camera feed processing information for a roc_stream.
| Data Fields | ||
|---|---|---|
| bool | enabled | True if the stream is still processing frames. If false, camera is no longer part of the running roc_video_service configuration. |
| size_t | events | Number of roc_event detected by this stream. |
| char * | filename | Name of video file or camera URL. |
| float | fps | Average frames per second this stream is processing. |
| size_t | frames_queued | Number of frames the stream has decoded, buffered, and not yet processed. |
| size_t | frames_dropped | Number of frames the stream has dropped without processing. |
| size_t | frames_processed | Number of frames the stream has finished processing. |
| char * | stream_id | Unique identifier specific to this video stream. |
| typedef struct roc_stream_tracker_status roc_stream_tracker_status |
Holds camera feed processing information for a roc_stream.
A dynamically allocated array of roc_stream_tracker_status.
Free after use with roc_free_stream_tracker_status_array.
| roc_error roc_new_video_service | ( | roc_video_service * | video_service | ) |
Create a roc_video_service object.
Initialize a roc_video_service for processing.
| [in] | video_service | roc_video_service to initialize. |
| roc_error roc_video_service_start | ( | roc_video_service | video_service, |
| roc_string | global_settings | ||
| ) |
Configure system settings for a roc_video_service object.
This function must be called prior to roc_video_service_add_stream. The roc_string passed to this function must be a JSON-formatted Global Settings Object configuration.
share folder included with the ROC SDK. See Video Service Parameters for details about each setting.The video service will continue running until roc_free_video_service is called.
| [in] | video_service | roc_video_service to begin processing. |
| [in] | global_settings | JSON-formatted configuration string. |
| void roc_free_stream_tracker_status_array | ( | roc_stream_tracker_status_array * | stream_tracker_status_array, |
| size_t | status_count | ||
| ) |
Deallocate a roc_stream_tracker_status.
| [in] | stream_tracker_status_array | Array to deallocate. |
| [in] | status_count | Number of entries in the array. |
| roc_error roc_video_service_status | ( | roc_video_service | video_service, |
| roc_stream_tracker_status_array * | stream_tracker_statuses, | ||
| size_t * | num_stream_tracker_statuses, | ||
| bool * | done, | ||
| size_t * | pending_transmissions | ||
| ) |
Check status for a roc_video_service object.
Video services that have finished processing or encountered an error for all threads, will return a "done" status of true, while services that have not been started with roc_video_service_start or have at least one video still processing will return a "done" status of false. Free stream_tracker_statuses after use with roc_free_stream_tracker_status_array.
| [in] | video_service | roc_video_service to get status for. |
| [out] | stream_tracker_statuses | roc_stream_tracker_status_array object. |
| [out] | num_stream_tracker_statuses | Number of entries in stream_tracker_statuses. |
| [out] | done | All streams have finished processing or errored out. |
| [out] | pending_transmissions | Number of transmissions that have been queued but not sent. |
stream_tracker_statuses after use with roc_free_stream_tracker_status_array. | roc_error roc_video_service_add_stream | ( | roc_video_service | video_service, |
| const char * | new_stream_configuration | ||
| ) |
Add video-stream configuration to a roc_video_service.
Each video-stream object added to a roc_video_service must contain a non-empty "stream-id" field. The video service uses "stream-id" for the managment and monitoring of video streams. Therefore, the value of "stream-id" must be unique.
The roc_string passed to this function must be a JSON-formatted video-stream configuration. The stream-id for the video stream configuration must be unique.
share folder included with the ROC SDK. See Video Service Parameters for details about each setting.| [in] | video_service | roc_video_service to add stream to. |
| [in] | new_stream_configuration | New JSON-formatted video-stream string. |
| roc_error roc_video_service_update_stream | ( | roc_video_service | video_service, |
| const char * | updated_stream_configuration | ||
| ) |
Update a video-stream in a roc_video_service configuration.
The roc_string passed to this function must be a JSON-formatted video-stream configuration. The stream-id for the video stream configuration must be an existing stream-id in the current roc_video_service configuration, or this function will return an error. See roc_video_service_add_stream for an example configuation.
| [in] | video_service | roc_video_service to update stream for. |
| [in] | updated_stream_configuration | Updated JSON-formatted video-stream string. |
| roc_error roc_video_service_remove_stream | ( | roc_video_service | video_service, |
| const char * | removed_stream_id | ||
| ) |
Remove a video-stream from a roc_video_service configuration.
The roc_string passed to this function must be an existing stream-id or this function will return an error.
| [in] | video_service | roc_video_service to remove stream from. |
| [in] | removed_stream_id | stream-id of video-stream to remove. |
| roc_error roc_video_service_read_configuration | ( | roc_video_service | video_service, |
| roc_string * | current_configuration | ||
| ) |
Read the entire Video Service Parameters configuration for a roc_video_service.
See here for an example Video Service Parameters configuration with every setting set to it's default value. This file can also be found in the in the share folder included with the ROC SDK.
| [in] | video_service | roc_video_service to read configuration for. |
| [in] | current_configuration | Returned configuration string. |
current_configuration after use. | roc_error roc_free_video_service | ( | roc_video_service | video_service | ) |
Stop processing and deallocate a roc_video_service object.
This function should be called once and only once for any roc_video_service that has been initialized with roc_new_video_service. A video service can be freed even if it has not finished processing.
| [in] | video_service | roc_video_service to stop processing for. |
1.8.15