Use Gst-RTSP-Server with OpenCV c++ Windows

anuragkush anuragk at sitpune.edu.in
Fri Mar 13 11:23:41 UTC 2020


I am able to successfully use GStreamer to transmit `videotestsrc` to RTSP
and received it using VLC on windows using  gst-rtsp-server test-video.c
<https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-video.c>  

Now I have built OpenCV with GStreamer and successfully transmitted UDP
stream and received it via GStreamer command. I am reading a video and
sending it to localhost.

Code to stream UDP is:

    #include <opencv2\opencv.hpp>
    #include <opencv2\core\core.hpp>
    #include <opencv2\highgui\highgui.hpp>
    
    using namespace cv;
    
    VideoCapture cap;
    int _tmain(int argc, _TCHAR* argv[])
    {
    
    	Mat image1,frame;
    	/*Read Image*/
    
    
    	/*Read Video*/
    	cap.open("Wildlife.mp4");
    	VideoWriter out = VideoWriter("appsrc ! queue ! videoconvert !
video/x-raw, format=I420, width=640, height=360, framerate=30/1 ! rtpvrawpay
! udpsink host=127.0.0.1 port=5004",CAP_GSTREAMER,0,30,Size(640,360));
    	while(1)
    	{
    		cap>>frame;
    		if(frame.empty())
    			break;
    		out.write(frame);
    		imshow("frame",frame);
    		cvWaitKey(30);
    
    	}
    	return 0;
    }

Now I want to send a stream of my cv::Mat frames via RTSP so that it can be
played via VLC or any other video player. I am also following  this
<https://stackoverflow.com/questions/55410507/how-can-i-write-open-cv-frames-to-an-rtsp-stream-with-gstreamer-and-c>  
question but it is so confusing





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list