Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) GPU rtx 2080ti
**• DeepStream NGC lastest
• NVIDIA GPU Driver Version (valid for GPU only)
import sys
import cv2
gst = "rtspsrc location=rtsp://admin:abcd1234@192.168.1.101:554/Streaming/Channels/101?transportmode=mcast&profile=Profile_1 ! \
rtph264depay ! h264parse ! nvv4l2decoder ! \
video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw,format=BGR ! appsink"
# uri = "rtsp://admin:abcd1234@192.168.1.101:554/Streaming/Channels/101?transportmode=mcast&profile=Profile_1"
# latency = 0
# gst = ('rtspsrc location={} latency={} ! '
# 'rtph264depay ! h264parse ! avdec_h264 ! '
# 'videoconvert ! appsink').format(uri, latency)
cap = cv2.VideoCapture(gst, cv2.CAP_GSTREAMER)
while True :
ret, frame = cap.read()
cv2.imshow('frame',frame)
if(cv2.waitKey(1) & 0xFF == ord('q')):
break;
nvv4l2decoder can not output BGRx format video.
Please run gst-launch-1.0 command to try your pipeline before you write the script.
i am successful run command on terminal
gst-launch-1.0 playbin uri="rtsp://admin:abcd1234@192.168.1.101:554/Streaming/Channels/101?transportmode=mcast&profile=Profile_1"::latency=0::h264parse::videoscale::videoconvert::nvv4l2decoder::nvvideoconvert::nveglglessink
i fixed my errors. but it still cannot read video
import sys
import cv2
gst = "rtspsrc location=rtsp://admin:abcd1234@192.168.1.101:554/Streaming/Channels/101?transportmode=mcast&profile=Profile_1 ! \
rtph264depay ! h264parse ! nvv4l2decoder ! \
video/x-raw ! videoconvert ! appsink"
# uri = "rtsp://admin:abcd1234@192.168.1.101:554/Streaming/Channels/101?transportmode=mcast&profile=Profile_1"
# latency = 0
# gst = ('rtspsrc location={} latency={} ! '
# 'rtph264depay ! h264parse ! avdec_h264 ! '
# 'videoconvert ! appsink').format(uri, latency)
cap = cv2.VideoCapture(gst, cv2.CAP_GSTREAMER)
while True :
ret, frame = cap.read()
cv2.imshow('frame',frame)
if(cv2.waitKey(1) & 0xFF == ord('q')):
break;
playbin has its own pipeline, it is different to the pipeline you are using. you need to use gst-launch to build your own pipeline.
nvv4l2decoder can not output “video/x-raw” either. Please refer to Gst-nvvideo4linux2 — DeepStream 5.1 Release documentation and deepstream_python_apps/deepstream_test_1.py at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub for the correct usage of nvv4l2decoder.