链接opencv
const char* gstconfig="rtspsrc location=\"rtsp://admin:xxx1234$@10.34.100.243/LiveMedia/ch1/Media1\" ! rtph265depay ! h265parse ! omxh265dec! nvvidconv !video/x-raw, format=(string)BGRx! videoconvert ! appsink sync=false"
VideoCapture cap(gstconfig, CAP_GSTREAMER);
硬件解码 拉流rtsp
sudo gst-launch-1.0 rtspsrc location=\"rtsp://admin:xxx1234@10.34.100.243/LiveMedia/ch1/Media1\" latency=0 ! queue ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw! videoconvert ! nveglglessink sync=false
硬件解码 拉流rtsp
sudo gst-launch-1.0 rtspsrc location=\"rtsp://admin:xxx1234@10.34.100.243/LiveMedia/ch1/Media1\" latency=0 ! queue ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! video/x-raw! videoconvert ! nveglglessink sync=false
软件解码 拉流rtsp
sudo gst-launch-1.0 rtspsrc location=\"rtsp://admin:xxx1234@10.34.100.243/LiveMedia/ch1/Media1\" latency=0 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! nveglglessink sync=false
硬件解码 打开本地视频
sudo gst-launch-1.0 filesrc location=/home/nvidia/szx/GstreamCv/sample_1080p_h264.mp4 ! qtdemux name=demux ! h264parse ! nvv4l2decoder ! nvvidconv ! video/x-raw ! nveglglessink -e
该博客介绍了如何利用Gstreamer在OpenCV中实现RTSP流的硬件解码,包括了针对H264编码的三种不同解码方式:NVIDIA的NVVIDCONV、NVV4L2DEC以及AVDEC_H264。同时,还展示了如何打开本地H264视频文件进行硬件解码。这些方法适用于需要高效解码RTSP流或者本地视频的场景。

2130

被折叠的 条评论
为什么被折叠?



