The current problem I am working on is to send stream from Raspberry Pi to Mac OSX using Gstreamer and extract frames from Gstreamer using OpenCV. Here is my code:
Mac:
cv::VideoCapture cap("tcpclientsrc host=129.31.224.100 port=8888 ! gdpdepay ! rtph264depay ! avdec_h264 ! "
"videoconvert ! appsink");
if (!cap.isOpened()) {
printf("=ERR= can't create video capture\n");
return -1;
}
RPi:
gst-launch-1.0 wrappercamerabinsrc ! video/x-raw,
framerate=30/1, width=1280, height=720, format=RGB !
videoconvert ! vtenc_h264 ! h264parse !
rtph264pay config-interval=1 pt=96 ! gdppay !
tcpserversink host=129.31.224.100 port=8888
The error message is:
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!
=ERR= can't create video capture
The thing I want to achieve is to read frames from gstreamer by using OpenCV.
The above command works in command line, but not working in C++ code.
Thank you in advance!