Opencv Gstreamer Pipeline VideoCapture doesn't work on Raspberry Pi 4

asked 2020-01-16 02:00:32 -0600


I'm trying to straem Gstreamer video (Gazebo Simulation) to Raspberry Pi 4 via UDP stream using gstreamer.

Gazebo Sim Camera --- (port 5600) ----> Raspberry Pi 4

Capture video by using VideoCapture of Opencv Function. And add some features of OpenCV.

The problem is that I can easily handle video with:

VideoCapture video("udpsrc port=5600 ! application/x-rtp,payload=96,encoding-name=H264 !"
                               "rtpjitterbuffer mode=1 ! rtph264depay ! h264parse ! decodebin ! videoconvert ! appsink emit-signals=true sync=false max-buffers=1 drop=true", CAP_GSTREAMER);

But this pipeline of gstreamer doesn't work on Raspberry pi 4.

Furthermore Raspberry Pi 4 can open and receive video with this code: C++ Opencv Gstreamer Pipeline

But it's hard to face with this code to manipulate it.

Note: I tried this code another Ubuntu PC and it works well.

edit retag flag offensive close merge delete


"doesn't work" doesn't give much hint about the problem. _Something_ always happens - or something expected doesn't happen. Often there is an error message.

mvuori gravatar imagemvuori ( 2020-01-16 08:06:13 -0600 )edit

You are right the problem begins there. OpenCV doesn't throw any exception about this issue. I found issue by using std::cout<<getBuildInformation()<<std:endl; function. OpenCV doesn't recognize GStreamer but I don't know why. Buster debian comes with gstreamer plugins loaded. Now I'm trying with -D WITH_GSTREAMER=ON flag. I'll share the result with you.

bozkurthan gravatar imagebozkurthan ( 2020-01-17 00:34:36 -0600 )edit

Raspbian doesn't comes with GSTEAMER. You have to install it by yourself. I will wait for new version OpenCV 4.2.1 by mid April or later. Debian is for pc and Raspbian is for ARM

supra56 gravatar imagesupra56 ( 2020-01-17 10:17:45 -0600 )edit

Yeah, I mean buster raspbian. And I'll check latest clean raspbian image for you and add answer. If I remeber correct it comes :)

bozkurthan gravatar imagebozkurthan ( 2020-02-12 23:13:09 -0600 )edit