Handle of VideoCapture object
Used to handle pointer (void *) to VideoCapture object
Handle of VideoFrame object
Used to handle pointer (void *) to VideoFrame object
Text position on video frame
Invokes by VideoCapture object on new video frame capture
| hVideoCapture | Handle of VideoCapture object |
| hFrame | Handle of VideoFrame object |
| customObject | Pointer to custom object, defined in VideoCapture_Create function |
After this event the receives VideoFrame object have reference count = 1 and you need to call VideoFrame_Release function to release it.
Invokes by VideoCapture object on error
| hVideoCapture | Handle of VideoCapture object |
| errorCode | Error code (see ERR_CAPTURE enumeration values) |
| customObject | Pointer to custom object, defined in VideoCapture_Create function |
Create Video Capture object
| frameCapturedCallback | FrameCapturedCallback function |
| captureErrorCallback | CaptureErrorCallback function |
| customObject void* | Pointer to custom object |
Start video capture from video file
| hVideoCapture | Handle of VideoCapture object |
| fileName Video | file path |
| repeat_count int | Repeat count, default 0 (always repeat) |
Value 0 on success, or one of ERR_CAPTURE enumeration values.
Start video capture from IP camera
| hVideoCapture | Handle of VideoCapture object |
| ipCameraURL const char* | IP camera URL (RTSP or HTTP). The URL must include user name and password if required. |
Value 0 on success, or one of ERR_CAPTURE enumeration values.
Start video capture from video device
| hVideoCapture | Handle of VideoCapture object |
| deviceIndex int | Device index starting from 0 (0 - first video device) |
| captureWidth int | Capture X-resolution in pixels |
| captureHeight int | Capture Y-resolution in pixels |
Value 0 on success, or one of ERR_CAPTURE enumeration values.
If video device do not support defined resolution, then will be selected nearest resolution supported by this device.
Gets the width of the video stream in pixels
| hVideoCapture | Handle of VideoCapture object |
Width of the video stream in pixels. If the video stream is not started, the return value is 0.
Gets the height of the video stream in pixels
| hVideoCapture | Handle of VideoCapture object |
Height of the video stream in pixels. If the video stream is not started, the return value is 0.
Gets the frames per second (FPS) of the video stream
| hVideoCapture | Handle of VideoCapture object |
Frames per second (FPS) of the video stream. If the video stream is not started, the return value is 0.
Gets the FOURCC code of the video stream
| hVideoCapture | Handle of VideoCapture object |
FOURCC code (32 bit integer) of the video stream. If the video stream is not started, the return value is 0.
Stop video capture
| hVideoCapture | Handle of VideoCapture object |
Value 0 on success, or one of ERR_CAPTURE enumeration values.
Check if video capture is started
| hVideoCapture | Handle of VideoCapture object |
Value True if video capture is started, otherwise False.
Return library version
| buffer char* | Pointer to string buffer which receives library version |
| buff_size int | Size of string buffer |
Number of bytes copied to buffer. If buffer = NULL or buff_size = 0, then function return number of bytes required for store result string
Sets a value indicating whether the VideoCapture will use TCP transport for RTSP stream
| hVideoCapture | Handle of VideoCapture object |
| rtsp_transport_tcp bool | true - use TCP transport, false - use UDP transport |
Gets a value indicating whether the VideoCapture will use TCP transport for RTSP stream
| hVideoCapture | Handle of VideoCapture object |
Boolean value
Sets the rendering window for the video stream
| hVideoCapture | Handle of VideoCapture object |
| nativeWindow void* | Pointer to native window handle (HWND on Windows or X11 window handle on Linux) |
Clears all polygons defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
This function can be used to clear all polygons defined in the video capture object.
Adds a new polygon to the video capture object
| hVideoCapture | Handle of VideoCapture object |
| name const char* | Name of the polygon |
Index of the new polygon
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Adds a new point to the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
| x int | X coordinate of the point |
| y int | Y coordinate of the point |
Index of the new point
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Deletes a point from the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
| pointIndex int | Index of the point |
Value 0 on success, otherwise -1
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Sets the name of the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
| name const char* | Name of the polygon |
Value 0 on success, otherwise -1
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Sets the coordinates of the point of the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
| pointIndex int | Index of the point |
| x int | X coordinate of the point |
| y int | Y coordinate of the point |
Value 0 on success, otherwise -1
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Gets the coordinates of the point of the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
| pointIndex int | Index of the point |
| x int* | Pointer to X coordinate of the point |
| y int* | Pointer to Y coordinate of the point |
Value 0 on success, otherwise -1
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Gets the name of the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
| name char* | Pointer to string buffer to receive name of the polygon |
| nameSize int | Size of string buffer |
Value 0 on success, otherwise -1
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Gets the number of points of the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
Value 0 on success, otherwise -1
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Deletes the polygon defined in the video capture object
| hVideoCapture | Handle of VideoCapture object |
| polygonIndex int | Index of the polygon |
Value 0 on success, otherwise -1
The polygons will be drown on video frames displayed in the rendering window defined by VideoCapture_SetRenderingWindow function.
Create VideoFrame object from image buffer
| pBuffer void* | Pointer to buffer of image pixels data |
| width int | Width of image in pixels |
| height int | Height of image in pixel |
| stride int | Size of one image row in bytes |
| pixelFormat | Pixel format, PIXFMT enumeration |
| timestamp int64 | Frame timestamp received from camera (optional). If you have not this value, then use -1 |
Handle of VideoFrame object
After creating the VideoFrame object the reference count is set to 1 and need to call VideoFrame_Release function when you do not need this object anymore.
Increments the reference count of the VideoFrame object
| hFrame | Handle of VideoFrame object |
Reference count of the VideoFrame object
Decrements the reference count of the VideoFrame object
| hFrame | Handle of VideoFrame object |
Reference count of the VideoFrame object
When the reference count reaches zero, the VideoFrame object is destroyed.
Gets the image buffer of frame in specified pixel format
| hFrame | Handle of VideoFrame object |
| format | pixel format |
| pImageBuffer void** | Pointer to a pointer which receives the image buffer containing pixel data of the image |
| width int* | Pointer to integer variable which receives width of image |
| height int* | Pointer to integer variable which receives height of image |
| stride int* | Pointer to integer variable which receives size of one image row in bytes |
You need to call VideoFrame_FreeImageBuffer with received pointer to free memory.
Gets an image buffer of the cropped rectangle (object bounding box) of the frame in the specified pixel format.
| hFrame | Handle of VideoFrame object |
| x int | X coordinate of the top-left corner of the rectangle |
| y int | Y coordinate of the top-left corner of the rectangle |
| w int | Width of the rectangle |
| h int | Height of the rectangle |
| format | pixel format |
| pImageBuffer void** | Pointer to a pointer which receives the image buffer containing pixel data of the image |
| width int* | Pointer to integer variable which receives width of image |
| height int* | Pointer to integer variable which receives height of image |
| stride int* | Pointer to integer variable which receives size of one image row in bytes |
You need to call VideoFrame_FreeImageBuffer with received pointer to free memory.
Deletes image buffer
| pImageBuffer void* | Pointer to image buffer received using VideoFrame_GetImageBuffer function. |
Draws text on video frame
| hFrame | Handle of VideoFrame object |
| text const char* | Text to draw |
| position | Position of text on video frame, TEXT_POSITION enumeration |
This function draws text on video frame in the specified position. The text will be drawn using default font and color.
Draws a box on video frame
| hFrame | Handle of VideoFrame object |
| x int | X coordinate of the top-left corner of the box |
| y int | Y coordinate of the top-left corner of the box |
| w int | Width of the box |
| h int | Height of the box |
| color int | Color of the box in RGB format (0xRRGGBB) |
| thickness int | Thickness of the box border in pixels |
This function draws a box on video frame with specified position, size, color and border thickness.