[英]RTSP Streaming with Gstreamer and OpenCV (Python)
I know there's lots of similar questions out there, however, I couldn't find any working solution to my problem.我知道那里有很多类似的问题,但是,我找不到任何可行的解决方案来解决我的问题。 So I've been trying to run a Gstreamer pipeline inside OpenCV's VideoCapture() object.所以我一直在尝试在 OpenCV 的 VideoCapture() 对象中运行 Gstreamer 管道。 I've tried:我试过了:
cap = cv2.VideoCapture('v4l2src ! xvimagesink')
but that results in get an Assertion Failed error .但这会导致Assertion Failed 错误。
I will actually use rtsp stream from IP camera but for simplicity, I gave the basic USB webcam pipeline as example.我实际上将使用来自 IP 摄像头的 rtsp 流,但为简单起见,我以基本的 USB 网络摄像头管道为例。 My cv2.getBuildInformation()
output states YES for Gstreamer.我cv2.getBuildInformation()
的输出是规定了的Gstreamer。
I am working on Nvidia Jetson Nano with Python3 and OpenCV 4.1 installed afterwards.我正在使用 Nvidia Jetson Nano,之后安装了 Python3 和 OpenCV 4.1。 It would be great if I could achieve this so I can carry on with processing the stream etc.如果我能做到这一点,那就太好了,这样我就可以继续处理流等。
Thanks in advance!提前致谢!
不应该是这样的:
cap = cv2.VideoCapture('v4l2src ! videoconvert ! appsink', cv2.CAP_GSTREAMER)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.