mxpi_rtspsrc
- Perform the following steps before using the encrypted transmission function of the stream pulling plugin:
- Install the libgiognutls.so file.
- Set the GIO_MODULE_DIR environment variable, that is, the folder path where the libgiognutls.so file is located.
- Configure the tlsCertFilePathList and tlsValidationFlags properties of the stream pulling plugin during pipeline compilation.
- Encrypted login is recommended because non-encrypted login has security risks.For encrypted login, encrypt the user name and password and then save them to the developed application. When SDK is used to build a pipeline, decrypt them and then call CreateMultipleStreams for build.
- If the configuration file is used as the pipeline template, replace sensitive parameter information with ${xxxx} in the configuration file (xxxx indicates the parameter name). When using the SDK to build a pipeline, read the file content, decrypt the file content, and replace ${xxxx} with the user name and password, and call CreateMultipleStreams for streaming.
- If the user name and certificate password are written in plaintext in the configuration file, information leakage may occur. Keep the username and password secure.
- The stream pulling plugin element takes root <<user@hostname.org>> as the template provider information by default.
Function |
Receives the input video path of the external calling API, pulls video streams, stores the pulled raw stream in the buffer, and sends the data to the downstream plugin. |
|---|---|
Constraints |
Currently, only H.264 and H.265 stream pulling is supported, and the encrypted transmission function supports only the password-based certificate private key. |
Plugin Base Class (Factory) |
mxpi_rtspsrc |
Input/Output |
Input: none Output: buffer (data type: MxpiBuffer) and metadata (data type: MxpiFrame) |
Property |
For details, see Table 1. |
Property Name |
Description |
Mandatory or Not |
Modifiable or Not |
|---|---|---|---|
rtspUrl |
URL for obtaining RTSP streams. You can obtain the streams from the network camera or use a tool such as LIVE555 to convert local video files into RTSP streams. |
Yes |
Yes |
channelId |
Number of channels for video stream pulling. The default value is 0. |
No |
Yes |
timeout |
If no stream is pulled for a period of time (timeout), the stream pulling will stop. The default value is 0. This property is under internal test and is not recommended. |
No |
Yes |
fpsMode |
Whether to print the stream pulling frame rate. The value can only be 0 or 1.
If the stream address of the first stream pulling is invalid, the frame rate is not printed even if it is set to 1. |
No |
Yes |
tlsValidationFlags |
TLS certificate verification flag used to verify services. The default value is 4. The options are as follows:
|
No |
Yes |
tlsCertFilePathList |
Input CertCrt, CertKey, CaCert, and Token in sequence and separate them with commas (,). The default value is empty. (Set the permission on the certificates and key files to 400 to reduce the risk of certificate and key leakage.)
|
No |
Yes |
Plugin Example
- The RTSP address is added to rtspUrl, which requires to enter the user name and password. The example displayed is in encrypted mode.
- server.crt, server.key, and ca.crt are added to tlsCertFilePathList. For details about how to generate and create certificates, see Self-signed Certificate Creation Methods.
"mxpi_rtspsrc0": {
"factory": "mxpi_rtspsrc",
"props": {
"rtspUrl": "rtsps://username:password@xxx.xxx.xxx.xxx:xxx/xxx",
"channelId": "0",
"tlsValidationFlags": "127",
"tlsCertFilePathList": "xxx/server.crt,xxx/server.key,xxx/ca.crt,<cert_password>",
"fpsMode": "1"
},
"next": "mxpi_videodecoder0"
},