I'm trying to use opencv via aruco to read an UDP-Stream via Network on Ubuntu 14.04 LTS using OpenCV 3.1.0 and Gstreamer 1.2.4. I changed the code of the "aruco_simple.cpp" Example file to accomplish that, by changing the parameter of the VideoCapturer constructor to the GStreamer Pipeline:
string PIPELINE_DEF = "udpsrc uri=udp://192.168.71.50:49152 do-timestamp=true name=src blocksize=1316 closefd=false buffer-size=100 !" \
"tsdemux !" \
"queue !" \
"avdec_h264 max-threads=0 !" \
"videoconvert !" \
"xvimagesink name=opencvsink"
//"appsink !"
;
aruco::CameraParameters CamParam;
// read the input image
cv::Mat InImage;
// Open input and read image
//VideoCapture vreader(argv[1]);
VideoCapture vreader(PIPELINE_DEF);
Executing this I always get the following Error:
OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/osboxes/Aruco/opencv-3.1.0/modules/videoio/src/cap_gstreamer.cpp, line 834
Exception :/home/osboxes/Aruco/opencv-3.1.0/modules/videoio/src/cap_gstreamer.cpp:834: error: (-2) GStreamer: unable to start pipeline
in function cvCaptureFromCAM_GStreamer
I found this Bug here http://code.opencv.org/issues/3953 But the solution does not help me in my case.
If I start a GStreamer Pipeline directly (without aruco and opencv) in Python it works.
GStreamer was found by opencv according to the cmake output:
-- GStreamer:
-- base: YES (ver 1.2.4)
-- video: YES (ver 1.2.4)
-- app: YES (ver 1.2.4)
-- riff: YES (ver 1.2.4)
-- pbutils: YES (ver 1.2.4)