在python中,我读取了摄像头中的图像,并对其进行了处理。现在我希望能够将每帧处理后的图像输出为 RTSP 流,并且可以在 VLC Player 中播放,是否有低延迟的解决方案?
What’s your sensor format?
For YUV sensor please search the “v4l2src rtsp”.
For Bayer sensor search “nvarguscamerasrc rtsp”
感谢您的回复。我使用 opencv 对图像处理后,格式为 BGR 格式,我该使用什么工具来创建 RTSP 流?
Hi
There is a python sample in DeepStream SDK:
Please refer to it and apply to your use-case.
您好,执行后有以下提示:
$ python deepstream_test1_rtsp_out.py
Traceback (most recent call last):
File "/home/testpc/Desktop/deepstream_python_apps-1.1.11/apps/deepstream-test1-rtsp-out/deepstream_test1_rtsp_out.py", line 33, in <module>
import pyds
ImportError: libnvds_meta.so: cannot open shared object file: No such file or directory
重新安装 pyds 时提示:
$ pip install pyds
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pyds in /home/testpc/.local/lib/python3.10/site-packages (1.1.11)
Requirement already satisfied: pgi in /home/testpc/.local/lib/python3.10/site-packages (from pyds) (0.0.11.2)
Requirement already satisfied: PyGObject in /usr/lib/python3/dist-packages (from pyds) (3.42.1)
Requirement already satisfied: pycairo>=1.16.0 in /usr/lib/python3/dist-packages (from PyGObject->pyds) (1.20.1)
Hi,
The sample may not work properly if you don’t install DeepStream SDK. We would suggest check the code about configuring RTSP output in the sample and apply to your use-case.
我重新安装 deepstream v7.0 后,再次运行,提示以下信息:
$ python deepstream_test1_rtsp_out.py -i rtsp://admin:admin123@192.168.1.108:554/cam/realmonitor?channel=1&subtype=0
[1] 13272
创建Pipeline
创建Source
创建H264Parser
创建Decoder
创建H264 Encoder
Is it Integrated GPU? : 1
创建H264 rtppay
播放文件 rtsp://admin:admin123@192.168.1.108:554/cam/realmonitor?channel=1
将元素添加到Pipeline
在Pipeline中链接元素
*** DeepStream: 在rtsp://localhost:8554/ds-test 启动RTSP流媒体 ***
启动pipeline
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
WARNING: Deserialize engine failed because file path: /home/testpc/Desktop/deepstream_python_apps-1.1.11/apps/deepstream-test1-rtsp-out/../../../../samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b30_gpu0_int8.engine open error
0:00:04.651282206 13272 0xaaaaf6d7c230 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2083> [UID = 1]: deserialize engine from file :/home/testpc/Desktop/deepstream_python_apps-1.1.11/apps/deepstream-test1-rtsp-out/../../../../samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b30_gpu0_int8.engine failed
0:00:04.974629010 13272 0xaaaaf6d7c230 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2188> [UID = 1]: deserialize backend context from engine from file :/home/testpc/Desktop/deepstream_python_apps-1.1.11/apps/deepstream-test1-rtsp-out/../../../../samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b30_gpu0_int8.engine failed, try rebuild
0:00:04.974694065 13272 0xaaaaf6d7c230 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2109> [UID = 1]: Trying to create engine from model files
WARNING: INT8 calibration file not specified/accessible. INT8 calibration can be done through setDynamicRange API in 'NvDsInferCreateNetwork' implementation
NvDsInferCudaEngineGetFromTltModel: Failed to open TLT encoded model file /home/testpc/Desktop/deepstream_python_apps-1.1.11/apps/deepstream-test1-rtsp-out/../../../../samples/models/Primary_Detector/resnet18_trafficcamnet.etlt
ERROR: Failed to create network using custom network creation function
ERROR: Failed to get cuda engine from custom library API
0:00:10.017486282 13272 0xaaaaf6d7c230 ERROR nvinfer gstnvinfer.cpp:676:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2129> [UID = 1]: build engine file failed
free(): double free detected in tcache 2
For DeepStream SDK related issue, please open your topic at Latest Intelligent Video Analytics/DeepStream SDK topics - NVIDIA Developer Forums
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.