Hello,
Im trying to get a simple rtsp stream working in python, shouldn’t be too hard, and I did get it to work for a while, but as I was testing with some random streams, something broke. With same pipeline image suddenly became grayscale and there are different channels in bottom, as shown in the attached image??
I my pipeline is
cv2.VideoCapture('rtspsrc location=rtsp://10.42.0.161:5540/ch0 latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! videorate ! videoscale ! video/x-raw,format=(string)I420,framerate=30/1,width=600,height=400 ! queue ! appsink sync=false', cv2.CAP_GSTREAMER)
I have tried few formats, and even different streaming app, but it’s all the same :(
Using next closest command on PC doesn’t have these issues…
gst-launch-1.0 rtspsrc location=rtsp://10.42.0.161:5540/ch0 latency=0 ! rtph264depay ! h264parse ! avdec_h264 ! videorate ! videoscale ! video/x-raw,format=I420,framerate=30/1,width=600,height=400 ! queue ! autovideosink sync=false
Hi,
It is more like an issue in the source. Maybe the network is not stable?
There is another user hitting issue in unstable RTSP source:
[url]JETPACK3.3 TX2 GSTREAER could not read from connection - Jetson TX2 - NVIDIA Developer Forums
You may try to run ‘sudo jetson_clocks’. Max performance probably can help the case.
edit: I found that I had mistake in conversion to jpeg for jupyter notebook. Was reading stream as BGR, but it was in I420.
All working now.
Thanks @DaneLLL for effort :)